Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot validate argument on parameter 'Server' #54

Closed
alecorgit opened this issue Apr 15, 2024 · 1 comment
Closed

Cannot validate argument on parameter 'Server' #54

alecorgit opened this issue Apr 15, 2024 · 1 comment

Comments

@alecorgit
Copy link

alecorgit commented Apr 15, 2024

Hello, after the version update, the Invoke-GPOZaurr -Type GPOAnalysis command using -Forest parameter fails for each policy:

VERBOSE: Invoke-GPOZaurrContent - Processing ---

Cannot index into a null array.
At C:\Program Files\WindowsPowerShell\Modules\GPOZaurr\1.1.1\GPOZaurr.psm1:24651 char:13
+             $QueryServer = $ForestInformation['QueryServers'][$GPO.Do ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

Get-GPOReport : Cannot validate argument on parameter 'Server'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
At C:\Program Files\WindowsPowerShell\Modules\GPOZaurr\1.1.1\GPOZaurr.psm1:24652 char:110
+ ... GPO.GUID -Domain $GPO.DomainName -ReportType Xml -Server $QueryServer
+                                                              ~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Get-GPOReport], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.GroupPolicy.Commands.GetGpoReportCommand

GPOZaurr previous version 1.1.0
GPOZaurr current version 1.1.1

PrzemyslawKlys added a commit that referenced this issue Apr 16, 2024
@PrzemyslawKlys
Copy link
Member

I've never tested it, so it never fully worked. I've committed a fix which fixes GPOAnalysis, and doesn't crash, but I am not sure if all other reports correctly work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants