Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AD - Change oAccount.CN

Status
Not open for further replies.

Brysk

Technical User
Aug 22, 2003
77
0
0
NC
We need to change every name and displayname in our active directory.

I am using this code:
oAccount.cn = oAccount.sn & ", " & oAccount.givenName
oAccount.displayname = oAccount.sn & ", " & Account.givenName & " (Valleyfield - Zinc)"
oAccount.SetInfo

But when it try to run oAccount.SetInfo, I receive this error.
error: "The server is unwilling to process this request"
code: 80072035

How can I change the name of my user?
 
try setting just the cn or just the displayName so you can tell which one it is having problems with
 
The CN is my problem, displayname is working.
 
I find the solution, we cannot change the CN, we need to move the account.

oAccount.displayname = oAccount.sn & ", " & Account.givenName & " (Valleyfield - Zinc)"
oAccount.SetInfo
Set objOU = GetObject("LDAP://CN=Users,DC=ENTERPRISE,DC=NET")
vNewCN = "CN=" & oAccount.sn & "\, " & oAccount.givenName
objOU.MoveHere "LDAP://" & oAccount.DistinghedName, vNewCN
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top