Asset massive updates

Hi all,

i need to change the field "Session Port" for around 200 assets. I have been trying doing it by CSV import, but seems like it is not meant for updates.
Is there a way to modify the field in mass? Otherwise is the only solution modifying it manually assets per asset?

Thank you,

Simone

Parents
  • Hi Simone,

    You can use the safeguard-PS module to make bulk updates to Assets.

    For more information on Safeguard-PS, please refer to this link: https://github.com/OneIdentity/safeguard-ps

    Example:

    Connect-Safeguard -Appliance ip_address -Gui
    
    #Array of assets to update using the asset name or Id
    $AssetsToUpdate = "111","222"
    
    ForEach ($i in $AssetsToUpdate)
    {
    
    $asset = Get-SafeguardAsset -AssetToGet $i
    
    #You can set the new RDP session port here for example
    $asset.SessionAccessProperties.RemoteDesktopSessionPort = 3389
    $id = $asset.Id
    invoke-safeguardmethod core put "Assets/$id" -Body $asset
    }


    Thanks!

  • Hi Tawfiq,

    thank you for the reply. Are you sure it does work using the asset names and not the id?

    Because in the Swagger i see that the only field needed and fillable for the put API is the only ID, whoch is an int variable.

    Also, is it enough to specify only the SessionPort field to update?

    If I try from the swagger the other fields requested in the body are: PlatformID, Name, NetworkAddress and AssetParttionID.

    Let me know if i am wrong.

    Thank you again,

    Simone

  • Yes it should work with name or id for GET call to return the asset details
    The PUT call will use the asset id including all the returned details from GET call except modify the session port.

    Note: please test with a test asset if need be before making changes in production

    Thanks!

Reply Children
No Data