SOLVED: ActiveDirectory PowerShell error "Get-GPO : Current security context is not associated with an Active Directory domain or forest"
When you run the GroupPolicy PowerShell cmdlet Get-GPO you get the following error:
Get-GPO : Current security context is not associated with an Active Directory domain or forest
The same thing happens if you run the Get-GPOReport cmdlet (and the fix is the same).
This can occur if the user who is executing the command is not a member of a domain - perhaps you are running the command using a runas /netonly from a workgroup machine.
To resolve this issue you can specify both the server name to use to process the request and the domain from which to read the Group Policy objects.
Get-GPO -Server "demo-xcs-2022.demoxcs2022.int" -Domain "demoxcs2022.int" -All
Why not check out our Group Policy Audit and Documentation Tool?
Comments
Post a Comment