|
[x]
Posted via EE Mobile
|
|
| Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
|
|
|
|
Asked by Nomadics in Active Directory, Lightweight Directory Access Protocol (LDAP)
I'm really pretty stuck here. I'm attempting to add a group from Domain A to be a member of a group in Domain B. The group in domain a is a universal group, and the group in domain B is a Domain Local.
I can do this manually with the desired user account using Active Directory Users and Computers, but I can't get it done programmatically. I've tried several variations, and they all fail, usually with not so helpful hints. Here's the latest version of the code. When I run it, I get a '
{"The server is unwilling to process the request. (Exception from HRESULT: 0x80072035)"}
If I have to, I could instead just attach the SID to the SID history, but it's not really what I want to do.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
|
Dim actName As NTAccount = New NTAccount("<domain>\<username>")
Dim sid As SecurityIdentifier = actName.Translate(GetType(SecurityIdentifier))
' Once the SecurityIdentifier is get it we can get the DirectoryEntry as follow:
Dim SidSearchFormat As String = "LDAP://<SID={0}>"
Dim IcxPG As New DirectoryEntry("LDAP://CN=0128,ou=projects,ou=utility objects, dc=domain,dc=com")
IcxPG.Properties("member").Add(String.Format(SidSearchFormat, sid.Value))
IcxPG.CommitChanges()
|
20091111-EE-VQP-92 - Hierarchy / EE_QW_3_20080625