Retrieving Security Groups ​
GET /winapi/securitygroup/getsecuritygroups
You can retrieve one or more Active Directory Security Groups, with a simple GET request. Below are examples of how to retrieve all Active Directory Security Groups, or search for specific Security Groups.
Powershell
# PowerShell Request - Return all Security Groups
$PasswordstateUrl = 'https://passwordstate/winapi/securitygroup/getsecuritygroups/'
Invoke-Restmethod -Method GET -Uri $PasswordstateUrl -UseDefaultCredentials
# PowerShell Request - Search for Security Groups
$PasswordstateUrl = 'https://passwordstate/winapi/securitygroup/getsecuritygroups/?search=finance'
Invoke-Restmethod -Method GET -Uri $PasswordstateUrl -UseDefaultCredentialsJson
# Response
HTTP/1.1 200
[
{
"SecurityGroupID": 195,
"SecurityGroupName": "Finance Team",
"Description": "",
"ADSecurityGroup": "True",
"ADDomainNetBIOS": "mydomain",
"ObjectSID": "S-1-5-21-1148196639-3763766589-299460394-7760",
"SiteID": 0,
"SiteLocation": "Internal"
}
]