< Back

Export-GPOPermissions

Fri Jan 10, 2020 7:00 pm

NAME Export-GPOPermissions



SYNOPSIS

Exports all of the permission information of GPOs to a JSON file.





SYNTAX

Export-GPOPermissions [-DisplayNames] <String[]> [-Destination] <String> [[-Domain] <String>] [-Credential

<PSCredential>] [-PassThru] [<CommonParameters>]



Export-GPOPermissions [-All] [-Destination] <String> [[-Domain] <String>] [-Credential <PSCredential>] [-PassThru]

[<CommonParameters>]





DESCRIPTION

The cmdlet uses the get Get-GPPermission command to get initial information. Any GPOs with custom permissions have

their permissions enumerated via ACL. All of the permissions are written to a JSON file that can be used with

Import-GPPermissionsFromJson.





PARAMETERS

-DisplayNames <String[]>

The names of the GPOs whose permissions should be backed up.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-All [<SwitchParameter>]

Specifies that all GPOs should have their permissions backed up.



Required? true

Position? 1

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Destination <String>

The file that should be created with the permission information. If the file exists, the content will be

overwritten.



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Domain <String>

The domain from which to backup GPO permissions in. This defaults to the domain of the current user.



Required? false

Position? 3

Default value [System.String]::Empty

Accept pipeline input? false

Accept wildcard characters? false



-Credential <PSCredential>

Specifies a user account that has permission to perform this action. The default is the current user.



Type a user name, such as "User01" or "Domain01\\User01", or enter a PSCredential object, such as one generated

by the Get-Credential cmdlet. If you type a user name, you will be prompted for a password.



Required? false

Position? named

Default value [System.Management.Automation.PSCredential]::Empty

Accept pipeline input? false

Accept wildcard characters? false



-PassThru [<SwitchParameter>]



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None





OUTPUTS

None





NOTES





AUTHOR: Michael Haken

LAST UPDATE: 1/4/2017



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Export-GPOPermissions -All -Destination c:\\GPPermissions.json



Exports all of the GPO permissions to c:\\GPPermissions.json









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Export-GPOPermissions -DisplayNames @("Default Domain Policy","Default Domain Controllers Policy")

-Destination c:\\GPPermissions.json



Exports the permissions for the Default Domain Policy and Default Domain Controllers Policy to

c:\\GPPermissions.json











RELATED LINKS