Share via


New-NAVTableConnection

Registers a connection to an external database table so the table can be used by the Microsoft Dynamics NAV application.

Syntax

UseNST

New-NAVTableConnection
    [-ServerInstance] <String>
    -ConnectionType <TableConnectionType>
    -ConnectionId <String>
    [-DatabaseServer <String>]
    [-DatabaseName <String>]
    [-DatabaseCredentials <PSCredential>]
    [-ConnectionTimeout <Int32>]
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

UseDatabase

New-NAVTableConnection
    -ApplicationDatabaseName <String>
    -ConnectionType <TableConnectionType>
    -ConnectionId <String>
    [-ApplicationDatabaseServer <String>]
    [-ApplicationDatabaseCredentials <PSCredential>]
    [-DatabaseServer <String>]
    [-DatabaseName <String>]
    [-DatabaseCredentials <PSCredential>]
    [-ConnectionTimeout <Int32>]
    [-Force]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Use the New-NAVTableConnection cmdlet to create a new set of connection settings for the application/service.

The connection settings are stored along with the application and can be used by all Microsoft Dynamics NAV Server instances that are connected to the specified application.

Code in your application can then use tables at the specified destination. You can connect to a Microsoft Dynamics NAV database by specifying the Microsoft Dynamics NAV Server instance or the application database.

Examples

EXAMPLE 1

New-NAVTableConnection -ServerInstance DynamicsNAV -ConnectionType CRM -ConnectionId myCRM

This example creates a connection to a Dynamics CRM table.

Parameters

-ApplicationDatabaseCredentials

Specifies the user name and password of an SQL Server Authentication login account that provides access to the Microsoft Dynamics NAV application database in SQL Server. You use this parameter to access the database by using SQL Server Authentication. If you want to use Windows Authentication, then you can omit this parameter The login account must be a member of the db_owner role on the database.

Parameter properties

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

Parameter sets

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

-ApplicationDatabaseName

Specifies the name of the Microsoft Dynamics NAV database that contains the application tables in a multitenant deployment.

Parameter properties

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

Parameter sets

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

-ApplicationDatabaseServer

Specifies the name of the computer on which the SQL Server instance for the Microsoft Dynamics NAV database that contains the application tables is installed in the multitenant deployment.

Parameter properties

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

Parameter sets

UseDatabase
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
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

-ConnectionId

Specifies the name of the table connection.

Parameter properties

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

Parameter sets

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

-ConnectionTimeout

Specifies the time (in seconds) to wait while trying to establish a connection before terminating the attempt and generating an error.

Parameter properties

Type:Int32
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:True
Value from remaining arguments:False

-ConnectionType

Specifies the type of table connection. In the current Microsoft Dynamics NAV version, you can specify two types of connection: CRM or ExternalSQL.

Parameter properties

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

Parameter sets

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

-DatabaseCredentials

Specifies the user name and password for an SQL Server Authentication login account that provides access to the database or, in a multitenant deployment, the tenant database in SQL Server. You use this parameter to access the database by using SQL Server Authentication. If you want to use Windows Authentication, then you can omit this parameter. The login account must be a member of the db_owner role on the database.

Caution

Don't embed user names or passwords directly in the command or anywhere in your scripts. This exposes sensitive data in plain text, logs, and command history. Always use a PSCredential object (for example, via Get-Credential) or retrieve credentials from tools like Azure Key Vault or Windows Credential Manager.

Parameter properties

Type:PSCredential
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:True
Value from remaining arguments:False

-DatabaseName

Specifies the name of the Microsoft Dynamics NAV database, such as 'Demo Database NAV ', that you want to establish the table connection to.

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:True
Value from remaining arguments:False

-DatabaseServer

Specifies the name of the computer on which the SQL Server instance for the Microsoft Dynamics NAV database is installed.

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:True
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

-ServerInstance

Specifies the name of a Dynamics NAV Server instance, for example, DynamicsNAV 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

UseNST
Position:1
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
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

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.