Adding a specific license to a Software based on a predefined criteria with Poershell

Robert_OsterbergRobert_Osterberg Customer IT Monkey ✭
So my question is how can i bulk update SWA in ITAM and adding licenses with powershell.
I have a csv file with SWA and i have all the bits for reading it and finding the correct License and the SWA but i need help when it comes to actually updating the SWA with the License item.  

Best Answer

  • Justin_WorkmanJustin_Workman Cireson Support Ninja IT Monkey ✭✭✭✭
    Accepted Answer
    @Robert_Osterberg
    This is pretty generic, but hopefully it will get you on the right track:
    $SAClass = Get-SCSMClass -Name Cireson.assetmanagement.SoftwareAsset
    $LicClass = Get-SCSMClass -Name Cireson.AssetManagement.Licence
    $relClass = Get-SCSMRelationshipClass -Name Cireson.AssetManagement.SoftwareAssetHasLicence

    $asset = Get-SCSMObject -Class $SAClass -Filter "displayname -like '*office*'"
    $license = Get-SCSMObject -Class $LicClass -Filter "Displayname -like '*office*'"

    New-SCSMRelationshipObject -Relationship $relClass -Source $asset -Target $license -Bulk

Answers

  • Justin_WorkmanJustin_Workman Cireson Support Ninja IT Monkey ✭✭✭✭
    Accepted Answer
    @Robert_Osterberg
    This is pretty generic, but hopefully it will get you on the right track:
    $SAClass = Get-SCSMClass -Name Cireson.assetmanagement.SoftwareAsset
    $LicClass = Get-SCSMClass -Name Cireson.AssetManagement.Licence
    $relClass = Get-SCSMRelationshipClass -Name Cireson.AssetManagement.SoftwareAssetHasLicence

    $asset = Get-SCSMObject -Class $SAClass -Filter "displayname -like '*office*'"
    $license = Get-SCSMObject -Class $LicClass -Filter "Displayname -like '*office*'"

    New-SCSMRelationshipObject -Relationship $relClass -Source $asset -Target $license -Bulk
  • Robert_OsterbergRobert_Osterberg Customer IT Monkey ✭
    It was the last bit i was missing thx for yet another quik response @Justin_Workman thx

Sign In or Register to comment.