CMS\_GetGroupMembership
Description
Section titled “Description”The function returns which groups the current Unit is a member of
For Business Unit support click Business Unit support
Syntax
Section titled “Syntax”:vb: CMS_GetGroupMembership() As Boolean
:ps: [CiGroup[]]CMS_GetGroupMembership
Return value
Section titled “Return value”:vb: Result will be stored in gaValue
:ps: The function will return an array of the type CiGroup:
class CiGroup { [string]$Unittype [int]$Id [string]$Name [string]$Description [string]$Type [string]$Typedisplayname [string]$Icon [int]$Cmpid [string]$Scheduleid [bool]$Groupdeleted [string]$Businessunitid [int]$Linkedprofilecount [int]$Linkedapplicationcount [int]$Linkedpackagecount [int]$Linkedunitcount [int]$Folderid [string]$Guid [string]$Objecttype [int]$Parentid [int]$Packagetype [int]$Reinstallid [string]$Mode [DateTime]$Lastexecuted [int]$Pointid [int]$Osimageid [int]$Diskconfigid [int]$Installtypeid [int]$Osserverid [bool]$Clearallpackages [bool]$Clearallpackagesandgroups [object]$Customfield1 [object]$Customfield2}Example
Section titled “Example”:vb: VBScript
Section titled “:vb: VBScript”If bStatus Then bStatus = CMS_GetGroupMembership()For index = LBound(gaValue) to UBound(gaValue) xStatus = Job_WriteLog("Custom", "Index #" & index & ": '" & cStr(gaValue(index)) & "'", bStatus, True)Next:ps: PowerShell
Section titled “:ps: PowerShell”CMS_GetGroupMembership | ForEach-Object { $cs.Job_WriteLog("Group Name: ", $_.Name) $cs.Job_WriteLog("Description: ", $_.Description) $cs.Job_WriteLog("Type: ", $_.Type) $cs.Job_WriteLog("TypeDisplayName: ", $_.Typedisplayname) $cs.Job_WriteLog("Id: ", $_.Id) $cs.Job_WriteLog("Guid: ", $_.Guid) $cs.Job_WriteLog("CmpID: ", $_.Cmpid) $cs.Job_WriteLog("------","------")}
# Expected output:2023-11-19 20:38:25 - Group Name: calendar12023-11-19 20:38:25 - Description: First Calendar2023-11-19 20:38:25 - Type: 12023-11-19 20:38:25 - TypeDisplayName: Calendar2023-11-19 20:38:25 - Id: 50272023-11-19 20:38:25 - Guid: 20e9a444-62c1-464e-bf6f-5994fd47f37a2023-11-19 20:38:25 - CmpID: 12023-11-19 20:38:25 - ------ ------2023-11-19 20:38:25 - Group Name: Static One2023-11-19 20:38:25 - Description: First Static test group2023-11-19 20:38:25 - Type: 72023-11-19 20:38:25 - TypeDisplayName: Static2023-11-19 20:38:25 - Id: 50252023-11-19 20:38:25 - Guid: 6b11640d-8303-4b92-8090-e646d025f9cf2023-11-19 20:38:25 - CmpID: 12023-11-19 20:38:25 - ------ ------