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
Specifies to update a tenant's state and data version based, in part, on the data version of the tenant database that contains the tenant. By default, the data retrieved by the Get-NAVTenant is not necessarily up to date with the tenant database. This can happen, for example, after a Dynamics NAV server instance restart. In this case, the 'State' would be 'Mounted', even if its actual state is 'Operational', and the 'TenantDataVersion' would be 'Uninitialized'. By setting the -ForceRefresh parameter, the server instance reads the data version of the tenant database from the database itself, and the tenant's state and data version are recalculated. Note: Running operations, such as sync, mount and dismount, on a specific tenant always ensures that tenant settings are up-to-date with the tenant database.
Type: | SwitchParameter |
Position: | Named |
Default value: | False |
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: | 0 |
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: | 1 |
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