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>]
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
此命令會擷取群組,然後顯示其 FullName 和 DisplayName 屬性。
範例 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」或點 (.)。
類型: | System.String[] |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-Credential
指定將執行管理群組連線的用戶帳戶。 如果指定伺服器,帳戶必須能夠存取 ComputerName 參數中指定的伺服器。 預設值為目前的使用者。
您可以輸入由 Get-Credential Cmdlet 所傳回 PSCredential 物件。
類型: | System.Management.Automation.PSCredential |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-DisplayName
指定要擷取之群組的顯示名稱。
類型: | System.String[] |
Position: | 1 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | True |
-Id
指定要擷取的群組標識碼。 這可能是 GUID 或將轉換成 GUID 的字串。
類型: | System.Guid[] |
Position: | 1 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-SCSession
指定與管理伺服器的連線。 預設值為目前的管理群組連線。
您可以輸入由 Get-SCManagementGroupConnection Cmdlet 所傳回的管理群組連接物件。
類型: | Microsoft.SystemCenter.Core.Connection.Connection[] |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
輸入
System.Guid
您可以使用管線將群組 GUID 傳送至 get-SCSMGroup Cmdlet
System.String
您可以使用管線將群組的名稱傳送至 Get-SCSMGroup Cmdlet 的 DisplayName 參數。
輸出
Microsoft.EnterpriseManagement.Common.EnterpriseManagementObject
此 Cmdlet 的輸出是群組物件。