Get-SCSMGroup

從Service Manager取得群組。

Syntax

Get-SCSMGroup
   [-SCSession <Connection[]>]
   [-ComputerName <String[]>]
   [-Credential <PSCredential>]
   [<CommonParameters>]
Get-SCSMGroup
   [-DisplayName] <String[]>
   [-SCSession <Connection[]>]
   [-ComputerName <String[]>]
   [-Credential <PSCredential>]
   [<CommonParameters>]
Get-SCSMGroup
   [-Id] <Guid[]>
   [-SCSession <Connection[]>]
   [-ComputerName <String[]>]
   [-Credential <PSCredential>]
   [<CommonParameters>]

Description

Get-SCSMGroup Cmdlet 會從Service Manager擷取群組。 其他 Cmdlet 可以使用此 Cmdlet 的輸出,例如 New-SCSMUserRole Cmdlet。

範例

範例 1:從Service Manager取得群組

PS C:\>Get-SCSMGroup
Id                                   FullName
--                                   --------
3c8ac4f3-475e-44dd-4163-8a97af363705 Microsoft.SystemCenter.AllComputersGroup
04bca169-5094-4b85-8704-067f333aa830 Microsoft.SystemCenter.CollectionManagementServerComputersGroup
95fe7deb-f466-ca83-aa8d-9845c386cd5a Microsoft.SystemCenter.GatewayManagementServerComputersGroup
099bfe0f-fddb-8d5a-67af-a79317eb6e91 Microsoft.SystemCenter.ManagementServerComputersGroup
0e7983be-95b9-aed8-ff93-8819e4cefcaa Microsoft.SystemCenter.RootManagementServerComputersGroup
3c1ef0a3-b773-11c8-b150-c4e47e5b7d91 Microsoft.SystemCenter.AgentlessManagedComputerGroup
e394c529-dfca-bdb4-5a86-d46078622200 Microsoft.SystemCenter.AgentManagedComputerGroup
e929bd61-1615-ba70-62b2-9fd5eee8aa09 Microsoft.SystemCenter.ManagedComputerClientHealthServiceWatcherGroup
93cb6af4-3e3d-53f6-06a7-04a469197a9c Microsoft.SystemCenter.OpsMgrDBWatchersGroup
a528b843-301e-4e61-6679-104243bbdb6b InstanceGroup_dbbcf4ea8ff241839b6154026698ceb2

此命令會從Service Manager擷取群組。

範例 2:取得群組,並在資料表中顯示其詳細資料

PS C:\>Get-SCSMGroup |Format-Table fullname,displayname
FullName                                                                      DisplayName
--------                                                                      -----------
Microsoft.SystemCenter.AllComputersGroup                                      All Windows Computers
Microsoft.SystemCenter.CollectionManagementServerComputersGroup               Collection Management Server Computer Group
Microsoft.SystemCenter.GatewayManagementServerComputersGroup                  Gateway Management Server Computer Group
Microsoft.SystemCenter.ManagementServerComputersGroup                         Management Server Computer Group
Microsoft.SystemCenter.RootManagementServerComputersGroup                     Root Management Server Computer Group
Microsoft.SystemCenter.AgentlessManagedComputerGroup                          Agentless Managed Computer Group
Microsoft.SystemCenter.AgentManagedComputerGroup                              Agent Managed Computer Group
Microsoft.SystemCenter.ManagedComputerClientHealthServiceWatcherGroup         Managed Computer Client Management Service Watcher Group
Microsoft.SystemCenter.OpsMgrDBWatchersGroup                                  System Center Operations Manager Operational Database Watcher Group
InstanceGroup_dbbcf4ea8ff241839b6154026698ceb2                                mygroup

此命令會擷取群組,然後顯示其 FullNameDisplayName 屬性。

範例 3:取得群組的詳細資料

PS C:\>Get-SCSMGroup -DisplayName "All Windows Computers"
Id                                   FullName
--                                   --------
3c8ac4f3-475e-44dd-4163-8a97af363705 Microsoft.SystemCenter.AllComputersGroup

此命令會擷取 [所有 Windows 電腦] 群組。

範例 4:取得群組並顯示其屬性

PS C:\>Get-SCSMGroup -DisplayName "All Windows Computers"|Format-List
Name                                         :
Path                                         :
DisplayName                                  : All Windows Computers
FullName                                     : Microsoft.SystemCenter.AllComputersGroup
ManagementPackClassIds                       : {3c8ac4f3-475e-44dd-4163-8a97af363705}
LeastDerivedNonAbstractManagementPackClassId : 3c8ac4f3-475e-44dd-4163-8a97af363705
TimeAdded                                    : 12/2/2010 12:19:56 AM
LastModifiedBy                               :
Values                                       : {System.ConfigItem.ObjectStatusEnum.Active, (null), (null), All Windows Computers}
LastModified                                 : 12/2/2010 12:19:56 AM
IsNew                                        : False
HasChanges                                   : False
Id                                           : 3c8ac4f3-475e-44dd-4163-8a97af363705
ManagementGroup                              : psimp2
ManagementGroupId                            : 048d4708-ede4-5aed-1317-81d1b0d0b395

此命令會擷取 [所有 Windows 電腦] 群組,然後顯示其所有屬性。

參數

-ComputerName

指定要建立連線的電腦。 電腦必須執行 System Center 資料存取服務。 預設值是目前管理群組連線的電腦。

有效格式包括 NetBIOS 名稱、IP 位址或完整網域名稱 (FQDN)。 若要指定本機電腦,請輸入電腦名稱、"localhost" 或句點 (.)。

Type:System.String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Credential

指定管理群組連線將在其下執行的使用者帳戶。 如果指定伺服器,帳戶必須能夠存取 ComputerName 參數中指定的伺服器。 預設值為目前使用者。

您可以輸入Get-Credential Cmdlet 所傳回的PSCredential物件。

Type:System.Management.Automation.PSCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DisplayName

指定要擷取之群組的顯示名稱。

Type:System.String[]
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:True

-Id

指定要擷取的群組識別碼。 這可能是 GUID 或將轉換成 GUID 的字串。

Type:System.Guid[]
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-SCSession

指定管理伺服器的連線。 預設值是目前的管理群組連線。

您可以輸入 Get-SCManagementGroupConnection Cmdlet 所傳回的管理群組連線物件。

Type:Microsoft.SystemCenter.Core.Connection.Connection[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

輸入

System.Guid

您可以使用管線將群組 GUID 傳送至Get-SCSMGroup Cmdlet 的Id參數。

System.String

您可以使用管線將群組的名稱傳送至Get-SCSMGroup Cmdlet 的DisplayName參數。

輸出

Microsoft.EnterpriseManagement.Common.EnterpriseManagementObject

此指令程式的輸出是群組物件。