Share via


Set-NAVServerUser

Changes the configuration settings of an existing Business Central user.

Syntax

WindowsAccount (Default)

Set-NAVServerUser
    [-ServerInstance] <String>
    -WindowsAccount <String>
    [-Tenant <TenantId>]
    [-NewWindowsAccount <String>]
    [-NewUserName <String>]
    [-FullName <String>]
    [-State <NavUserState>]
    [-ExpiryDate <DateTime>]
    [-LicenseType <LicenseType>]
    [-AuthenticationKey <String>]
    [-ContactEmail <String>]
    [-AuthenticationEmail <String>]
    [-CreateWebServicesKey]
    [-WebServicesKeyExpiryDate <DateTime>]
    [-ProfileId <String>]
    [-ProfileAppId <Guid>]
    [-AuthenticationObjectId <String>]
    [-Company <String>]
    [-LanguageId <String>]
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Sid

Set-NAVServerUser
    [-ServerInstance] <String>
    -Sid <String>
    [-Tenant <TenantId>]
    [-NewWindowsAccount <String>]
    [-NewUserName <String>]
    [-FullName <String>]
    [-State <NavUserState>]
    [-ExpiryDate <DateTime>]
    [-LicenseType <LicenseType>]
    [-AuthenticationKey <String>]
    [-ContactEmail <String>]
    [-AuthenticationEmail <String>]
    [-CreateWebServicesKey]
    [-WebServicesKeyExpiryDate <DateTime>]
    [-ProfileId <String>]
    [-ProfileAppId <Guid>]
    [-AuthenticationObjectId <String>]
    [-Company <String>]
    [-LanguageId <String>]
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SidPass

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

WindowsAccountPass

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

UserName

Set-NAVServerUser
    [-ServerInstance] <String>
    -UserName <String>
    [-Tenant <TenantId>]
    [-NewWindowsAccount <String>]
    [-NewUserName <String>]
    [-FullName <String>]
    [-State <NavUserState>]
    [-ExpiryDate <DateTime>]
    [-LicenseType <LicenseType>]
    [-AuthenticationKey <String>]
    [-ContactEmail <String>]
    [-AuthenticationEmail <String>]
    [-CreateWebServicesKey]
    [-WebServicesKeyExpiryDate <DateTime>]
    [-ProfileId <String>]
    [-ProfileAppId <Guid>]
    [-AuthenticationObjectId <String>]
    [-Company <String>]
    [-LanguageId <String>]
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

UserNamePass

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

AppId

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

Description

Use the Set-NAVServerUser cmdlet to rename an existing Business Central user or change other configuration parameters that are related to the user.

Examples

EXAMPLE 1

Set-NAVServerUser DynamicsNAV90 -Sid S-1-5-20 -NewWindowsAccount MyDomain\User1

This example renames the Windows account user name of a Business Central user. The existing Business Central user is identified by its Sid.

EXAMPLE 2

Set-NAVServerUser BC -WindowsAccount MyDomain\User1 -NewWindowsAccount MyDomain\User2

This example changes the Windows user name that is assigned to Business Central user. The existing Business Central user is identified by its current Windows user name by the WindowsAccount parameter.

EXAMPLE 3

Set-NAVServerUser DynamicsNAV90 -UserName USER1 -NewUserName USER2 -ChangePasswordAtNextLogOn -Password (Read-Host "Enter password for USER2" -AsSecureString)

This example changes the user name of a Business Central user from USER1 to USER2. It also changes the user's password and requires that the user change the password the next time he logs on to Business Central.

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 Microst 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
SidPass
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
WindowsAccountPass
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
UserNamePass
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 authenticating with Microsoft Azure Access Control Service (ACS).

This key must be at least 8 characters and a 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

-AuthenticationObjectId

Specifies the Microsoft account that this user uses to access Office 365 and SharePoint. The authentication object id must be the Microsoft account that the users log in to Office 365 with, such as an account from Microst 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
SidPass
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
WindowsAccountPass
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
UserNamePass
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

SidPass
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
WindowsAccountPass
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
UserNamePass
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
SidPass
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
WindowsAccountPass
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
UserNamePass
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

Sets the full name of the user.

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
SidPass
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
WindowsAccountPass
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
UserNamePass
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-NewUserName

Specifies the new user name to assign the Business Central user. The user name is defined by the User Name field in the user's account in Business Central.

You cannot use the NewUserName parameter and NewWindowsAccount parameter in the same command.

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

-NewWindowsAccount

Specifies the new Windows user name for the Business Central user that you want to change. The value has the domain\username format.

You cannot use the NewWindowsAccount parameter and NewUserName parameter in the same command.

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

-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

SidPass
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
WindowsAccountPass
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
UserNamePass
Position:Named
Mandatory:True
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, this parameter should not be used.

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
SidPass
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
WindowsAccountPass
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
UserNamePass
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 a 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
SidPass
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
WindowsAccountPass
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
UserNamePass
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 Business Central user that you want to change. 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
SidPass
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-State

Sets the current state of the user's 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 that the user is stored in.

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 of the existing Business Central user that you want to change. 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
UserNamePass
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 when 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
SidPass
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
WindowsAccountPass
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
UserNamePass
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 existing Business Central user that you want to change. 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
WindowsAccountPass
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