Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Alias change based on Company Attribute

$
0
0

Hi there, I need to edit the Alias details on certain users based on the Company attribute in the Organization Tab.

Can anyone advise if the following would work, I do not have the luxury of a Lab environment and therefore don't really wish to change everyones Alias to Firstname.Lastname.External 

Get-User-Filter {(Company-eq"Custard")}

 Foreach $Details=Get-User$_.Alias;$New=$Details.FirstName+"."+$Details.LastName +"."+"External"; Set-MailContact$_.Alias -Alias$New 

An output of the changes would be awesome too.

Any help is gratefully received.

Graham


Viewing all articles
Browse latest Browse all 6937

Trending Articles