I have bunch of users which DisplayNames I changed mistakenly to some string (for example: xyz)
But there is one field called Name which has FirstName and Lastname. What I want is take all users who has xyz in it and them change DisplayName to the corresponding Name.
Get-Mailbox -ResultSize Unlimited -Filter {DisplayName -like "*xyz*"} |
This gives me the array I need whose DisplayNames i need to change. What I add after the "pipe" ?
I googled a lot, however couldn't come up with the answer.
I tried:
Set-Mailbox -DisplayName $_.Name
However it says
Cannot bind parameter 'DisplayName' to the target. .... cannot be null/empty.
How can I set DisplayName to the same value as Name?