WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

ADSI
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Set Logon Name - ADSI


Question:

Sorry if this sounds simple I'm new to ADSI and I wish to re-set the log on name (userPrincipalName) as it was not set when the domain admin imported from 2000 to 2003 server. Can someone please help?

Answer:

You can set the UPN via the extender with the following:
; !Not tested!
sUserName = dsGetProperty(sObjectPath, "samAccountName")
sUpn=strcat(sUserName,"@",sDnsDomain)
dsSetProperty(sObjectPath, "userPrincipalName", sUpn)
Where sObjectPath is the users LDAP style moniker and sDnsDomain is the DNS style domain name (yourdomain.yourcompany.com or whatever).

Commonly, the UPN is the samAccountName, an '@' and the domain name in dot notation. This makes it easier for the user to remember .

User Reply:

Thanks that worked

sAdsiPath = "LDAP://%pdc%"
; 
; Find the complete path to the user object.
sUserPath = dsFindPath(sAdsiPath, "cn=*%name%")
sUserPath = ItemExtract(1, sUserPath, @TAB)
sUpn = strcat(newid, "@", domain)

dsSetProperty(sUserPath, "userPrincipalName", sUpn)


Article ID:   W16324
File Created: 2005:02:18:12:19:48
Last Updated: 2005:02:18:12:19:48