Get-NAVTenantDatabase
DO NOT USE: This cmdlet is for internal use only. It can't be used for Business Central on-premises tenants. For information about managing on-premises tenants, see https://go.microsoft.com/fwlink/?linkid=2153727.
Syntax
Get-NAVTenantDatabase
[[-Id] <TenantDatabaseId>]
[-ForceRefresh]
[-ServerInstance] <String>
[-Force]
[<CommonParameters>]
Description
Use the Get-NAVTenantDatabase cmdlet to get information about one or more tenant databases that are mounted on a specific Business Central Server instance. The cmdlet returns values for these properties: ID, ApplicationVersion, ApplicationFamily, State, DatabaseName, DatabaseServer, and DatabaseUserName.
Examples
EXAMPLE 1
Get-NAVTenantDatabase -ServerInstance 'BC' -Id 'MYTENANTDB1'
Id : MYTENANTDB1
ApplicationVersion : {10.0.16332.0}
ApplicationFamily : W1
State : Operational
DatabaseName : navtenantdb1
DatabaseServer : localhost\NAVDEMO
DatabaseUserName :
This example gets the information from the server instance 'BC' about the tenant database 'MYTENANTDB1'.
EXAMPLE 2
Get-NAVTenantDatabase -ServerInstance 'BC'
Id : MYTENANTDB1
ApplicationVersion : {}
ApplicationFamily :
State : Mounted
DatabaseName : navtenantdb1
DatabaseServer : localhost\NAVDEMO
DatabaseUserName :
Id : MYTENANTDB2
ApplicationVersion : {}
ApplicationFamily :
State : Mounted
DatabaseName : navtenantdb2
DatabaseServer : localhost\NAVDEMO
DatabaseUserName :
This example gets information about all the tenant databases that are mounted on the server instance 'BC'. Because the -ForceRefresh parameter is omitted, the ApplicationVersion, ApplicationFamily, and State values are not up-to-date.
EXAMPLE 3
Get-NAVTenantDatabase -ServerInstance 'BC' -ForceRefresh
Id : MYTENANTDB1
ApplicationVersion : {10.0.16332.0}
ApplicationFamily : W1
State : Operational
DatabaseName : navtenantdb1
DatabaseServer : localhost\NAVDEMO
DatabaseUserName :
Id : MYTENANTDB2
ApplicationVersion : {10.0.16332.0}
ApplicationFamily : W1
State : OperationalWithSyncPending
DatabaseName : navtenantdb2
DatabaseServer : localhost\NAVDEMO
DatabaseUserName :
This example gets information about all the tenant databases that are mounted on the server instance 'BC'. Because of the -ForceRefresh parameter, the server instance gets information directly from the tenant database, so the ApplicationVersion, ApplicationFamily, and State values are up-to-date.
Parameters
-Force
Forces the command to run without asking for user confirmation.
Type: | SwitchParameter |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ForceRefresh
Specifies to read the properties directly from every mounted tenant database to ensure that the actual values for all properties are returned. For example, if you do not specify this parameter, the ApplicationVersion and ApplicationFamily values will be blank and the State value will be 'Mounted' for all tenants. When you specify this parameter, the server instance will establish a session with each tenant database. Therefore, be aware that it will take longer to complete the operation than if this parameter is omitted.
It is not necessary to set the -ForceRefresh parameter if you specify the -TenantDatabaseId. In this case, the actual values are returned for the tenant database by default.
Type: | SwitchParameter |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Id
Specifies the ID of a specific tenant database that you want to get information about, such as TenantDatabase1. If you want to get information about all tenant databases that are mounted on the server instance, do not set this parameter.
Type: | TenantDatabaseId |
Position: | 1 |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ServerInstance
Specifies the name of a Business Central Server instance, for example, BC 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 |
Inputs
Microsoft.Dynamics.Nav.Types.TenantDatabaseId
By property name: Id
System.Management.Automation.SwitchParameter
By property name: ForceRefresh
System.String
ServerInstance