Get-SCDWEntity

Gets the list of fact tables, dimensions, tables, and outriggers that exist in a data warehouse.

Syntax

Get-SCDWEntity
   [-DatamartComputerName <String>]
   [-DatamartDatabaseName <String>]
   [-ComputerName <String>]
   [-Credential <PSCredential>]
   [<CommonParameters>]

Description

The Get-SCDWEntity cmdlet gets the list entity names and their types. Entities include act tables, dimensions, tables, and outriggers that exist in the data warehouse.

Entity names are required for setting watermarks, and for setting and getting retention periods; by using the Set-SCDWWatermark, Set-SCDWRetentionPeriod, and Get-SCDWRetentionPeriod cmdlets.

Examples

Example 1: Display entity name and type values

PS C:\>Get-SCDWEntity -ComputerName "serverDW72" | Format-Table -AutoSize | Out-Host -Paging

This command displays the EntityName values and their EntityType, and displays the output in pages.

Example 2: Display entity data using stored credentials

PS C:\>$credUser = Get-Credential
PS C:\> Get-SCDWEntity -ComputerName "serverDW72" â€"Credential $credUser| Format-Table -AutoSize | Out-Host -Paging

The first command stores user credentials for the Credential parameter.

The second command displays the entity data using the specified credentials.

Example 3: Display entity names sorted by entity type

PS C:\>Get-SCDWEntity -ComputerName "serverDW72" | Sort-Object -Property EntityType, EntityName | Format-Table â€"AutoSize | Out-Host -Paging

This command displays the EntityName values sorted by their EntityType.

Example 4: Display all entity names of a specific type

PS C:\>Get-SCDWEntity -ComputerName "serverDW72" | Where-Object {$_.EntityType -eq "Fact"} | Sort-Object -Property EntityType, EntityName | Format-Table -AutoSize

This command displays the EntityName values whose EntityType value is Fact.

Example 5: Display all entities

PS C:\>Get-SCDWEntity -ComputerName "serverDW72" -DatamartComputerName "serverDW72" -DatamartDatabaseName OMDWDatamart | Format-Table -AutoSize | Out-Host -Paging

This command displays the entities in the OMDWDatamart database.

Example 6: Use hash tables to investigate entity data

PS C:\>$DWDatamart = @{}
PS C:\>Get-SCDWEntity -ComputerName "serverDW72" -DatamartComputerName "serverDW72" -DatamartDatabaseName "DWDatamart" | ForEach-Object {$DWDatamart.Add($_.EntityName, $_.EntityType)}
PS C:\>$OMDWDatamart = @{}
PS C:\>Get-SCDWEntity -ComputerName "serverDW72" -DatamartComputerName "serverDW72" -DatamartDatabaseName "OMDWDatamart" | ForEach-Object {$OMDWDatamart.Add($_.EntityName, $_.EntityType)}
PS C:\>$CMDWDatamart = @{}
PS C:\>Get-SCDWEntity -ComputerName "serverDW72" -DatamartComputerName "serverDW72" -DatamartDatabaseName "CMDWDatamart" | ForEach-Object {$CMDWDatamart.Add($_.EntityName, $_.EntityType)}

This command and the one that follows show how to use hash tables to investigate the entity data. This example shows how to create hash tables of the entities according to their database and then how to derive hash tables from them to obtain specific data.

The first, third, and fifth command create hash tables.

The second, fourth, and sixth commands populate the hash tables with the entity names and types in the DWDatamart, OMDWDatamart, and CMDWDatamart databases. The key is the entity name, and the value is the entity type.

Example 7: Create a hash table and populate it with entity data

PS C:\>$DWDatamart_Outrigger = @()
PS C:\>foreach ($key in $DWDatamart.Keys) {
>>    if ($DWDatamart[$key] -eq "Outrigger") {
>>    $DWDatamart_Outrigger.Add($key,$DWDatamart[$key])
>>    }
>>}

This example assumes you still have the $DWDatamart hash table created in the previous example.

The first command creates a hash table named $DWDatamart_Outrigger.

The second command populates the $DWDatamart_Outrigger hash table with the Outrigger entities in the DWDatamart database.

Parameters

-ComputerName

Specifies the name of the computer on which the System Center Data Access service is running. The user account that is defined in the Credential parameter must have access rights to the specified computer. You can omit this parameter only if the System Center Data Access Service is running on the same computer that has Service Manager installed.

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

-Credential

Specifies the credentials to use when you are connecting to the server on which the System Center Data Access service is running. The user account that is provided must have access to that server.

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

-DatamartComputerName

Specifies the name of the computer on which the datamart resides. Typically, this is the Structured Query Language (SQL) database server that the data warehouse uses. If no value is provided, smshort inspects the configuration of the data warehouse and discovers the value.

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

-DatamartDatabaseName

Specifies the name of the database of the datamart. Typically, this is the SQL database server that the data warehouse uses. The default value is the data warehouse repository. Entity values can be retrieved from the Staging or from the DataMart databases.

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

Inputs

None.

You cannot pipe input to this cmdlet.

Outputs

Microsoft.EnterpriseManagement.Warehouse.Cmdlets.GetSCDWEntity

A collection of Microsoft.EnterpriseManagement.Warehouse.Cmdlets.GetSCDWEntity objects.