User Profile
KK-UK
Copper Contributor
Joined 6 years ago
User Widgets
Recent Discussions
Re: Update e-mail address via csv
Just to add... this is the script we used to use (we haven't had to do this for a while) it used to work fine but now although it changes the username the primary e-mail was still the old one. $users = Import-Csv c:\path foreach($user in $users){ Set-MsolUserPrincipalName -UserPrincipalName $user.UserPrincipalName -NewUserPrincipalName $user.FullEmail4.4KViews0likes2CommentsUpdate e-mail address via csv
hi guys, The tenacy I manage has a lot of users. They have just bought a new domain name and want to assign a new primary address to everyone whilst keeping their exisiting address as an alias so not to miss future mails. I know this can be done in the GUI now by batch selecting users and clicking change domain but this will base the new address on their current username and they might want to change the format of the new one. I've looked at how to do this in powershell using a script to pull data from a csv where one column has existing address and another column with the new one. I've ran a test and it seems to of worked as expected but just wanted to check with you guys if these seem like the right commands so that there isn't a knock on effect i'm not aware of: Import-Csv 'C:temp\filelocation.csv' | ForEach-Object { Set-Mailbox $_."UserPrincipalName" -WindowsEmailAddress $_."NewEmailAddress" -MicrosoftOnlineServicesID $_."NewEmailAddress" } The only thing I noticed is a warning that appeared but apparently it can be ignored? WARNING: UserPrincipalName "emailaddress" should be same as WindowsLiveID "emailaddress", UserPrincipalName should remain as"emailaddress". Thanks!4.5KViews0likes3Comments
Recent Blog Articles
No content to show