Hi All,
I am trying the run an invoke command using domain credentials to query a list of GPOs. The error is
An operations error occurred. (Exception from HRESULT: 0x80072020) + CategoryInfo : NotSpecified: (:) [Get-GPO], COMException + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,Microsoft.GroupPolicy.Commands.GetGpoCommand + PSComputerName : localhost And the code is below $job = Invoke-Command -ComputerName localhost -ArgumentList $DomainOU -ScriptBlock { Import-Module GroupPolicy ; $DomainFqdn = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain() ; $dctx = New-Object System.DirectoryServices.ActiveDirectory.DirectoryContext -ArgumentList "Domain",$DomainFqdn ; $DomainController = [System.DirectoryServices.ActiveDirectory.DomainController]::FindOne($dctx) ; Get-GPO -All -Domain $DomainFqdn.Name -Server $DomainController.Name } -asJob -Credential $credential wait-job -id $job.Id Receive-Job $job.Id