Get-NAVTenant

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

Syntax

Get-NAVTenant
   [[-Tenant] <TenantId>]
   [-ServerInstance] <String>
   [-Force]
   [<CommonParameters>]
Get-NAVTenant
   [[-Tenant] <TenantId>]
   -ApplicationDatabaseServer <String>
   -ApplicationDatabaseCredentials <PSCredential>
   -ApplicationDatabaseName <String>
   [-Force]
   [<CommonParameters>]
Get-NAVTenant
   [[-Tenant] <TenantId>]
   -ApplicationDatabaseServer <String>
   -ApplicationDatabaseName <String>
   [-Force]
   [<CommonParameters>]
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

Type:PSCredential
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters: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.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters: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.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Force

Forces the command to run without asking for user confirmation.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ForceRefresh

{{Fill ForceRefresh Description}}

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters: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.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters: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.

Type:TenantId
Aliases:Id
Position:2
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

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