HI, I am bit confused with the powershell commands and was not able to get the best answer for below. I created an csv file with one column called "userprincipalname" and added all the user ID's as 123@test.com.
The script that i used is
//////
$csvfile= Import-Csv "C:\users.csv"Foreach($user in $csvfile){
$userprincipalname = $_.userprincipalname
Enable-RemoteMailbox -Identity $userprincipalname@company.com -RemoteRoutingAddress $userprincipalname@company.mail.onmicrosoft.com
}
////////////////
Can anyone of powershell guru help to validate if I am using right one or need to make any changes?