Update user contact details

You are here:
< Back

Create a CSV file with following table format

userPrincipalName title firstname lastname displayname department office country mobilephone phonenumber fax

aaa1@redmondcloud.com

Mr.

AA Test User

A TU1

AA Test User A TU1

IT

Agnice

INDIA

9999999991

2222221

2323231

aaa2@redmondcloud.com

Mr.

AA Test User

A TU2

AA Test User A TU2

Accounts

Manappat

OMAN

9999999992

2222222

2323232

aaa3@redmondcloud.com

Mr.

AA Test User

A TU3

AA Test User A TU3

IT

Agnice

INDIA

9999999993

2222223

2323233

Note: “Company name” is replaced with “Office”

Open the powershell ise

Run the following command

Import-Module MSOnline

and

Connect-MsolService

Note: This will prompt you to enter the Global admin username and password.

Now run the following command.

Import-CSV updateaaausers.csv |%{Set-MsolUser -userPrincipalName $_.UserPrincipalName -title $_.title -firstname $_.firstname -lastname $_.lastname -displayname $_.displayname -department $_.department -office $_.office -country $_.country -mobilephone $_.mobilephone -phonenumber $_.phonenumber -fax $_.fax}

Kindly refer this help article, if any module needs to be installed

https://support.office.com/en-us/article/Managing-Office-365-and-Exchange-Online-with-Windows-PowerShell-06a743bb-ceb6-49a9-a61d-db4ffdf54fa6

Troubleshooting “execution of scripts is disabled on this system.”

Set-ExecutionPolicy RemoteSigned

Bypass the error “not digitally signed”

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

Can't find the answer?