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

Posted on 2013-05-24
Last Modified: 2013-05-24
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
Question by:namerg
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Author Comment

ID: 39195678
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

LVL 40

Accepted Solution

Subsun earned 500 total points
ID: 39195754
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.
LVL 40

Expert Comment

ID: 39195805
Ahh.. that wasn't necessary.. You could have accepted your comment as answer.. I just added it for your information.. :-)

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A procedure for exporting installed hotfix details of remote computers using powershell
Auditing domain password hashes is a commonly overlooked but critical requirement to ensuring secure passwords practices are followed. Methods exist to extract hashes directly for a live domain however this article describes a process to extract u…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : All lightning effects with instructions : http://www.mediaf…

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question