List_GPO_Permissions.hta (In the book)

Download file: list_gpo_permissions.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>List GPO Permissions</TITLE>
<HTA:APPLICATION ID="List_GPO_Permissions"
APPLICATIONNAME="List_GPO_Permissions"
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">
Dim gpm, gpmConstants, gpmDomain

Sub Window_OnLoad
self.resizeTo 600,500
CreateGPMObjects

End Sub

Sub ViewPermissions
Dim Results_HTML
Set gpmSearchCriteria = gpm.CreateSearchCriteria()
gpmSearchCriteria.Add gpmConstants.SearchPropertyGPODisplayName, gpmConstants.SearchOPcontains, GPOName.value
Set gpmGPO_List = gpmDomain.SearchGPOs(gpmSearchCriteria)
On Error Resume Next
Set gpmGPO = gpmDomain.GetGPO(gpmGPO_List.item(1).ID)
If Err.Number <> 0 Then
MsgBox "Sorry, that GPO name could not be found. Please try again."
Exit Sub
End If
AddHTML Results_HTML, "Here's information about the selected GPO:<br>"
AddHTML Results_HTML, String(30,"=") & "<br>"
AddHTML Results_HTML, "GPO Friendly Name: " & gpmGPO.DisplayName & "<br>"
AddHTML Results_HTML, "Domain: " & gpmGPO.DomainName & "<br>"
AddHTML Results_HTML, "GPO GUID: " & gpmGPO.ID & "<br>"
AddHTML Results_HTML, "Modification Timestamp: " & gpmGPO.ModificationTime & "<br>"
AddHTML Results_HTML, "<br>"

Set gpmSecurityInfo = gpmGPO.GetSecurityInfo()
AddHTML Results_HTML, "The GPO has " & gpmSecurityInfo.Count & " security entries on the ACL.<br>"

For i=1 To gpmSecurityInfo.Count
AddHTML Results_HTML, String(40,"=") & "<br>"
Set gpmPermission = gpmSecurityInfo.item(i)

With gpmPermission.trustee
AddHTML Results_HTML, "Trustee Name: " & .trusteeName & "<br>"
AddHTML Results_HTML, "Trustee Type: " & ConvertTrusteeType(.trusteeType) & "<br>"
AddHTML Results_HTML, "Trustee Domain: " & .trusteeDomain & "<br>"
AddHTML Results_HTML, "Trustee DS Path: " & .trusteeDSPath & "<br>"
AddHTML Results_HTML, "Trustee SID: " & .trusteeSid & "<br>"
End With

With gpmPermission
AddHTML Results_HTML, "ACE Mask: " & ConvertAccessSetting(.permission) & "<br>"
AddHTML Results_HTML, "Denied? " & .denied & "<br>"
AddHTML Results_HTML, "Inheritable? " & .inheritable & "<br>"
AddHTML Results_HTML, "Inherited? " & .inherited & "<br>"
End With

Next

AddHTML Results_HTML, "Completed processing the security entries for " & gpmGPO.DisplayName & "."
Results_Span.innerHTML = Results_HTML
End Sub

</SCRIPT>
<div class="Title">List GPO Permissions</div>
<button onclick="window.print()">Print</button>
<p>
<div class="Heading">Select a GPO to View</div>
<table>
<tr>
<td>GPO Name:</td>
<td><input type="text" size="30" id="GPOName"></td>
</tr>
<tr>
<td> </td>
<td>
<button id="ViewPermissions" onClick="ViewPermissions()">View Permissions</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 !