Generate_GPO_Settings_Report.hta (In the book)

Download file: generate_gpo_settings_report.hta (3 Kb)

<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>Generate GPO Settings Report</TITLE>
<HTA:APPLICATION ID="Generate_GPO_Settings_Report"
APPLICATIONNAME="Generate_GPO_Settings_Report"
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 700,400
CreateGPMObjects
ReportFolder.Value = GetDefaultFolder(NoDate)
End Sub

Sub GetReportFolder
ReportFolder.Value = BrowseForFolder
End Sub

Sub GenerateReport
Dim gpmSearchCriteria, GPO_List, GPO
Dim gpmResult, gpmResult_Status
Dim ReportName, ReportSuffix
Dim Results_HTML
self.resizeTo 100,0
Set gpmSearchCriteria = gpm.CreateSearchCriteria()
Set GPO_List = gpmDomain.SearchGPOs(gpmSearchCriteria)
If ReportType(0).checked Then
gpmReport = gpmConstants.reportHTML
ReportSuffix = ".html"
Else
gpmReport = gpmConstants.reportXML
ReportSuffix = ".xml"
End If
For Each GPO In GPO_List
ReportName = ReportFolder.Value & "GPO Report - " & GPO.DisplayName & ReportSuffix
Set gpmResult = GPO.GenerateReportToFile(gpmReport,ReportName)
Set gpmResult_Status = gpmResult.Status
If gpmResult_Status.Count <> 0 Then
AddHMTL "<li>Error on " & GPO.DisplayName & "<ul>"
For i = 1 To gpmResult_Status.Count
AddHTML Results_HTML, "<li>" & gpm_Status.Item(i).Message
Next
AddHTML Results_HTML, "</ul>"
gpmResult.OverallStatus()
Else
AddHTML Results_HTML, "<li>Successfully created " & ReportName
End If
Next
Results_Span.innerHTML = Results_HTML
self.resizeTo 700,400
End Sub

</SCRIPT>
<p><div class="Title">Generate GPO Settings Report</div></p>
<p>
<div class="Heading">Select Report Location and Format</div>
<table>
<tr>
<td>Report Location:</td>
<td><input type="text" size="75" id="ReportFolder"></td>
</tr>
<tr>
<td> </td>
<td align="right"><button id="BrowseButton" onclick="GetReportFolder()">Change Location</button></td>
</tr>
<tr>
<td>Report Type:</td>
<td>
<input type="radio" name="ReportType" value="HTML" checked>HTML Report
<input type="radio" name="ReportType" value="XML">XML Report
</td>
</tr>
<tr>
<td> </td>
<td>
<button id="GenerateReportButton" onClick="GenerateReport()">Generate Report</button>
</td>
</tr>
</table>
<ul>
<span id="Results_Span"></span>
</ul>
</p>

</BODY>
</HTML>
 

Be a hero! Report a problem with this web page here

Event Calendar

Find out where and when Jeremy will be speaking next.

November 2008
SMTWTFS
1
2345678
9101112131415
16171819202122
23242526272829
30
Mon, Nov 10 - Thu, Nov 13
Windows Connections -- Vegas
It's WinConnections time! All sorts of great speeches this time. GP Troubleshooting, My Pre-Con, App-V 101. Will you be there?
www.winconnections.com
Mon, Nov 17 - Tue, Nov 18
Two-Day Intensive Group Policy Essentials Workshop (taught by Jeremy Moskowitz (Lead Instructor) - GPanswers.com / Moskowitz, Inc. )
 Final class of 2008.
This is a Two-Day Intensive Group Policy Essentials Workshop in Atlanta, GA !
Wed, Nov 19 - Thu, Nov 20
Two-Day "Group Policy 2.0" Catch-Up Workshop (taught by Jeremy Moskowitz (Lead Instructor) - GPanswers.com / Moskowitz, Inc. )
 Final class of 2008.
This is a Two-Day "Group Policy 2.0" Catch-Up Workshop in Atlanta, GA !
Fri, Nov 21 - Fri, Nov 21
One-Day Advanced Group Policy Workshop (XP/Vista Focused) (taught by Jeremy Moskowitz (Lead Instructor) - GPanswers.com / Moskowitz, Inc. )
 Final class of 2008.
This is a One-Day Advanced Group Policy Workshop (XP/Vista Focused) in Atlanta, GA !