Have we checked the built-in report:
List of assets by compliance state for a configuration item in a configuration baseline
CI - CB on Client
Hello,
I have a CI with the following script:
Set-ExecutionPolicy bypass
$FeatureName = "Windows-Defender"
if (Get-WindowsOptionalFeature -Online | Where {$.State -eq "Enabled" -and $.FeatureName -eq $FeatureName}) {
$Compliance = "Compliant"
}
Else {
$Compliance = "NonCompliant"
}
Return $Compliance
Which is in Revision 3 ... How could I confirmed on the Client that it is running the correct revision...?
I have an error on execution...
MEMCM Version 2203... _ Hotfixes
I checked the machine itself:
PS C:\Windows\system32> Get-ExecutionPolicy
RemoteSigned
When running the script locally on the client it works:
PS C:\Windows\system32> Set-ExecutionPolicy bypass
> $FeatureName = "Windows-Defender"
> If (Get-WindowsOptionalFeature -Online | Where {$.State `
> -eq "Enabled" -and $.FeatureName -eq $FeatureName}) {
> $Compliance = "Compliant"
> } Else {
> $Compliance = "NonCompliant"
> }
> Return $Compliance
Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose
you to the security risks described in the about_Execution_Policies help topic at
https:/go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): Y
Compliant
PS C:\Windows\system32>
Thanks,
Dom
Microsoft Security | Intune | Configuration Manager | Other
-
AllenLiu-MSFT 49,316 Reputation points Microsoft External Staff
2022-09-06T07:34:46.977+00:00
2 additional answers
Sort by: Most helpful
-
AllenLiu-MSFT 49,316 Reputation points Microsoft External Staff
2022-09-05T02:57:21.263+00:00 Thank you for posting in Microsoft Q&A forum.
Which is in Revision 3 ... How could I confirmed on the Client that it is running the correct revision...?
We can check the report of the configuration in control panel, we can see the revision of the CI.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. -
Duchemin, Dominique 2,006 Reputation points
2022-09-05T03:51:24.427+00:00 Thank you for this answer.
But is there anything more global as I have 1500 clients with 95 different policies...I am looking for a query which will give me the information you provided by the compliance report but the a complete environment?
Thanks,
Dom