Skip to content

Add Decommission-Agent cmdlet #5

@lohash

Description

@lohash

I'm looking for a way to decommission specified agents en masse where multiple agents exist on the console with the same computername but different UUIDs. The SentinelOne console currently has no way to do so with such specificity. I'm using Get-S1Agent as below to pull all agents, then filter down to offline duplicates:

$agents = get-S1Agent -APITokenName API -ResultSize All
$ht = @{}
$dupes = @()
$agents.computername | foreach {$ht["$_"] += 1}
$ht.keys | where {$ht["$_"] -gt 1} | foreach {$dupes += $_ }
$offlineDupes = $agents | where {$_.computername -in $dupes -and $_.IsActive -eq "false"}

Could a cmdlet be added to access the "/web/api/v2.1/agents/actions/decommission" endpoint and decommission agents?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions