Hi,
I'd like to generate an RSOP Logging Report using Powershell in conjunction with Microsoft's GPMC. I have already googled up a script that works in general:
$gpmc = New-Object -ComObject GPMgmt.GPM
$constants = $gpmc.GetConstants()
$rsop = $gpmc.GetRSOP($constants.RSOPModeLogging,$null,0)
$rsop.LoggingComputer = "$env:COMPUTERNAME"
$rsop.LoggingUser = "$env:USERNAME"
$rsop.CreateQueryResults()
$rsop.GenerateReportToFile($constants.ReportHTML,"report.html")
However, I'd like to have a script that doesn't poll user configuration. Reason being, I have no need for it (only computer configuration policies are applied to the systems in question) and in fact it makes it impossible to schedule the script under System context (it finds no username for obvious reasons and errors out). I know you can specify to ignore user configuration if you run the wizard inside the GPMC, so there should be no issue with doing the same scripted...
...I just can't find the proper syntax for it. Any hints?
P.S.: Yes, it must be scheduled under System context, there is no other option available to me.