public static DirectoryEntry GetChildByIdOrDefault([NotNull] this IEnumerable<DirectoryEntry> source, string id) {
if (source == null) throw new ArgumentNullException(nameof(source));
foreach (var i in source) {
if (Equals(i.Id, id)) return i;
var child = i.Children.GetChildByIdOrDefault(id);
if (child != null) return child;
}
return null;
}
}