Add User to Local Security Group ​
POST /winapi/securitygrouplocal/addusertosecuritygroup
The PowerShell examples below show how to add users to local Security Groups, either via the ID of the Security Group, or the Security Group Name.
Powershell
# PowerShell Request
#JSON data for the object
$Body = @{
SecurityGroupName = "Windows Team"
UserID = "domain\fbloggs"
}
$jsonData = $Body | ConvertTo-Json
$Body = @{
SecurityGroupID = "176"
UserID = "domain\fbloggs"
}
$jsonData = $Body | ConvertTo-Json
$PasswordstateURL = 'https://passwordstate/winapi'
$result = Invoke-Restmethod -Method Post -Uri $PasswordstateURL'/securitygrouplocal/addusertosecuritygroup' -ContentType "application/json" -Body $jsonData -UseDefaultCredentials
Write-Output $result