Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2464
  • Last Modified:

No User logon name populated under Account Tab in AD User Properties

Hello,
I am working on a script that is creating a user in AD with certain attributes. It creates fine, tested login in with it but just wondering that the "User logon name" text box is blank along with drop down menu to choose the domain name.
Piece of the user creation code:
$sam = $_."Last Name".ToLower() + $_."First Name".substring(0,1).ToLower()
New-ADUser $sam -AccountPassword $setpass -OtherAttributes @{givenName=$_."First Name";sn=$_."Last Name"; displayName=$_."Last Name" + ", " + $_."First Name"; title=$_."Job Title"; employeeNumber=$_."Clock Number"}

Open in new window

Thanks for your help
0
namerg
Asked:
namerg
  • 2
1 Solution
 
namergSystems AdministratorAuthor Commented:
I think I got it, I had to add the userPrincipalName attrribute

New-ADUser $sam -AccountPassword $setpass -OtherAttributes @{userPrincipalName=$sam + $domain; givenName=$_."First Name";sn=$_."Last Name"; displayName=$_."Last Name" + ", " + $_."First Name"; title=$_."Job Title"; employeeNumber=$_."Clock Number"}

Open in new window

0
 
SubsunCommented:
You are right.. UPN is not auto populated when you use New-ADUser or New-QADUser. You need to specify it while creating the user else it will be null.
0
 
SubsunCommented:
Ahh.. that wasn't necessary.. You could have accepted your comment as answer.. I just added it for your information.. :-)
0

Featured Post

Ready for your healthcare security check-up?

In the past few years, healthcare organizations have become a prime target for advanced attacks. Does your organization have what it needs to defend itself? Schedule your healthcare security check-up today and download our free Healthcare Security Resource Kit today!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now