Quantcast
Channel: Configuration Manager 2012 - Security, Updates and Compliance forum
Viewing all articles
Browse latest Browse all 6382

SCCM 2012 R2. Compliance settings. How to check the PC is a member of specific Group in AD

$
0
0

Hello! And good day!

How i can to do it?  i try do some code in ps, but nothing. code: 

$Compliance = 'Compliant'
$comp = get-childItem -Path env:computername
$group = "All Computers"
$members = Get-ADGroupMember -Identity $group -Recursive | Select -ExpandProperty Name
$check = $members -contains $comp
If ($Check) {$Compliance = 'Non-Compliant'}
$Compliance
What i'm doing wrong? thx.


ну я такой прихожу и мур, мур, мур!





Viewing all articles
Browse latest Browse all 6382

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>