List_GPO_Properties.wsf (In the book)

Jan
25
2013

 

<job>
<comment>
Script : List_GPMC_Information.wsf
From the book "Group Policy" by Jeremy Moskowitz

The contents of this script are provided "as is".  
No warranty of any kind, either express or implied, is made in relation 
to the availability, accuracy, reliability or content of this script.
ALWAYS test scripts before using in your production network!
</comment>
<script language="VBScript" src="GPMgmt.vbs" />
<script>
CheckCScript
CreateGPMObjects

Set gpmSitesContainer = gpm.GetSitesContainer(dnsForestRoot,"","",gpmConstants.UsePDC)
Set gpmSearchCriteria = gpm.CreateSearchCriteria()
Set GPO_Domain_List = gpmDomain.SearchGPOs(gpmSearchCriteria)

For Each GPO In GPO_Domain_List
WScript.Echo String(20,"=")
With GPO
	WScript.Echo "GPO Friendly Name: " & .DisplayName
	WScript.Echo "GPO GUID:" & .ID
	WScript.Echo "GPC Object Active Directory Path: " & .Path
	WScript.Echo "GPO Domain Name: " & .DomainName
	WScript.Echo "GPO Created: " & .CreationTime
	WScript.Echo "GPO Last Modified: " & .ModificationTime
	WScript.Echo "Computer GPC Object Version: " & .ComputerDSVersionNumber
	WScript.Echo "Computer GPT File Version: " & .ComputerSysvolVersionNumber
	WScript.Echo "User GPC Object Version: " & .UserDSVersionNumber
	WScript.Echo "User GPT File Version: " & .UserSysvolVersionNumber
	WScript.Echo vbNL

	If .ComputerDSVersionNumber = .ComputerSysvolVersionNumber Then
		WScript.Echo "The version assigned to Computer settings in this GPO are consistent between Active Directory and Sysvol."
	Else
		WScript.Echo "WARNING! The Computer settings in this GPO show a version mismatch between Active Directory and Sysvol."
	End If
	If .UserDSVersionNumber = .UserSysvolVersionNumber Then
		WScript.Echo "The version assigned to User settings in this GPO are consistent between Active Directory and Sysvol."
	Else
		WScript.Echo "WARNING! The User settings in this GPO show a version mismatch between Active Directory and Sysvol."
	End If

	WScript.Echo vbNL

	If .isuserenabled Then 
		WScript.Echo "The User settings in this GPO are enabled."
	Else
		WScript.Echo "The User settings in this GPO are disabled."
	End If 	

	If .iscomputerenabled Then 
		WScript.Echo "The Computer settings in this GPO are enabled."
	Else
		WScript.Echo "The Computer settings in this GPO are disabled."
	End If 	
	WScript.Echo vbNL

End With
WScript.Echo vbNL
Next

</script>
</job>