Get-SCSMGroup

从Service Manager获取组。

语法

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>]

说明

Get-SCSMGroup cmdlet 从Service Manager检索组。 其他 cmdlet(例如 New-SCSMUserRole cmdlet)可以使用此 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 Data Access 服务。 默认值是用于当前管理组连接的计算机。

有效格式包括 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

指定要检索的组的 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

此 cmdlet 的输出是组对象。