Remove User from Local Security Group ​
DELETE /winapi/securitygrouplocal
Removing a User Account from a Local Security Group is possible by submitting a 'DELETE' HTTP Verb to the API. Below are examples of how to remove based on the Security Group Name, or ID.
Powershell
# PowerShell Request
#JSON data for the object
$Body = @{
SecurityGroupName = "Windows Team"
UserID = "domain\fbloggs"
}
$jsonData = $Body | ConvertTo-Json
$PasswordstateURL = 'https://passwordstate/winapi'
Invoke-Restmethod -Method Delete -Uri $PasswordstateURL'/securitygrouplocal' -ContentType "application/json" -Body $jsonData -UseDefaultCredentialsPowershell
# PowerShell Request
#JSON data for the object
$Body = @{
SecurityGroupID = "176"
UserID = "domain\fbloggs"
}
$jsonData = $Body | ConvertTo-Json
$PasswordstateURL = 'https://passwordstate/winapi'
Invoke-Restmethod -Method Delete -Uri $PasswordstateURL'/securitygrouplocal' -ContentType "application/json" -Body $jsonData -UseDefaultCredentialsJson
# Response
HTTP/1.1 204 No Content