PoshCode Archive  Artifact [259f47cbdf]

Artifact 259f47cbdf1ba384842c955db00bae20f4c65e77a8a22a90288ace957e87476e:

  • File ResultantSetOfPolicy.ps1 — part of check-in [48b7a390f1] at 2018-06-10 14:14:30 on branch trunk — The Get-GPResultantSetOfPolicy requires the -Path parameter and saves the output to file. This command should have been named Export-GPResultantSetOfPolicy. This is a script that does what a command with the verb get should do; return the result to the pipeline. (user: David Sjstrand size: 1029)

# encoding: ascii
# api: powershell
# title: ResultantSetOfPolicy
# description: The Get-GPResultantSetOfPolicy requires the -Path parameter and saves the output to file. This command should have been named Export-GPResultantSetOfPolicy. This is a script that does what a command with the verb get should do; return the result to the pipeline.
# version: 0.1
# type: module
# author: David Sjstrand
# license: CC0
# x-poshcode-id: 6378
# x-archived: 2016-06-16T09:35:16
# x-published: 2016-06-11T14:09:00
#
#
#requires -modules GroupPolicy
param([String]$Computer = 'localhost', [String]$User, [Microsoft.GroupPolicy.ReportType]$ReportType = 'XML')
$gprsop = new-object Microsoft.GroupPolicy.GPRsop([Microsoft.GroupPolicy.RsopMode]::Logging,'')
$gprsop.LoggingComputer = $Computer
if ($PSBoundParameters.ContainsKey('User')) {
	$gprsop.LoggingUser = $User
}
$gprsop.CreateQueryResults()
$report = $gprsop.GenerateReport($ReportType)
if ($ReportType -eq 'XML') {
    return [xml]$report
}
return $report