1
여기를 검색하고 있습니다. 정말 내 머리를 arround 수 없습니다.vbscript to C# - 컴퓨터를 memberof (배열 검색) 그룹 목록으로 나열하십시오.
내가 가지고있는 다른 도구에 배열 목록을 제공해야합니다. 이것은 C#에서 쓰여졌습니다. 특정 컴퓨터에 대한 그룹을 모으기위한 최선책은 다음과 같습니다. 결과가 배열인데 C#에서 어떻게 보이겠습니까?
Set objComputer = GetObject("LDAP://CN=ComputerName,CN=Computers,DC=contoso,DC=com")
Set colGroups = objComputer.Groups
For Each objGroup in colGroups
Wscript.Echo objGroup.CN
GetNested(objGroup)
Next
Function GetNested(objGroup)
On Error Resume Next
colMembers = objGroup.GetEx("memberOf")
For Each strMember in colMembers
strPath = "LDAP://" & strMember
Set objNestedGroup = GetObject(strPath)
WScript.Echo objNestedGroup.CN
GetNested(objNestedGroup)
Next
End Function
감사합니다. 비슷한 C# 예가 있습니까? – Cristian