| title | New-EntraBetaUser |
|---|---|
| description | This article provides details on the New-EntraBetaUser command. |
| ms.topic | reference |
| ms.date | 06/21/2024 |
| 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/New-EntraBetaUser |
| schema | 2.0.0 |
Creates a Microsoft Entra ID user.
New-EntraBetaUser
-DisplayName <String>
-AccountEnabled <Boolean>
-PasswordProfile <PasswordProfile>
[-PostalCode <String>]
[-MailNickName <String>]
[-ShowInAddressList <Boolean>]
[-Department <String>]
[-TelephoneNumber <String>]
[-PreferredLanguage <String>]
[-Mobile <String>]
[-JobTitle <String>]
[-ConsentProvidedForMinor <String>]
[-PhysicalDeliveryOfficeName <String>]
[-PasswordPolicies <String>]
[-IsCompromised <Boolean>]
[-SignInNames <System.Collections.Generic.List`1[Microsoft.Open.AzureAD.Model.SignInName]>]
[-OtherMails <System.Collections.Generic.List`1[System.String]>]
[-UserState <String>]
[-ImmutableId <String>]
[-City <String>]
[-AgeGroup <String>]
[-ExtensionProperty <System.Collections.Generic.Dictionary`2[System.String,System.String]>]
[-UsageLocation <String>]
[-UserStateChangedOn <String>]
[-Country <String>]
[-UserPrincipalName <String>]
[-GivenName <String>]
[-UserType <String>]
[-StreetAddress <String>]
[-State <String>]
[-CompanyName <String>]
[-FacsimileTelephoneNumber <String>]
[-Surname <String>]
[-CreationType <String>]
[<CommonParameters>]The New-EntraBetaUser cmdlet creates a user in Microsoft Entra ID. Specify the DisplayName,AccountEnabled, and PasswordProfile parameter to create a user.
Connect-Entra -Scopes 'User.ReadWrite.All'
$passwordProfile = New-Object -TypeName Microsoft.Open.AzureAD.Model.PasswordProfile
$passwordProfile.Password = '<Password>'
$params = @{
DisplayName = 'New User'
PasswordProfile = $passwordProfile
UserPrincipalName = 'NewUser@contoso.com'
AccountEnabled = $true
MailNickName = 'Newuser'
}
New-EntraBetaUser @paramsDisplayName Id Mail UserPrincipalName
----------- -- ---- -----------------
New User 00aa00aa-bb11-cc22-dd33-44ee44ee44ee NewUser@contoso.com
This command creates a new user.
Connect-Entra -Scopes 'User.ReadWrite.All'
$passwordProfile = New-Object -TypeName Microsoft.Open.AzureAD.Model.PasswordProfile
$passwordProfile.Password = '<Password>'
$params = @{
DisplayName = 'New User'
PasswordProfile = $passwordProfile
UserPrincipalName = 'NewUser@contoso.com'
AccountEnabled = $true
MailNickName = 'Newuser'
AgeGroup = 'adult'
}
New-EntraBetaUser @paramsDisplayName Id Mail UserPrincipalName
----------- -- ---- -----------------
New User 00aa00aa-bb11-cc22-dd33-44ee44ee44ee NewUser@contoso.com
This command creates a new user.
Connect-Entra -Scopes 'User.ReadWrite.All'
$passwordProfile = New-Object -TypeName Microsoft.Open.AzureAD.Model.PasswordProfile
$passwordProfile.Password = '<Password>'
$params = @{
DisplayName = 'New User'
PasswordProfile = $passwordProfile
UserPrincipalName = 'NewUser@contoso.com'
AccountEnabled = $true
MailNickName = 'Newuser'
City = 'New York'
}
New-EntraBetaUser @paramsDisplayName Id Mail UserPrincipalName
----------- -- ---- -----------------
New User 00aa00aa-bb11-cc22-dd33-44ee44ee44ee NewUser@contoso.com
This command creates a new user.
Connect-Entra -Scopes 'User.ReadWrite.All'
$passwordProfile = New-Object -TypeName Microsoft.Open.AzureAD.Model.PasswordProfile
$passwordProfile.Password = '<Password>'
$params = @{
DisplayName = 'New User'
PasswordProfile = $passwordProfile
UserPrincipalName = 'NewUser@contoso.com'
AccountEnabled = $true
MailNickName = 'Newuser'
Department = 'IT'
}
New-EntraBetaUser @paramsDisplayName Id Mail UserPrincipalName
----------- -- ---- -----------------
New User 00aa00aa-bb11-cc22-dd33-44ee44ee44ee NewUser@contoso.com
This command creates a new user.
Connect-Entra -Scopes 'User.ReadWrite.All'
$passwordProfile = New-Object -TypeName Microsoft.Open.AzureAD.Model.PasswordProfile
$passwordProfile.Password = '<Password>'
$params = @{
DisplayName = 'New User'
PasswordProfile = $passwordProfile
UserPrincipalName = 'NewUser@contoso.com'
AccountEnabled = $true
MailNickName = 'Newuser'
Mobile = '02883655253'
}
New-EntraBetaUser @paramsDisplayName Id Mail UserPrincipalName
----------- -- ---- -----------------
New User 00aa00aa-bb11-cc22-dd33-44ee44ee44ee NewUser@contoso.com
This command creates a new user.
Indicates whether the user's account is enabled.
Type: System.Boolean
Parameter Sets: (All)
Aliases:
Required: True
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 user creating a local account, the property is required and you must set it to "LocalAccount".
- When user 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: True
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 user account to its Microsoft Entra ID object and is required when creating a new user in Microsoft Graph if the user's userPrincipalName (UPN) is in a federated domain.
Important: The $ and _ characters can't be used 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: FalseIndicates whether this user is compromised.
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 job title.
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 mail nickname.
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: FalseA list of other email addresses for the user; for example: "bob@contoso.com", "Robert@fabrikam.com".
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. This value is an enumeration with one possible value being "DisableStrongPassword", which allows weaker passwords than the default policy to be specified. "DisablePasswordExpiration" can also be specified. The two might be specified together; for example: "DisablePasswordExpiration, DisableStrongPassword".
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.
The parameter type for this parameter is "PasswordProfile".
In order to pass a parameter of this type, you first need to create a variable in PowerShell with that type:
$passwordProfile = New-Object -TypeName Microsoft.Open.AzureAD.Model.PasswordProfile
Then you can proceed to set the value of the password in this variable:
$passwordProfile.Password = "<Password>"
And finally you can pass this variable to the cmdlet:
New-EntraBetaUser -PasswordProfile $passwordProfile ...
Other attributes that can be set in the PasswordProfile are
-
$passwordProfile.EnforceChangePasswordPolicy - a boolean indicating that the change password policy is
enabledordisabledfor this user $passwordProfile. -
ForceChangePasswordNextLogin - a boolean indicating that the user must change the password at the next sign in.
Type: PasswordProfile
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the user's physical delivery office name.
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 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: FalseIf True, 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: FalseSpecifies the collection of sign-in names for a local account in a Microsoft Entra ID B2C tenant.
Each sign-in name must be unique across the company/tenant.
The property must be specified when you create a local account user; don't specify it when you create a work or school account.
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 a 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 code (ISO standard 3166).
Required for users that are assigned licenses due to legal requirement to check for availability of services in countries.
Examples include: "US", "JP", and "GB".
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe user principal name (UPN) of the user.
The UPN is an Internet-style sign-in name for the user based on the Internet standard RFC 822.
By convention, this UPN should map to the user's email name.
The general format is "alias@domain".
For work or school accounts, the domain must be present in the tenant's collection of verified domains.
This property is required when a work or school account is created; it's optional for local accounts.
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: 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: FalseSpecifies the user's age group.
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 company name.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSets whether consent was obtained for minors.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseFor an external user invited to the tenant using the invitation API, this property represents the invited user's invitation status.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseShows the timestamp for the latest change to the userState property.
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.