Saves resultant set of policy information to an XML file. This script, contributed by Mike Stephens of Microsoft, requires the Group Policy Management Console.

Visual Basic
Edit|Remove
Set oGpm = CreateObject("GPMGMT.GPM")
Set oGpConst = oGpm.GetConstants()

Set oRSOP = oGpm.GetRSOP( oGpConst.RSOPModeLogging, "" , 0)
strpath = Left(Wscript.ScriptFullName,   InStrRev(Wscript.ScriptFullName,"\", -1, vbTextCompare) )

oRSOP.LoggingFlags = 0
oRSOP.CreateQueryResults()
Set oResult = oRSOP.GenerateReportToFile( oGpConst.ReportXML ,  strPath & "rsop.xml")

oRSOP.ReleaseQueryResults()