Set-User cmdlet is used for updating user's information.

Note: some properties can be disabled for editing if special plan's features like ADSync or Secure Mail are enabled. For example, the property is unavailable for editing if it is synchronized by ADSync.

This cmdlet supports risk-mitigation parameters.

Input parameters

#
Parameter
TypeMandatory (R/O)
Description
Restrictions/Valid Values
1  Authentication information (all parameters)
2

Identity

(aliases: GUID, DistinguishedName)

string

O*

A property that is used for managing the user

Value of one of these parameters can be used as Identity:

#ParameterDescription
1 GUID Globally Unique Identifier (ObjectGuid)
2 DistinguishedName Unique name of the object in Active Directory
3 AlternativeEmail
string O User's alternative Email address. It is used for password recovery

4 City string O Company information ( CI ): City

Max length is 128 symbols

Cannot be set if property is synced with ADSync service

5 Company string O CI: Name

Max length is 64 symbols

Cannot be set if property is synced with ADSync service

6 Country string O CI: Country

ISO 3166 codes are required for input

Max length is 50 symbols

Cannot be set if property is synced with ADSync service

7 Department string O CI: Department of the company, where the user works

Max length is 64 symbols

Cannot be set if property is synced with ADSync service

8 DisplayName string O Name of the user in the list of Control Panel

Max length is 256 symbols

Cannot be set if property is synced with ADSync service

9 Fax string O CI: Fax

Max length is 64 symbols

Cannot be set if property is synced with ADSync service

10 FirstName string O First name of the user

Max length is 64 symbols

Cannot be set if property is synced with ADSync service

11 HomePhone string O User's home phone

Max length is 64 symbols

Cannot be set if property is synced with ADSync service

12 Initials string O Initials of the user

Max length is 6 symbols

Cannot be set if property is synced with ADSync service

13 Title string O CI: User's job title

Max length is 64 symbols

Cannot be set if property is synced with ADSync service

14 LastName string O Last name of the user

Max length is 64 symbols

Cannot be set if property is synced with ADSync service

15 Manager string O Manager's Active Directory identifier Cannot be set if property is synced with ADSync service
16 MobilePhone string O User's mobile phone. It is used for password recovery.

Max length is 64 symbols

Cannot be set if property is synced with ADSync service

17 Notes string O Additional information, comments

Max length is 1024 symbols

Cannot be set if property is synced with ADSync service

18 Office string O CI: Special attribute of the office (e.g. location)

Max length is 128 symbols

Cannot be set if property is synced with ADSync service

19 Pager string O Contact's pager number

Max length is 128 symbols

Cannot be set if property is synced with ADSync service

20 Phone string O CI: User's business phone

Max length is 64 symbols

Cannot be set if property is synced with ADSync service

21 State string O CI: Name of the state

ISO 3166 codes are required for input

Max length is 128 symbols

Cannot be set if property is synced with ADSync service

22 StreetAddress string O CI: Address

Max length is 1024 symbols

Cannot be set if property is synced with ADSync service

23 UserPrincipalName string O* Primary Email address (Login)

Max length is 1024 symbols

Cannot be set if:

  • Secure Mail service is enabled for the mailbox
  • Property is synced with ADSync service
24 WebPage string O CI: Web page of contact's company

Max length is 2048 symbols

Cannot be set if property is synced with ADSync service

25 Zip string O CI: ZIP

Max length is 40 symbols

Cannot be set if property is synced with ADSync service

Note: O* - the request must contain at least one of these parameters (Identity, UserPrincipalName) or both of them. If both parameters are specified, Identity is a priority parameter, used as identifier, and UserPrincipalName is a field, which value should be updated.

Output parameters

No parameters

Examples of using Set-User cmdlet

Setting user's personal information:

Set-User -Identity "CN=JohnDoe,OU=Contoso,OU=Hosting,OU=serverdata,OU=net" -FirstName "John" -LastName "Doe" -MobilePhone "1.234.567.89.00"

Mass-update of department on several users:

Get-User test* | Set-User -Department "New Department"