Home Analyst Portal

Cireson Support Group Maping by PowerShellor API

Michael_SeidlMichael_Seidl Partner Adept IT Monkey ✭✭

Hi,

is there a way to add/remove/change the Support Group Mappings by PowerShell, SQL or any other API?

Answers

  • Shane_WhiteShane_White Cireson Support Super IT Monkey ✭✭✭✭✭

    Hi @Michael_Seidl

    I've had a brief look at this and the answer is maybe from what I can see, you can use:

    Get-SCSMSetting -DisplayName "Cireson - Console App Tier Mappings"

    OR

    Get-SCSMSetting -DisplayName "Cireson - Portal Group Mapping Settings"

    To get the settings information depending on which one you are referring to, but then the information stored on the actual mappings is all set in XML, so you could use PowerShell to edit the XML but everything is in GUID form, so you would need to work out what the GUID's are before making changes. Which seems like a longer process.

    There is also the SQL Tables:

    [ServiceManager].[dbo].[MT_Cireson$ConsoleApps$Tier$Mappings$Settings]

    This table again contains XML which you could edit.

    [ServiceManager].[dbo].[MT_Cireson$SupportGroupMapping]

    This table does have Support Group and AD Group Columns which you could alter, but you would need to join it to the Dbo.LoxalizedText table I believe to read it

    Is there a particular reason you are try to change it this way?

    Hopefully this helps!

    Thanks,

    Shane

  • Michael_SeidlMichael_Seidl Partner Adept IT Monkey ✭✭

    hi,


    the Idea is to automate the Support Group creation, cause a customer want to have this automated

  • Adam_DzyackyAdam_Dzyacky Product Owner Contributor Monkey ✭✭✭✭✭
    edited November 2019

    Haven't done the entire thing myself but the process sounds like...


    • You'll need to update the list/enum (unsealed mp) that stores the value for IR/SR and CR/MA/PR if you've made those class extensions. Once created, you'll know the new entry by an enum id. That PowerShell looks something to the effect of -
    #constants
    $mgmtServer = "localhost"
    $sealedListDisplayName = "TierQueue"
    $unsealedEnumMP = Get-SCSMManagementPack -Name "ManagementPack.6e3bb6da085c484dba2ccf21b4d5f8af" -ComputerName $mgmtServer
    $newSupportGroupDisplayName = "DevOps"
    
    
    #validate against SCSM enum, not the most efficient way to get a list
    $parentEnum = Get-SCSMEnumeration -ComputerName $mgmtServer | ?{$_.Name -eq "$sealedListDisplayName"}
    $childEnums = $parentEnum | Get-SCSMChildEnumeration -Depth "Recursive" -ComputerName $mgmtServer | Sort-Object ordinal
    
    
    #create the new enum/Support Group with the next highest ordinal
    $maxOrdinal = ($ChildEnums | Measure-Object -Property Ordinal -Maximum).Maximum
    $latestOrdinal = $maxOrdinal + 1
    Add-SCSMEnumeration -Parent $parentEnum -Name $newChildEnumName -DisplayName $newSupportGroupDisplayName -Ordinal $latestOrdinal -ManagementPack $unsealedEnumMP -ComputerName $mgmtServer
    
    • Then you'll need to create a Cireson Support Group Mapping. From a related project of mine, I know for a fact these are distinct objects when it comes to the Portal Support Group mappings class. Which you can see for yourself with the following SMlets.
    $mapCls = Get-SCSMClass -Name "Cireson.SupportGroupMapping"
    $mapCls | Get-SCSMObject | select-object * -first 1
    

    I'm under the impression the only two important properties on this class/object is SupportGroupID and ADGroupId which are an enum (Get-SCSMEnumeration -id *) and an object (Get-SCSMObject -Id *) within SCSM. Which I would tend to think that all that is required to build this with PowerShell is something to the effect of:

    $mapCls = Get-SCSMClass -Name "Cireson.SupportGroupMapping"
    New-SCSMObject -Class $mapCls -PropertyHashtable @{"SupportGroupId" = "enumHere"; "AdGroupId" = "objectGuidHere"}
    


    Hope this helps and gets you started in the right direction.

  • Peter_MuttenthalerPeter_Muttenthaler Partner Advanced IT Monkey ✭✭✭

    Thank you guys, script is working great ;)

  • Adam_DzyackyAdam_Dzyacky Product Owner Contributor Monkey ✭✭✭✭✭
    edited November 2019

    Great to hear!

    Now I suppose it's just a matter of creating a Service Request that asks what Class you'll update, a runbook that creates an AD Group, adds Members, syncs a corresponding AD Connector, creates the enum in the corresponding list, and then creates the support group mapping object.

    😁

Sign In or Register to comment.