Bonjour ,
J'ai un problème avec mon script pour la conformité personnalisée (Custon compliance). Le statut reste toujours non applicable dans l'interface Intune :
$AdminMembers = Get-LocalGroupMember Administrateurs
$NonDefaultAdminAccounts = $AdminMembers | Where-Object Name -notmatch '\Administrateur$\BCXADMIN$\AD_Profile_Helpdesk$\Domain Admins$'
IF ($NonDefaultAdminAccounts -eq $null )
{
$numberOfExtraAdmins = "No extra admin members found"
} else
{
$numberOfExtraAdmins = "Extra admin members found"
}
$output = @{ numberOfExtraAdmins = $numberOfExtraAdmins}
return $output | ConvertTo-Json -Compress
JSON :
"Rules": [
{
"SettingName": "numberOfExtraAdmins",
"Operator": "isEquals",
"DataType": "string",
"Operand": "No extra admin members found",
"MoreInfoUrl": "https://sociéte.com/",
"RemediationStrings": [
{
"Language": "en_US",
"Title": "This machine with extra admin members.",
"Description": "There are too many members of the Administrators on this system. Please get in touch with IT Support. The device is now marked as non-compliant"
}
]
} ] }
Merci pour votre aide .
Cordialement.