lep86 Posted May 31, 2016 Report post Posted May 31, 2016 Good day! I try to get domain groups my PC. I use that script $Compliance = 'Compliant' Get-ADComputer -Identity $env:COMPUTERNAME -Properties MemberOf | select -expand MemberOf | foreach {if ($_ -like '*All Coputers*') {$Compliance = 'Non-Compliant'}} $Compliance But the result always teaches compliant regardless of which group the computer is located. What i'm doing wrong? Quote Share this post Link to post Share on other sites More sharing options...
0 GarthMJ Posted May 31, 2016 Report post Posted May 31, 2016 Have you tested this script outside of CM? does this script work? Have you tested it as CM would execute using the local system account on the local PC? Quote Share this post Link to post Share on other sites More sharing options...
0 lep86 Posted June 1, 2016 Report post Posted June 1, 2016 Have you tested this script outside of CM? does this script work? Have you tested it as CM would execute using the local system account on the local PC? yes, its work Quote Share this post Link to post Share on other sites More sharing options...
0 Peter33 Posted June 1, 2016 Report post Posted June 1, 2016 This will not work, unless you have the RSAT Tools installed on all of your Clients and activated the AD tools. Anyways, it's completely unnecessary. You already have the Information in your SCCM Database, if AD and AD Group Discovery is activated. Quote Share this post Link to post Share on other sites More sharing options...
0 lep86 Posted June 1, 2016 Report post Posted June 1, 2016 This will not work, unless you have the RSAT Tools installed on all of your Clients and activated the AD tools. Anyways, it's completely unnecessary. You already have the Information in your SCCM Database, if AD and AD Group Discovery is activated. How i can get? Quote Share this post Link to post Share on other sites More sharing options...
0 GarthMJ Posted June 1, 2016 Report post Posted June 1, 2016 How i can get? This SQL query will get you started. Select RV.Netbios_name0, SSGN.System_Group_Name0 from dbo.v_R_system_valid RV join dbo.v_RA_System_System_Group_Name SSGN on RV.ResourceId = SSGN.resourceID Where RV.Netbios_name0 = 'CAOTTANT-GJL' Order by RV.Netbios_name0 Quote Share this post Link to post Share on other sites More sharing options...
Good day! I try to get domain groups my PC. I use that script
But the result always teaches compliant regardless of which group the computer is located. What i'm doing wrong?
Share this post
Link to post
Share on other sites