List_GPO_Properties.hta (In the book)

Jan
25
2013

 

<HTML>
<HEAD>
<!--
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!
-->
<TITLE>List GPO Properties</TITLE>
  <HTA:APPLICATION ID="List_GPO_Properties" 
    APPLICATIONNAME="List_GPO_Properties" 
    BORDER="dialog"
    CAPTION="yes"
    CONTEXTMENU="yes"
    ICON="graphics/title.ico"
    INNERBORDER="yes"
    MINIMIZEBUTTON="yes"
    MAXIMIZEBUTTON="yes"
    SCROLLABLE="yes"
    SHOWINTASKBAR="yes"
    SINGLEINSTANCE="yes"
    SYSMENU="yes"
    WINDOWSTATE="maximize">
  <LINK href='GroupPolicy.css' rel="stylesheet" type="text/css">
  <SCRIPT src='GPMgmt.vbs' language="VBScript"></SCRIPT>
  <SCRIPT src='HTA_Help.vbs' language="VBScript"></SCRIPT>
</HEAD>
<BODY>
<SCRIPT language="VBScript">
Sub Window_OnLoad
self.resizeTo 800,700
CreateGPMObjects
Dim gpmSearchCriteria, somSearchCriteria
Dim GPO_List, GPO, GPO_List_HTML
Dim SOM_List, SOM, siteSOM_List
Dim Data_HTML
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
AddHTML Data_HTML, "<ul>"
With GPO
	AddHTML Data_HTML, "GPO Friendly Name: " & .DisplayName
	AddHTML Data_HTML, "<ul>"
	AddHTML Data_HTML, "<li>GPO GUID:" & .ID
	AddHTML Data_HTML, "<li>GPC Object Active Directory Path:<br>" & .Path
	AddHTML Data_HTML, "<li>GPO Domain Name: " & .DomainName
	AddHTML Data_HTML, "<li>GPO Created: " & .CreationTime
	AddHTML Data_HTML, "<li>GPO Last Modified: " & .ModificationTime
	AddHTML Data_HTML, "<li>Computer GPC Object Version: " & .ComputerDSVersionNumber
	AddHTML Data_HTML, "<li>Computer GPT File Version: " & .ComputerSysvolVersionNumber
	AddHTML Data_HTML, "<li>User GPC Object Version: " & .UserDSVersionNumber
	AddHTML Data_HTML, "<li>User GPT File Version: " & .UserSysvolVersionNumber

'Give a warning if versions don't match - similar to GPOTOOL
	If .ComputerDSVersionNumber = .ComputerSysvolVersionNumber Then
		AddHTML Data_HTML, "<li>The version assigned to Computer settings in this GPO are consistent between Active Directory and Sysvol."
	Else
		AddHTML Data_HTML, "<li>WARNING! The Computer settings in this GPO show a version mismatch between Active Directory and Sysvol."
	End If
	If .UserDSVersionNumber = .UserSysvolVersionNumber Then
		AddHTML Data_HTML, "<li>The version assigned to User settings in this GPO are consistent between Active Directory and Sysvol."
	Else
		AddHTML Data_HTML, "<li>WARNING! The User settings in this GPO show a version mismatch between Active Directory and Sysvol."
	End If

'Give status of Computer and User parts of GPO
	If .isuserenabled Then 
		AddHTML Data_HTML, "<li>The User settings in this GPO are enabled."
	Else
		AddHTML Data_HTML, "<li>The User settings in this GPO are disabled."
	End If 	

	If .iscomputerenabled Then 
		AddHTML Data_HTML, "<li>The Computer settings in this GPO are enabled."
	Else
		AddHTML Data_HTML, "<li>The Computer settings in this GPO are disabled."
	End If 	
	AddHTML Data_HTML,"</ul>"
End With
AddHTML Data_HTML, "</ul>"
Next
Data_Span.innerHTML = Data_HTML
End Sub

</SCRIPT>
<div>List GPO Properties</div>
<button onclick="window.print()">Print</button>
<p>
<div>GPO Properties</div>
<span id="Data_Span"></span><br>
</p>

</BODY>
</HTML>
Copyright © GPanswers.com. All rights reserved. GPanswers.com is a service of PolicyPak Software