so I tried the following instead of using the form.
param(
[Security.ClaimsPrincipal]$User
)
$User.HasClaim("http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid", 'S-1-5-21-2455101938-2081098319-3243300316-1067593')
$true
$User | ConvertTo-Json | Out-File .\myAdmins.json
These are my results.
{
"Claims": [
{
"Type": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier",
"Value": "OJR2",
"ValueType": "http://www.w3.org/2001/XMLSchema#string",
"Issuer": "http://3dsfederation.3ds.com/adfs/services/trust",
"Properties": ""
},
{
"Type": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name",
"Value": "OJR2",
"ValueType": "http://www.w3.org/2001/XMLSchema#string",
"Issuer": "http://3dsfederation.3ds.com/adfs/services/trust",
"Properties": ""
},
{
"Type": "http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationmethod",
"Value": "urn:federation:authentication:windows",
"ValueType": "http://www.w3.org/2001/XMLSchema#string",
"Issuer": "http://3dsfederation.3ds.com/adfs/services/trust",
"Properties": ""
},
{
"Type": "http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationinstant",
"Value": "2023-03-14T13:17:51.375Z",
"ValueType": "http://www.w3.org/2001/XMLSchema#dateTime",
"Issuer": "http://3dsfederation.3ds.com/adfs/services/trust",
"Properties": ""
},
{
"Type": "http://schemas.microsoft.com/ws/2008/06/identity/claims/role",
"Value": "Execute",
"ValueType": "http://www.w3.org/2001/XMLSchema#string",
"Issuer": "https://www.poshtools.com",
"Properties": ""
},
{
"Type": "http://schemas.microsoft.com/ws/2008/06/identity/claims/role",
"Value": "Reader",
"ValueType": "http://www.w3.org/2001/XMLSchema#string",
"Issuer": "https://www.poshtools.com",
"Properties": ""
},
{
"Type": "http://schemas.microsoft.com/ws/2008/06/identity/claims/role",
"Value": "Operator",
"ValueType": "http://www.w3.org/2001/XMLSchema#string",
"Issuer": "https://www.poshtools.com",
"Properties": ""
},
{
"Type": "RolesAssigned",
"Value": "true",
"ValueType": "http://www.w3.org/2001/XMLSchema#string",
"Issuer": "https://www.poshtools.com",
"Properties": ""
}
],
"Identity": {
"Name": "OJR2"
}
}