Set-AzureADMSUser
Updates a user.
Syntax
Set-AzureADMSUser
-Id <String>
[-DisplayName <String>]
[-CustomSecurityAttributes <Object>]
[-UserPrincipalName <String>]
[<CommonParameters>]
Description
Updates a user in Azure Active Directory (AD).
Examples
Example 1
PS C:\> $user = Get-AzureADMSUser -UserPrincipalName TestUser@example.com
PS C:\> $user.DisplayName = 'YetAnotherTestUser'
PS C:\> Set-AzureADMSUser -UserPrincipalName TestUser@example.com -Displayname $user.Displayname
Update a user.
Example 2
PS C:\> $attributes = @{
Engineering = @{
"@odata.type" = "#Microsoft.DirectoryServices.CustomSecurityAttributeValue"
"Project@odata.type" = "#Collection(String)"
Project = @("Baker","Cascade")
}
}
PS C:\> Set-AzureADMSUser -Id dbb22700-a7de-4372-ae78-0098ee60e55e -CustomSecurityAttributes $attributes
Assign a custom security attribute with a multi-string value to a user.
- Attribute set:
Engineering
- Attribute:
Project
- Attribute data type: Collection of Strings
- Attribute value:
("Baker","Cascade")
Example 3
PS C:\> $attributesUpdate = @{
Engineering = @{
"@odata.type" = "#Microsoft.DirectoryServices.CustomSecurityAttributeValue"
"Project@odata.type" = "#Collection(String)"
Project = @("Alpine","Baker")
}
}
PS C:\> Set-AzureADMSUser -Id dbb22700-a7de-4372-ae78-0098ee60e55e -CustomSecurityAttributes $attributes
Update a custom security attribute with a multi-string value for a user.
- Attribute set:
Engineering
- Attribute:
Project
- Attribute data type: Collection of Strings
- Attribute value:
("Alpine","Baker")
Parameters
-CustomSecurityAttributes
Custom security attributes for the user.
Type: | Object |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DisplayName
Specifies the user's display name.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Id
Specifies the ID of a user in Azure AD.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-UserPrincipalName
Specifies the user principal name of a user in Azure AD.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |