Share via


Get-NAVTenant

Gets the tenants that are mounted against the specified Microsoft Dynamics NAV Server instance.

Syntax

UseNST

Get-NAVTenant
    [[-Tenant] <TenantId>]
    [-ServerInstance] <String>
    [-Force]
    [<CommonParameters>]

UseDatabaseSqlAuth

Get-NAVTenant
    [[-Tenant] <TenantId>]
    -ApplicationDatabaseServer <String>
    -ApplicationDatabaseCredentials <PSCredential>
    -ApplicationDatabaseName <String>
    [-Force]
    [<CommonParameters>]

UseDatabase

Get-NAVTenant
    [[-Tenant] <TenantId>]
    -ApplicationDatabaseServer <String>
    -ApplicationDatabaseName <String>
    [-Force]
    [<CommonParameters>]

ForceRefreshTenantState

Get-NAVTenant
    [-Tenant] <TenantId>
    [-ServerInstance] <String>
    [-ForceRefresh]
    [-Force]
    [<CommonParameters>]

Description

Gets the tenants that are mounted against the specified Microsoft Dynamics NAV Server instance. You can use the Mount-NAVTenant and Dismount-NAVTenant cmdlets to mount and dismount tenants.

Examples

EXAMPLE 1

Get-NAVTenant -ServerInstance 'DynamicsNAV'

This example gets the tenant information from the Dynamics NAV Server instance called DynamicsNAV. The output is a list of the tenant information about all mounted tenants.

Parameters

-ApplicationDatabaseCredentials

Specifies the user name and password of the login account that the Microsoft Dynamics NAV Server instance uses to access the application database in SQL Server when using SQL Server Authentication.

This parameter is only relevant when you set with the ApplicationDatabaseServer and ApplicationDatabaseName parameters

Parameter properties

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

Parameter sets

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

-ApplicationDatabaseName

Specifies the name of the application database that is used by the tenant database. This parameter is only relevant if the Microsoft Dynamics NAV Server instance is configured for multitenancy.

This parameter, together with the ApplicationDatabaseServer parameter, enables you to dismount a tenant from a Microsoft Dynamics NAV Server instance without having a running connection to the Microsoft Dynamics NAV Server instance.

Parameter properties

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

Parameter sets

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

-ApplicationDatabaseServer

Specifies the SQL Server name and instance, such as MyServer\MyInstance, that hosts the application database that is used with the tenant database.

This parameter, together with the ApplicationDatabaseName parameter, enables you to get the tenants that are mounted on a Microsoft Dynamics NAV Server instance without having a running connection to the Microsoft Dynamics NAV Server instance.

Parameter properties

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

Parameter sets

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

-ForceRefresh

{{Fill ForceRefresh Description}}

Parameter properties

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

Parameter sets

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

-Tenant

Specifies the ID of the specific tenant that you want to get information about, such as Tenant1.

If you do not set the Tenant parameter, the Get-NAVTenant cmdlet returns all tenants that are mounted against the Microsoft Dynamics NAV Server instance.

When using Get-NAVTenant through a connection to a Microsoft Dynamics NAV Server instance, if the specified tenant ID is not found, then an error occurs. When using Get-NAVTenant through a connection to the application database, if the specified tenant ID is not found, then all mounted tenants are returned in the results.

Parameter properties

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

Parameter sets

UseNST
Position:2
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False
UseDatabaseSqlAuth
Position:2
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False
UseDatabase
Position:2
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
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 the ServerInstance as a string to this cmdlet.

Outputs

Microsoft.Dynamics.Nav.Types.NavTenantSettings

Returns a Microsoft.Dynamics.Nav.Types.NavTenantSettings object for each tenant. The following information is returned:

ServerInstance State Id DatabaseName DatabaseServer AlternateId AllowAppDatabaseWrite NasServicesEnabled DefaultCompany DefaultTimeZone ExchangeAuthenticationMetadataLocation