Forum Discussion
ElieAT
Jan 23, 2023Iron Contributor
Script for compliance policy
Hello, Kindly need to know why im getting status error when configuring the compliance policy script? We tested on the machine it worked fine but when uploaded with the json file on intune we do...
Jan 23, 2023
Could you provide some more information? Contents of the json, the script itself etc.
Otherwise its going to be hard to tell you what could be going wrong.
- ElieATJan 23, 2023Iron ContributorScript:
return Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | select DisplayName, Publisher, InstallDate | ConvertTo-Json -Compress
$WMI_ComputerSystem = Get-WMIObject -class Win32_ComputerSystem
$WMI_BIOS = Get-WMIObject -class Win32_BIOS
$TPM = Get-Tpm
Json:
{
"Rules":[
{
"SettingName":"DisplayName",
"Operator":"IsEquals",
"DataType":"String",
"Operand":"FortiClient",
"MoreInfoUrl":"https://bing.com",
"RemediationStrings":[
{
"Language":"en_US",
"Title":"CHECKED INSTALLED SOFTAWE",
"Description": "BIOS must be updated. Please refer to the link above"
}
]
},
]
}
Other Script:
$hash = @{ ModelName = $WMI_ComputerSystem.Model; BiosVersion = $WMI_BIOS.SMBIOSBIOSVersion; TPMChipPresent = $TPM.TPMPresent}
return $hash | ConvertTo-Json -Compress
Json:
{
"Rules":[
{
"SettingName":"ModelName",
"Operator":"IsEquals",
"DataType":"String",
"Operand":"HP ENVY 15 Notebook PC",
"MoreInfoUrl":"https://bing.com",
"RemediationStrings":[
{
"Language":"en_US",
"Title":"BIOS Version needs to be upgraded to at least 2.3. Value discovered was {ActualValue}.",
"Description": "BIOS must be updated. Please refer to the link above"
}
]
},
]
}
I tried them and didnt work.
Regards,- ElieATJan 29, 2023Iron ContributorHello,
Any support?
Regards,