Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Decommission-Agent cmdlet #5

Open
lohash opened this issue Mar 30, 2022 · 0 comments
Open

Add Decommission-Agent cmdlet #5

lohash opened this issue Mar 30, 2022 · 0 comments

Comments

@lohash
Copy link

lohash commented Mar 30, 2022

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant