Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2562

Script to detect GPO linked but not enabled

$
0
0

Hi folks,

I need help to find which one is linked but not enabled.

Actually im trying like this :

[xml]$GPOReport = (get-gporeport -name MY_GPO -ReportType xml)

Then if I type : 

$GPOReport.GPO


I get : 

xsi                 : http://www.w3.org/2001/XMLSchema-instance
xsd                 : http://www.w3.org/2001/XMLSchema
xmlns               : http://www.microsoft.com/GroupPolicy/Settings
Identifier          : Identifier
Name                : GPO_LS_TEST_SCRIPT
IncludeComments     : true
CreatedTime         : 2012-10-24T09:09:18
ModifiedTime        : 2012-10-24T09:09:18
ReadTime            : 2012-10-24T15:09:00.4308084Z
SecurityDescriptor  : SecurityDescriptor
FilterDataAvailable : true
Computer            : Computer
User                : User
LinksTo             : {LinksTo, LinksTo}

Good, now if I type : 

$GPOReport.GPO.LinksTo

I get : 

SOMName
-------
Lausanne
Lausanne Tests


Now if i tape : 

$test.GPO.LinksTo | fl


I get : 

SOMName    : Lausanne
SOMPath    : mydom.com/Lausanne
Enabled    : true
NoOverride : false

SOMName    : Lausanne Tests
SOMPath    : mydom.com/Lausanne Tests
Enabled    : false
NoOverride : false

My question : How can i handle the value "Enabled" without fl ?

Example : 

$GPOReport.GPO.LinksTo.Lausanne.Enabled

And it's return true or false.

Thanks

Regards,

Jon



MCITP Enterprise Administrator / Server Administrator





Viewing all articles
Browse latest Browse all 2562

Trending Articles



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