共用方式為


Get-MasterDataServicesDatabases (PowerShell)

取得有關指定之 SQL Server 執行個體上 Master Data Services 資料庫的資訊。

語法

Get-MasterDataServicesDatabases [-Server] <Microsoft.MasterDataServices.Configuration.DatabaseServerInformation>

說明

Get-MasterDataServicesDatabases 會傳回資料庫資訊物件集合,其中包含有關指定之 SQL Server 執行個體的 Master Data Services 資料庫資訊。此集合只包含可透過 Server 參數所指定之認證來存取的資料庫。

參數

-Server

Server 參數是來自 Get-MasterDataServicesDatabaseServerInformation 的資料庫伺服器資訊物件。這個物件用來連接到主控 Master Data Services 資料庫的 SQL Server 執行個體。

必要項?

true

位置?

0

預設值

接受管線輸入

true (ByValue)

接受萬用字元?

false

輸入和輸出

輸入類型是可透過管道傳送至指令程式的物件類型。傳回類型是指令程式所傳回的物件類型。

輸入

Microsoft.MasterDataServices.Configuration.DatabaseServerInformation

輸入是來自 Get-MasterDataServicesDatabaseServerInformation 的資料庫伺服器資訊物件。

輸出

System.Collections.ObjectModel.Collection{Microsoft.MasterDataServices.Configuration.DatabaseInformation}

Get-MasterDataServicesDatabases 會傳回資料庫資訊物件的集合。

範例

輸出

下列是使用這個指令程式時傳回的輸出範例。

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

Name             : MyDatabase_JA
HasAccess        : True
Collation        : Japanese_Bushu_Kakusu_100_CS_AI
ServiceAccount   :
MdsAdministrator :
Server           : Microsoft.MasterDataServices.Configuration.DatabaseServerInformation
IsDatabaseOwner  : True
...

使用變數和具名參數

這個範例使用 Get-MasterDataServicesDatabaseServerInformation 指令程式,設定 Get-MasterDataServicesDatabases 指令程式中的 Server 參數所用的 $server 變數。-Server 參數是具名參數。

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

透過管道傳送輸出以及使用具名參數

針對 Get-MasterDataServicesDatabases 中的 Server 參數,這個範例透過管道將輸出從 Get-MasterDataServicesDatabaseServerInformation 傳送到 Get-MasterDataServicesDatabases。-Server 參數是具名參數。

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

使用變數和位置參數

這個範例使用 Get-MasterDataServicesDatabaseServerInformation 指令程式,設定 Get-MasterDataServicesDatabases 指令程式中的 Server 參數所用的 $server 變數。-Server 參數是位置參數。

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