Get-Mailbox | Set-Mailbox @{Add="$($_.Alias)@newdomain.com"} -WhatIf
get-mailbox example_account | fl *
look at what field can be used best to build the secondary address, and then build a simple listget-mailbox | select -Expand TheAtttributeToUse | Out-File C:\Temp\listOfAccounts.txt
you can remove every account not to receive a secondary email address.Get-ADUser -Filter {Company -eq '1234'} -Property mail |
Get-Mailbox |
Set-Mailbox @{Add="$($_.mail -replace 'abcd', 1234')@1234.com"} -WhatIf
Can I do this without having to create a csv file?
Like just running a command in powershell?
If so can you show me how me how the command would be?
I am not a powershell expert.
So as I said our main domain is = adcd.com
The company we bought their domain = 1234.com
So what would the command look like to make their domain 1234.com be secondary and our domain abcd.com be primary?