New-NAVServerUser

New-NAVServerUser

Creates a new Microsoft Dynamics NAV user.

Syntax

Parameter Set: __AllParameterSets
New-NAVServerUser [-ServerInstance] <String> [-AuthenticationEmail <String> ] [-AuthenticationKey <String> ] [-ChangePasswordAtNextLogOn] [-CreateWebServicesKey] [-ExpiryDate <DateTime> ] [-Force] [-FullName <String> ] [-LicenseType <LicenseType> ] [-Password <SecureString> ] [-ProfileId <String> ] [-State <NavUserState> ] [-Tenant <TenantId> ] [-WebServicesKeyExpiryDate <DateTime> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: Sid
New-NAVServerUser -Sid <String> [-AuthenticationEmail <String> ] [-AuthenticationKey <String> ] [-ChangePasswordAtNextLogOn] [-CreateWebServicesKey] [-ExpiryDate <DateTime> ] [-Force] [-FullName <String> ] [-LicenseType <LicenseType> ] [-Password <SecureString> ] [-ProfileId <String> ] [-State <NavUserState> ] [-WebServicesKeyExpiryDate <DateTime> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: UserName
New-NAVServerUser -UserName <String> [-AuthenticationEmail <String> ] [-AuthenticationKey <String> ] [-ChangePasswordAtNextLogOn] [-CreateWebServicesKey] [-ExpiryDate <DateTime> ] [-Force] [-FullName <String> ] [-LicenseType <LicenseType> ] [-Password <SecureString> ] [-ProfileId <String> ] [-State <NavUserState> ] [-WebServicesKeyExpiryDate <DateTime> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: WindowsAccount
New-NAVServerUser -WindowsAccount <String> [-AuthenticationEmail <String> ] [-AuthenticationKey <String> ] [-ChangePasswordAtNextLogOn] [-CreateWebServicesKey] [-ExpiryDate <DateTime> ] [-Force] [-FullName <String> ] [-LicenseType <LicenseType> ] [-Password <SecureString> ] [-ProfileId <String> ] [-State <NavUserState> ] [-WebServicesKeyExpiryDate <DateTime> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

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

Parameters

-AuthenticationEmail<String>

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 Windows Azure Active Directory (AAD).

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-AuthenticationKey<String>

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 Microsoft Dynamics NAV.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ChangePasswordAtNextLogOn

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

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 Microsoft Dynamics NAV 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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ExpiryDate<DateTime>

Specifies when the user's access to Microsoft Dynamics NAV expires.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Force

Forces the command to run without asking for user confirmation.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-FullName<String>

Specifies the user’s full name. This is typically includes the user's first and last name.

On the User card in Microsoft Dynamics NAV, this value appears in the Full Name field. The value typically includes the user's first and last name.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-LicenseType<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)

WindowsGroup (3) - Use this license type if the Microsoft Dynamics NAV user is based on a Windows group in Active Directory. This user account cannot log on to Microsoft Dynamics NAV. Instead, it is used to map the permission set to the individual Windows users in the Windows user group. You must apply the license type to the individual users in the Windows user group.

External (4)

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Password<SecureString>

Specifies a protected password for the Microsoft Dynamics NAV user.

The password is only used when the credential type for authenticating users who try to access Microsoft Dynamics NAV is set to NavUserPassword.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ProfileId<String>

Specifies the ID of the profile to assign the user.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ServerInstance<String>

Specifies the name of a Microsoft Dynamics NAV Server instance. The default instance name is DynamicsNAV80. You can specify either the full name of an instance (such as MicrosoftDynamicsNavServer$myinstance) or the short name (such as myinstance).

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-Sid<String>

Specifies the security identifier (SID) of the Windows user account for the user that you want to set up as a Microsoft Dynamics NAV 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.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-State<NavUserState>

Specifies the state of the user’s account and access to Microsoft Dynamics NAV. The parameters has the following values (you can use either the text value of the integer value in parenthesis:

Enabled (0)
Disabled (1)

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Tenant<TenantId>

Specifies the ID of the tenant of the Microsoft Dynamics NAV Server instance on which to add the user.

You can omit the Tenant parameter only if the Microsoft Dynamics NAV Server instance is not configured to run multiple tenants.

Aliases

Id

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-UserName<String>

Specifies the user name for the new Microsoft Dynamics NAV user. The user name appears in the User Name field in a user's account in Microsoft Dynamics NAV.

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.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WebServicesKeyExpiryDate<DateTime>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WindowsAccount<String>

Specifies the Windows account user name of the user that you want to set up as a Microsoft Dynamics NAV 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.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • System.String

    You can pipe a string that contains a Microsoft Dynamics NAV Server instance name to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • None

    This cmdlet does not generate any output.

Examples

-------------------------- EXAMPLE 1 --------------------------

Description

-----------

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

C:\PS>New-NAVServerUser DynamicsNAV80 -Sid S-1-5-20

-------------------------- EXAMPLE 2 --------------------------

Description

-----------

This example creates a new Microsoft Dynamics NAV user based on a Windows user account that has the user name Chris from the domain Cronus.

C:\PS>New-NAVServerUser MicrosoftDynamicsNavServer -WindowsAccount Cronus\Chris

-------------------------- EXAMPLE 3 --------------------------

Description

-----------

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

C:\PS>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

-------------------------- EXAMPLE 4 --------------------------

Description

-----------

This example creates a new Microsoft Dynamics NAV user that has the user name Chris and password Password1234.

C:\PS>New-NAVServerUser navserver1 -UserName Chris -Password (ConvertTo-SecureString 'Password1234' -AsPlainText -Force)

-------------------------- EXAMPLE 5 --------------------------

Description

-----------

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

C:\PS>New-NAVServerUser navserver1 -CreateWebServicesKey -UserName Chris -WebServicesKeyExpiryDate '01-01-2014'