NAME IT
Hello, I have some user that have their "NAME" field wrong. That field is a combination of the firstname space lastname (well there is a lower upper case in the firstname but don't think that it would really matter to have the first letter of the firstname in capital and the rest in lowe case...) Anyway, I am looking for a script that woul replace the incorrect "NAME" filed by the firstname space lastname. In fact just below you have the user "USER2011" who is set properly and the user "USER2010" who is NOT set well and has a wrong Name. Would you know any command that would make that change??? [PS] C:\Graig>Get-Mailbox -Identity USER2011 | get-user | select firstname, lastname,name FirstName Name LastName -------- -------- -------- FIRST11 First11 LAST11 LAST11 [PS] C:\Graig>Get-Mailbox -Identity USER2010 | get-user | select firstname, lastname,name FirstName Name LastName -------- -------- -------- FIRST10 LAF LAST10 Many thanks in advance, Graig
April 5th, 2011 10:07am

Here ya go. You'll want to add some filters to the first line to refine the objects you wish to work with: $Users = Get-User $Users | foreach {($FullName = $_.FirstName + ' ' + $_.LastName); Set-User -Identity $_.Identity -Name $FullName} Mike Crowley | MVP My Blog -- Planet Technologies
Free Windows Admin Tool Kit Click here and download it now
April 29th, 2011 10:16am

Here ya go. You'll want to add some filters to the first line to refine the objects you wish to work with. This will also run into errors if someone doesn't have a firstname or lastname value. $Users = Get-User $Users | foreach {($FullName = $_.FirstName + ' ' + $_.LastName); Set-User -Identity $_.Identity -Name $FullName} Mike Crowley | MVP My Blog -- Planet Technologies
April 29th, 2011 10:16am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics