Share via


New-NAVServerUser

Creates a new Business Central user.

Syntax

WindowsAccount (Default)

New-NAVServerUser
    [-ServerInstance] <String>
    -WindowsAccount <String>
    [-Tenant <TenantId>]
    [-FullName <String>]
    [-State <NavUserState>]
    [-ExpiryDate <DateTime>]
    [-ChangePasswordAtNextLogOn]
    [-LicenseType <LicenseType>]
    [-Password <SecureString>]
    [-AuthenticationKey <String>]
    [-AuthenticationEmail <String>]
    [-ContactEmail <String>]
    [-CreateWebServicesKey]
    [-WebServicesKeyExpiryDate <DateTime>]
    [-ProfileId <String>]
    [-ProfileAppId <Guid>]
    [-Company <String>]
    [-LanguageId <String>]
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Sid

New-NAVServerUser
    [-ServerInstance] <String>
    -Sid <String>
    [-Tenant <TenantId>]
    [-FullName <String>]
    [-State <NavUserState>]
    [-ExpiryDate <DateTime>]
    [-ChangePasswordAtNextLogOn]
    [-LicenseType <LicenseType>]
    [-Password <SecureString>]
    [-AuthenticationKey <String>]
    [-AuthenticationEmail <String>]
    [-ContactEmail <String>]
    [-CreateWebServicesKey]
    [-WebServicesKeyExpiryDate <DateTime>]
    [-ProfileId <String>]
    [-ProfileAppId <Guid>]
    [-Company <String>]
    [-LanguageId <String>]
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

UserName

New-NAVServerUser
    [-ServerInstance] <String>
    -UserName <String>
    [-Tenant <TenantId>]
    [-FullName <String>]
    [-State <NavUserState>]
    [-ExpiryDate <DateTime>]
    [-ChangePasswordAtNextLogOn]
    [-LicenseType <LicenseType>]
    [-Password <SecureString>]
    [-AuthenticationKey <String>]
    [-AuthenticationEmail <String>]
    [-ContactEmail <String>]
    [-CreateWebServicesKey]
    [-WebServicesKeyExpiryDate <DateTime>]
    [-ProfileId <String>]
    [-ProfileAppId <Guid>]
    [-Company <String>]
    [-LanguageId <String>]
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

AppId

New-NAVServerUser
    [-ServerInstance] <String>
    -UserName <String>
    -ApplicationId <Guid>
    [-Tenant <TenantId>]
    [-FullName <String>]
    [-State <NavUserState>]
    [-ExpiryDate <DateTime>]
    [-AuthenticationKey <String>]
    [-ContactEmail <String>]
    [-Company <String>]
    [-LanguageId <String>]
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Use the New-NAVServerUser cmdlet to create a new Business Central user. Anonymous accounts such as S-1-1-0 (Everyone) and S-1-5-7 (Anonymous) are not allowed.

Examples

EXAMPLE 1

New-NAVServerUser BC -Sid S-1-5-20

This example creates a new Business Central user based on the built-in NT AUTHORITY\NETWORK SERVICE account in Windows.

EXAMPLE 2

New-NAVServerUser MicrosoftDynamicsNavServer -WindowsAccount Cronus\Chris

This example creates a new Business Central user based on a Windows user account that has the user name Chris from the domain Cronus.

EXAMPLE 3

New-NAVServerUser navserver1 -UserName Chris -Password (Read-Host "Enter password for User1" -AsSecureString) -Verbose

Enter password for User1: ****
VERBOSE: NavCommand.BeginProcessing
VERBOSE: NavCommand.ProcessRecord
VERBOSE: Opening admin connection to ServerInstance 'MicrosoftDynamicsNavServer$navserver1'
VERBOSE: Admin connection to ServerInstance 'MicrosoftDynamicsNavServer$navserver1' has been opened
VERBOSE: Performing operation "New-NavServerUser" on target "ServerInstance = MicrosoftDynamicsNavServer$navserver1
VERBOSE: NavCommand.EndProcessing
VERBOSE: Closing admin connection to ServerInstance 'MicrosoftDynamicsNavServer$navserver1'
VERBOSE: Admin connection to ServerInstance 'MicrosoftDynamicsNavServer$navserver1' has been closed

This example creates a new Business Central user that has the user name Chris and a password that is entered as a secure string (****).

EXAMPLE 4

New-NAVServerUser navserver1 -UserName Chris -Password (ConvertTo-SecureString 'Password1234' -AsPlainText -Force)

This example creates a new Business Central user that has the user name Chris and password Password1234.

EXAMPLE 5

New-NAVServerUser navserver1 -CreateWebServicesKey -UserName Chris -WebServicesKeyExpiryDate '01-01-2014'

This example creates a new Business Central user that has the user name Chris and a web services access key for logging on to Business Central. The web services acces key expires on 01-01-2014.

Parameters

-ApplicationId

Identifies the application this user represents. This requires that the application is registered in Microsoft Entra ID. The application is identified by its "client id" in Microsoft Entra ID.

Parameter properties

Type:Guid
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

AppId
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AuthenticationEmail

