Member_2_1242703
asked on
Adding a user to an ActiveDirectory security group via ASP.NET(VB) page
I'm trying to add a user to a security group using the code below. I am continuing to get the error:
"The server is unwilling to process the request. (Exception from HRESULT: 0x80072035)"
on the CommitChanges line. Any ideas??
"The server is unwilling to process the request. (Exception from HRESULT: 0x80072035)"
on the CommitChanges line. Any ideas??
Dim group As New DirectoryEntry("LDAP://xx.xxx.xxx.xxx/CN=ussrm-users,OU=Security Groups,OU=Groups,OU=xyz,OU=abc,OU=AMR,OU=myou,DC=mycorp,DC=org")
group.Properties("member").Add("LDAP://xx.xxx.xxx.xxx/sAMAccountName=myuser1,OU=Pending Users,OU=Users,OU=xyz,OU=abc,OU=AMR,OU=myou,DC=mycorp,DC=org")
group.CommitChanges()
BTW, 0x80072035 means "The server is unwilling to process the request"
check here for example:
http://www.codeproject.com/KB/system/everythingInAD.aspx#36
http://www.codeproject.com/KB/system/everythingInAD.aspx#36
ASKER
I have tried each of the following to no avail:
group.Properties("member").Add("xx.xxx.xxx.xxx/sAMAccountName=userID")
group.Properties("member").Add("sAMAccountName=userID")
group.Properties("member").Add("CN=LastName\, FirstName")
group.Properties("member").Add("10.208.251.125/CN=LastName\, FirstName")
group.Properties("member").Add("LastName, FirstName")
ASKER
Our format for CN is LastName, FirstName and for sAMAccount its just the network logon. What is the property I should be using here?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
HTH