Solved

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

Posted on 2013-05-24
3
1,952 Views
Last Modified: 2013-05-24
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
Comment
Question by:namerg
  • 2
3 Comments
 

Author Comment

by:namerg
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

0
 
LVL 40

Accepted Solution

by:
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.
0
 
LVL 40

Expert Comment

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

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

The article will show you how you can maintain a simple logfile of all Startup and Shutdown events on Windows servers and desktops with PowerShell. The script can be easily adapted into doing more like gracefully silencing/updating your monitoring s…
This article will help you understand what HashTables are and how to use them in PowerShell.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

705 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now