I am trying to create a new Active Directory user in .net 3.5 and I am recieving the following error "You were not connected because a duplicate name exists on the network."
- I have googled the error and I can not find anything related to this on Windows server 2008 and .net 3.5.
- I can create a new user when using AD users and groups on the server.
- We are using identity impersonate and the user has full access to AD.
- I can create the user on my local development machine. 开发者_如何学Python
- This is on a Windows 2008 server using .net 3.5
Here is the code we are using:
newPassword = GeneratePassword()
ctx = New PrincipalContext(ContextType.Domain, "Domain",containerDistinguishedName)
user = New UserPrincipal(ctx, userName, newPassword, enabled)
' Force the user to change the initial password on first logon
user.ExpirePasswordNow()
' Commit the new object to Active Directory
user.Save()
' Return success
Return newPassword
It sounds like the server may be the thing that is not connected to the domain. This is possibly due to the machine being cloned and reusing the SID or name of the machine. Are you able to manage active directory users from this machine using the active directory users and groups tool?
精彩评论