Get-MasterDataServicesDatabase (Windows PowerShell)

Gets information about a Master Data Services database.

Syntax

Get-MasterDataServicesDatabase [-Server] <Microsoft.MasterDataServices.Configuration.DatabaseServerInformation> [-DatabaseName] <String>

Description

Get-MasterDataServicesDatabase returns a database information object that contains information about a Master Data Services database on a specified instance of SQL Server. It verifies that the credentials in the connection string have permission to read from the specified database.

Parameters

-Server

The Server parameter is a database server information object from Get-MasterDataServicesDatabaseServerInformation. This object is used to connect to the instance of SQL Server that hosts the Master Data Services database.

Required?

true

Position?

0

Default Value

none

Accept Pipeline Input

true (ByValue)

Accept Wildcard Characters?

false

-DatabaseName

The DatabaseName parameter is a string that specifies the name of the Master Data Services database from which to get information.

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input

false

Accept Wildcard Characters?

false

Inputs and Outputs

The input type is the type of the objects that you can pipe to the cmdlet. The return type is the type of the objects that the cmdlet returns.

Inputs

Microsoft.MasterDataServices.Configuration.DatabaseServerInformation, System.String

The input is a database server information object from Get-MasterDataServicesDatabaseServerInformation and a string that specifies the Master Data Services database from which you want to get information.

Outputs

Microsoft.MasterDataServices.Configuration.DatabaseInformation

Get-MasterDataServicesDatabase returns a database information object that contains information about the specified Master Data Services database.

Examples

Output

The following is an example of the output that is returned when you use this cmdlet.

Name             : MyDatabase
HasAccess        : True
Collation        : SQL_Latin1_General_CP1_CI_AS
ServiceAccount   :
MdsAdministrator :
Server           : Microsoft.MasterDataServices.Configuration.DatabaseServerInformation
IsDatabaseOwner  : True

Using Variables and Named Parameters

This example uses the Get-MasterDataServicesDatabaseServerInformation cmdlet to set a variable, $server, to use for the Server parameter in the Get-MasterDataServicesDatabase cmdlet. The parameters are named parameters.

C:\PS>$server = Get-MasterDataServicesDatabaseServerInformation 
    -ConnectionString 'Data Source=MyServer\MyInstance;Initial catalog=;Integrated Security=True;User ID=;Password='; 
    Get-MasterDataServicesDatabase -Server $server -DatabaseName 'MyDatabase'

Piping Output and Using Named Parameters

This example pipes output from Get-MasterDataServicesDatabaseServerInformation to Get-MasterDataServicesDatabase for the Server parameter in Get-MasterDataServicesDatabase. The DatabaseName parameter is a named parameter.

C:\PS>Get-MasterDataServicesDatabaseServerInformation 
    -ConnectionString 'Data Source=MyServer\MyInstance;Initial catalog=;Integrated Security=True;User ID=;Password=' | 
    Get-MasterDataServicesDatabase -DatabaseName 'MyDatabase'

Using Variables and Positional Parameters

This example uses the Get-MasterDataServicesDatabaseServerInformation cmdlet to set a variable, $server, to use for the Server parameter in New-MasterDataServicesDatabase cmdlet. The parameters are positional parameters.

C:\PS>$server = Get-MasterDataServicesDatabaseServerInformation 
    -ConnectionString 'Data Source=MyServer\MyInstance;Initial catalog=;Integrated Security=True;User ID=;Password='; 
    Get-MasterDataServicesDatabase $server 'MyDatabase'