Author Topic: Active Directory username variable  (Read 3445 times)

0 Members and 1 Guest are viewing this topic.

Offline El JoNNo

  • Posts: 1779
  • Gender: Male
  • EMOTRUCCI
Active Directory username variable
« on: September 05, 2011, 02:38:37 AM »
I have about 200 AD accounts to make and i would like to just copy an account and change the name, email etc.. But not the profile path. For example if I copy John Doe's account his profile path will be
\\homecluster\Doej$\profile

then Jane Smith's account will have the same profile path. Now i'm certain there is a way to create a profile path that grabs the User Logon name as a variable. This way I would not have to change the path at all, I just can't remember how to do it. Even google is not helping me, I am probably not using the proper LDAP terms.

This is what I remember what it is suppose to be i just can't confirm.

\\homecluster\%username%$\profile
or
\\homecluster\%sAMAccountName%$\profile

Any thoughts?

Offline SDFprowler

  • DT.net Veteran
  • ****
  • Posts: 61
  • Gender: Male
Re: Active Directory username variable
« Reply #1 on: September 05, 2011, 04:33:25 AM »
Computer programmer here. 

When I deal with AD in code for a website, I programmatically get which ever properties I need based on the HttpContext's User.Identity.Name.  I can tell you that sAMAccountName is correct - it should give you the AD username.  However I'm not entirely sure what you're using to do what you're doing.  Hope it helps though, good luck!