Specifies the Microsoft account that this user uses to access Office 365 and SharePoint. The authentication email address must be the Microsoft account that the users log in to Office 365 with, such as an account from Microsoft Entra ID.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

WindowsAccount
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Sid
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
UserName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-AuthenticationKey

Specifies the authentication key for authentication with Windows Azure Access Control Service (ACS). This key must be at least 8 characters and contain combination of uppercase and lowercase letters and numbers. The authentication key is entered by the user the first time that the user logs on to Business Central.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ChangePasswordAtNextLogOn

Forces the user to change the password the next time that the user logs on.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

WindowsAccount
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Sid
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
UserName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Company

Specifies which of the Business Central companies will be used as the user�s default company in the clients. Be aware that if you set this parameter, you will not be able to remove the user later if desired. You will only be able to disable the user.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before executing the command.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ContactEmail

Specifies the contact email address for the Business Central user.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-CreateWebServicesKey

Creates a web services access key for the user. The web service access key is automatically generated. This parameter is relevant only when Business Central is configured to use either the NavUserPassword or AccessControlService credential type for authenticating users. The web service access key is used instead of a password to authenticate web service requests, such as SOAP and OData.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

WindowsAccount
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Sid
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
UserName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ExpiryDate

Specifies when the user's access to Business Central expires.

Parameter properties

Type:DateTime
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Force

Forces the command to run without asking for user confirmation.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-FullName

Specifies the user's full name. This is typically includes the user's first and last name. On the User card in Business Central, this value appears in the Full Name field. The value typically includes the user's first and last name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-LanguageId

Specifies which of the installed Business Central languages will be used as the user�s default language in the clients. Set the value to a valid language culture name, which typically has the format nn-NN, such as en-US or da-DK. Be aware that if you set this parameter, you will not be able to remove the user later if desired. You will only be able to disable the user.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-LicenseType

Specifies the license type to assign the user. The parameter has the following values (you can use either the text value or the integer in parenthesis): Full (0), Limited (1), DeviceOnly (2), External (4), ExternalAdmin (5), ExternalAccountant (6), Application (7).

WindowsGroup (3) license type is no longer supported. Use the security group feature instead.

Parameter properties

Type:LicenseType
Default value:None
Accepted values:Full, Limited, DeviceOnly, WindowsGroup, External, ExternalAdmin, ExternalAccountant, Application, AADGroup
Supports wildcards:False
DontShow:False

Parameter sets

WindowsAccount
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Sid
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
UserName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Password

Specifies a protected password for the Business Central user. The password is only used when the credential type for authenticating users who try to access Business Central is set to NavUserPassword.

Parameter properties

Type:SecureString
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

WindowsAccount
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Sid
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
UserName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ProfileAppId

Specifies the ID of the extension that defines the profile to assign the user. When assigning a profile from the System scope, don't use this parameter.

Parameter properties

Type:Guid
Default value:00000000-0000-0000-0000-000000000000
Supports wildcards:False
DontShow:False

Parameter sets

WindowsAccount
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Sid
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
UserName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ProfileId

Specifies the ID of the profile to assign the user.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

WindowsAccount
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Sid
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
UserName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ServerInstance

Specifies the name of a Business Central Server instance, for example, BC or myinstance. You can specify either the full name of an instance, such as MicrosoftDynamicsNavServer$myinstance or the short name such as myinstance.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-Sid

Specifies the security identifier (SID) of the Windows user account for the user that you want to set up as a Business Central user. The SID is a unique value that identifies a Windows user account. You can use the Sid, UserName, or WindowsAccount parameters to create the user. If you use the Sid parameter, then you cannot set the UserName or WindowsAccount parameters.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Sid
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-State

Specifies the state of the user's account and access to Business Central. The parameters has the following values (you can use either the text value of the integer value in parenthesis:

Enabled (0)

Disabled (1)

Parameter properties

Type:NavUserState
Default value:None
Accepted values:Enabled, Disabled
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Tenant

Specifies the ID of the tenant of the Business Central Server instance on which to add the user. You can omit the Tenant parameter only if the Business Central Server instance is not configured to run multiple tenants.

Parameter properties

Type:TenantId
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Id

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-UserName

Specifies the user name for the new Business Central user. The user name appears in the User Name field in a user's account in Business Central. You can use the UserName, WindowsAccount or Sid parameters to identify the user. If you use the Username parameter, then you cannot use the Windows Account or Sid parameters.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

UserName
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
AppId
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WebServicesKeyExpiryDate

Specifies the date and time that the user's web services access key expires.

Parameter properties

Type:DateTime
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

WindowsAccount
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Sid
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
UserName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Describes what would happen if you executed the command without actually executing the command.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WindowsAccount

Specifies the Windows account user name of the user that you want to set up as a Business Central user. The value has the domain\username format. You can use the WindowsAccount, UserName, or Sid parameters to create the user. If you use the WindowsAccount parameter, then you cannot use the UserName or Sid parameters.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

WindowsAccount
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

System.String

You can pipe a string that contains a Business Central Server instance name to the cmdlet.

Outputs

None

Notes

Because cmdlets do not execute application code, if there is any logic on application objects that are associated with creating or modifying users from the client, be aware that the logic will not be executed when you run the cmdlet.