- Mastering Office 365 Administration
- Thomas Carpe Nikkia Carter Alara Rogers
- 183字
- 2021-06-25 22:09:22
Updating contact information
Editing contact information for users is self-evident, and can be done using the Edit button to the right of the Contact information section or using the Edit contact information link in the bulk user menu. Note that the bulk user option will replace all existing contact information, including blanks, so use with care. PowerShell would be a better option if you need to preserve existing information.
To set contact info in PowerShell, first use Get-MsolUser. Pipe the output from this command to Set-MsolUser and specify any of the parameters for contact information such as:
- -Office
- -Department
- -Title
- -MobilePhone
- -PhoneNumber
- -Fax
- -StreetAddress
- -City
- -State
- -PostalCode
- -Country
Here's a very simplified example:
$user = Get-MsolUser -UserPrincipalName jdeer@liquidhgdev.onmicrosoft.com
$user | Set-MsolUser -Title "Muppet Master" -Department "Sesame Street" -Office "CTW"
In many cases, if you want to leave a value unchanged, you could pass the output from Get-MsolUser along or simply not specify the parameter at all. For example, you could write a complex script to update user contact data from a spreadsheet, but only if there isn't already data in Office 365.