| title | Set-EntraBetaUser |
|---|---|
| description | This article provides details on the Set-EntraBetaUser command. |
| ms.topic | reference |
| ms.date | 03/16/2025 |
| ms.author | eunicewaweru |
| ms.reviewer | stevemutungi |
| manager | CelesteDG |
| author | msewaweru |
| external help file | Microsoft.Entra.Beta.Users-Help.xml |
| Module Name | Microsoft.Entra.Beta |
| online version | https://learn.microsoft.com/powershell/module/Microsoft.Entra.Beta/Set-EntraBetaUser |
| schema | 2.0.0 |
Updates a user.
Set-EntraBetaUser
-UserId <String>
[-PostalCode <String>]
[-CompanyName <String>]
[-GivenName <String>]
[-Mobile <String>]
[-PreferredLanguage <String>]
[-CreationType <String>]
[-UsageLocation <String>]
[-UserType <String>]
[-AgeGroup <String>]
[-MailNickName <String>]
[-ExtensionProperty <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
[-ConsentProvidedForMinor <String>]
[-ImmutableId <String>]
[-Country <String>]
[-SignInNames <System.Collections.Generic.List`1[Microsoft.Open.AzureAD.Model.SignInName]>]
[-Department <String>]
[-StreetAddress <String>]
[-PasswordPolicies <String>]
[-JobTitle <String>]
[-City <String>]
[-OtherMails <System.Collections.Generic.List`1[System.String]>]
[-UserPrincipalName <String>]
[-DisplayName <String>]
[-AccountEnabled <Boolean>]
[-PasswordProfile <PasswordProfile>]
[-State <String>]
[-TelephoneNumber <String>]
[-Surname <String>]
[-ShowInAddressList <Boolean>]
[<CommonParameters>]The Set-EntraBetaUser cmdlet updates a user in Microsoft Entra ID. Specify the UserId parameter to update a user in Microsoft Entra ID.
Update-EntraBetaUser is an alias for Set-EntraBetaUser.
Connect-Entra -Scopes 'User.ReadWrite.All'
Set-EntraBetaUser -UserId 'SawyerM@contoso.com' -DisplayName 'Updated user Name'This example updates the specified user's Display name parameter.
-UserIdSpecifies the ID as a user principal name (UPN) or UserId.
Connect-Entra -Scopes 'User.ReadWrite.All'
Set-EntraBetaUser -UserId 'SawyerM@contoso.com' -AccountEnabled $trueThis example updates the specified user's AccountEnabled parameter.
-UserIdSpecifies the ID as a user principal name (UPN) or UserId.-AccountEnabledSpecifies whether the account is enabled.
Connect-Entra -Scopes 'User.ReadWrite.All'
Get-EntraBetaUser -All | Where-Object -Property DisplayName -Match '(George|James|Education)' |
ForEach-Object { Set-EntraBetaUser -UserId $($_.Id) -AgeGroup 'minor' -ConsentProvidedForMinor 'granted' }This example updates the specified user's as minors with parental consent.
-UserIdSpecifies the ID as a user principal name (UPN) or UserId.-ConsentProvidedForMinorSets whether consent has to obtained for minors. Allowed values: null, granted, denied, and notRequired.
Connect-Entra -Scopes 'User.ReadWrite.All'
$params = @{
UserId = 'SawyerM@contoso.com'
City = 'Add city name'
CompanyName = 'Microsoft'
Country = 'Add country name'
Department = 'Add department name'
GivenName = 'Sawyer Miller G'
JobTitle = 'Manager'
MailNickName = 'Add mailnickname'
Mobile = '9984534564'
OtherMails = 'johndoe@contosodev.com'
PasswordPolicies = 'DisableStrongPassword'
State = 'UP'
StreetAddress = 'Add address'
UserType = 'Member'
}
Set-EntraBetaUser @paramsThis example updates the specified user's property.
-UserIdSpecifies the ID as a user principal name (UPN) or UserId.-UserTypeclassify user types in your directory, such as "Member" and "Guest."-PasswordPoliciesSpecifies password policies for the user.-OtherMailsSpecifies other email addresses for the user
Connect-Entra -Scopes 'User.ReadWrite.All'
Set-EntraBetaUser -UserId 'SawyerM@contoso.com' -PasswordProfile @{
Password = '*****'
ForceChangePasswordNextSignIn = $true
}This example updates the specified user's PasswordProfile parameter.
-UserIdSpecifies the ID as a user principal name (UPN) or UserId.-PasswordProfilespecifies the user's password profile.
Connect-Entra -Scopes 'User.ReadWrite.All'
Set-EntraBetaUser -UserId 'SawyerM@contoso.com' -UsageLocation 'US'This example updates the specified user's Usage Location for license management.
-UserIdSpecifies the ID as a user principal name (UPN) or UserId.-UsageLocationspecifies the user's usage location. Two-letter ISO 3166 country code. Required for licensed users to check service availability. Examples: US, JP, GB. Not nullable.
Connect-Entra -Scopes 'User.ReadWrite.All'
Get-EntraBetaUser -UserId 'SawyerM@contoso.com' | Set-EntraBetaUser -PasswordPolicies DisablePasswordExpirationThis example updates the specified user's password policy.
Possible values for password policy include:
DisableStrongPassword: Allows weaker passwords than the default policy.DisablePasswordExpiration: Prevents passwords from expiring.
You can specify both values together, for example: DisablePasswordExpiration and DisableStrongPassword. For example, Set-EntraBetaUser -UserId 'SawyerM@contoso.com' -PasswordPolicies "DisablePasswordExpiration,DisableStrongPassword".
Connect-Entra -Scopes 'User.ReadWrite.All'
$application = Get-EntraBetaApplication -Filter "DisplayName eq 'Helpdesk Application'"
$extensionName = (Get-EntraBetaApplicationExtensionProperty -ApplicationId $application.Id).Name | Select-Object -First 1
$additionalProperties = @{ $extensionName = "Survey.Report" }
Set-EntraBetaUser -UserId 'SawyerM@contoso.com' -AdditionalProperties $additionalPropertiesThis example updates the specified user's extension properties, for example, an app role for an application.
-UserIdSpecifies the ID as a user principal name (UPN) or UserId.
Connect-Entra -Scopes 'User.ReadWrite.All'
Set-EntraBetaUser -UserId 'SawyerM@contoso.com' -AdditionalProperties @{
onPremisesExtensionAttributes = @{
extensionAttribute1 = "Job Group D"
extensionAttribute2 = "Audit Role"
}
}This example updates the specified user's onPremisesExtensionAttributes properties.
-UserIdSpecifies the ID as a user principal name (UPN) or UserId.
Connect-Entra -Scopes 'User.ReadWrite.All'
Set-EntraBetaUser -UserId 'SawyerM@contoso.com' -BusinessPhones '+1 425 555 0109' -OfficeLocation '18/2111'This example updates the specified user's onPremisesExtensionAttributes properties.
-UserIdSpecifies the ID as a user principal name (UPN) or UserId.
Indicates whether the account is enabled.
Type: System.Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the user's city.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the user's country.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseIndicates whether the user account is a local account for a Microsoft Entra ID B2C tenant. Possible values are "LocalAccount" and null. When creating a local account, the property is required and you must set it to "LocalAccount". When creating a work or school account, don't specify the property or set it to null.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the user's department.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the user's display name.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseAdd data to custom user properties as the basic open extensions or the more versatile schema extensions.
Type: System.Collections.Generic.Dictionary`2[System.String,System.String]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the user's given name.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis property links an on-premises Active Directory user account to its Microsoft Entra ID user object. You must specify this property when creating a new user account in Graph if the user's userPrincipalName uses a federated domain.
Important: Do not use the $ and _ characters when specifying this property.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the user's job title.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies a nickname for the user's mail address.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the user's mobile phone number.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the ID of a user (as a User Principle Name or UserId) in Microsoft Entra ID.
Type: System.String
Parameter Sets: (All)
Aliases: ObjectId, UPN, Identity
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: FalseSpecifies other email addresses for the user.
Type: System.Collections.Generic.List`1[System.String]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies password policies for the user.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the user's password profile.
Type: PasswordProfile
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the user's postal code.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the user's preferred language.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSet to True to show this user in the address list.
Type: System.Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe list of sign in names for this user
Type: System.Collections.Generic.List`1[Microsoft.Open.AzureAD.Model.SignInName]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the user's state.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the user's street address.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the user's surname.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the user's telephone number.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseA two letter country or region code (ISO standard 3166). Required for users that assigned licenses due to legal requirement to check for availability of services in country and regions. Examples include: "US," "JP," and "GB." Not nullable.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the user's user principal name.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseA string value that can be used to classify user types in your directory, such as "Member" and "Guest."
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseUsed by enterprise applications to determine the legal age group of the user. This property is read-only and calculated based on ageGroup and consentProvidedForMinor properties. Allowed values: null, minor, notAdult, and adult. See, legal-age-group.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe company name, which the user is associated. This property can be useful for describing the company that an external user comes from. The maximum length of the company name is 64 characters.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSets whether consent has to obtained for minors. Allowed values: null, granted, denied, and notRequired.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Update-EntraBetaUser is an alias for Set-EntraBetaUser.