tamray_tech
asked on
Powershell script to add attributes of AD users
I have another question open, in regards to updating user account information in a Win 2008 environment, but I believe it will not work until I add some necessary attributes. Most users on our AD network were imported with the bare minimum of attributes configured. I need to add the full UPN in the Account settings tab (see screen shot). At this time, only the [pre-windows-2000] info is present. This is a federated domain and setting the UPN suffix is easily done via user properties, but I also need the logon name field populated for about 1500 users.
Screenshot-7.png
Screenshot-7.png
To set UPN for single user we can use..
Bulk modification is depends on your input.. if you have a text file of all users samaccountname and your domain name is same then you can try..
Set-ADUser User -UserPrincipalName User@domain.com
Bulk modification is depends on your input.. if you have a text file of all users samaccountname and your domain name is same then you can try..
GC User.txt | % {Set-ADUser $_ -UserPrincipalName "$_@domain.com"}
input file format..UserA
UserB
UserC
ASKER
That is the dilemma... None of these current users show anything in the logon name, which I need to be there in order to change the other attributes. We do not have a text file containing all the users sam accounts either and recreating them one by one is not practical. However, the user does show up in account settings under [pre-windows-2000]. If I could export that info, I can create the proper csv file to make the rest of the changes.
Is this users created in same OU?
are you getting result when you run Get-ADUser agaist the user whcih you posted?
Get-ADUser asomody98
BTB You can use pre Windows 2000 logon name (sAMAccountName) to modify the account..
are you getting result when you run Get-ADUser agaist the user whcih you posted?
Get-ADUser asomody98
BTB You can use pre Windows 2000 logon name (sAMAccountName) to modify the account..
ASKER
That works... I get all the user info
Ok.. Is this users created in same OU?
ASKER
Ok... I am ready to accept both solutions. Please post your sam account solution here, so I can accept it and I will accept your previous solution on the other question.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Big help!
You can use variables to populate fields with existing values, concatenate text, etc.
http://admodify.codeplex.com/