OK, I have spent the last two days looking for a way to do this. I have written in VB.NET (a small script that will creat a new user in AD by binding to LDAP. Everything works until I get to the part where I try to set the primaryGroupID and the password. I get the error "The server is unwilling to process the request. (Exception from HRESULT: 0x80072035)"
I have been banging my head trying to get this to work using a million different ways using examples from VBScripting, Perl, VB6, everywhere and everything (except for C#, I don't know it)
I borrowed the the part about invoke(ing) the password from C#. (OK C# too)
I will be more than happy to be flamed with the answer because I have looked everywhere.
I have been banging my head trying to get this to work using a million different ways using examples from VBScripting, Perl, VB6, everywhere and everything (except for C#, I don't know it)
I borrowed the the part about invoke(ing) the password from C#. (OK C# too)
I will be more than happy to be flamed with the answer because I have looked everywhere.
Code:
Dim OU As New DirectoryEntry("LDAP://server/ou=Group,DC=company, DC=COM")
Dim User As DirectoryEntry = OU.Children.Add("CN=MMouse", "user")
User.Properties("sAMAccountName").Value = "Mickey Mouse"
User.Properties("Description").Value = "Test"
'User.Properties("primaryGroupID").Value = 2098
'User.Invoke("SetPassword", "password")
'User.Password = "password"
User.CommitChanges()