3
我的代碼來獲得本地組例子成員成員管理員檢查組本地用戶的
private void GetUserGrps()
{
using (DirectoryEntry groupEntry = new DirectoryEntry("WinNT://./Administrators,group"))
{
foreach (object member in (IEnumerable)groupEntry.Invoke("Members"))
{
using (DirectoryEntry memberEntry = new DirectoryEntry(member))
{
new GUIUtility().LogMessageToFile(memberEntry.Path);
}
}
}
有沒有辦法讓本地用戶所屬的組使用目錄服務?
沒有使用Active Directory或域,因爲我只需要本地機器而不是域。
沒你今天問這個問題前面? - http://stackoverflow.com/questions/3672602/find-out-user-belongs-to-which-groups – Jemes 2010-09-09 18:51:30
是的,但這是另一種方法..我需要建議... – user175084 2010-09-09 19:03:15
目錄服務非常多綁定到LDAP或Active Directory使用。這不是通過你的本地Windows機器用戶騎自行車。 – NotMe 2010-09-09 19:09:52