namespace tb.adblock
internal group(directoryentry entry)
this.parse(entry);
}internal group(searchresult result)
this.parse(result);
}public void add(string locationpath)
public void add(string locationpath, string username, string password)
directoryentry parent = null;
directoryentry newgroup = null;
if (string.isnullorempty(locationpath))
if (!admanager.exists(locationpath))
string rdn = utils.generaterdncn(base.name);
if (admanager.exists(utils.generatedn(rdn, locationpath)))
trycatch (directoryservicescomexception dsce)
finally
if (newgroup != null)}}
public void adduser(params string usersdn)
public void adduser(string username, string password, params string usersdn)
}foreach (string user in toadd)
de.commitchanges();
}catch (directoryservicescomexception dsce)
finally}}
public listgetmemberofdn()
public listgetmembers()
public listgetmembers(string username, string password)
}cs$1$0000 = entries;
}catch (directoryservicescomexception dsce)
}throw dsce;
}return cs$1$0000;
}public listgetusermembers()
public listgetusermembers(string username, string password)
de.close();
de.dispose();}}
cs$1$0000 = users;
}catch (directoryservicescomexception dsce)
finally
}return cs$1$0000;
}protected override void parse(directoryentry entry)
ms.sort();
this.members = ms.toarray();
}else
if (entry.properties.contains("memberof"))
ms.sort();
this.memberof = ms.toarray();
}else
}protected void parse(searchresult result)
ms.sort();
this.members = ms.toarray();
}else
if (result.properties.contains("memberof"))
ms.sort();
this.memberof = ms.toarray();
}else
}public void remove()
public void remove(string username, string password)
catch (directoryservicescomexception dsce)
finally}}
public void removeuser(params string usersdn)
public void removeuser(string username, string password, params string usersdn)
}foreach (string user in toremoves)
de.commitchanges();
}catch (directoryservicescomexception dsce)
finally}}
public void rename(string newname)
public void rename(string newname, string username, string password)
trycatch (directoryservicescomexception dsce)
finally}}
public void update()
public void update(string username, string password)
catch (directoryservicescomexception dsce)
finally}}
public string accountname
set}
}public string description
set}
public string info
set}
public string membersdn}}
}
關於AD的操作 Uitil類
namespace tb.adblock internal static bool canascontainer directoryentry de return true public static string convertdntodomainname string dn return sb....
關於AD的查詢操作
我今天才剛剛看了看ad以及ad程式設計方面的東西,看到了在.net中可以使用system.directoryservices來操作ad。directoryentry de new directoryentry ldap domaintext 查詢 directorysearcher src new ...
關於MongoDB的group分組
關於mongodb的group分組 測試條件 windows mongodb 1.8.2 先插入測試資料 for var i 1 i 20 i 1.普通 分組查詢 db.test.group initial reduce function doc,prev db.runcommand initial...