< Back

Export-GPOBackupsAndWmiFilters

Fri Jan 10, 2020 6:59 pm

NAME Export-GPOBackupsAndWmiFilters



SYNOPSIS

Backups all GPOs in a given domain and writes all WMI Filter information to a JSON file. The permissions for each

GPO are also written to a JSON file.





SYNTAX

Export-GPOBackupsAndWmiFilters [-Path] <String> [[-Domain] <String>] [-Credential <PSCredential>]

[<CommonParameters>]





DESCRIPTION

The cmdlet uses a native backup of every GPO in the domain. Then it queries all of the WMI filters and backs them

up to a JSON files. The JSON file can be read later and used to restore all of the WMI filters.



The permissions on each GPO are also backed up to a separate JSON file, which can be used later to set permissions

on GPOs that have already been imported.





PARAMETERS

-Path <String>

The directory location to store the backups. This directory will be created if it does not exist.



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Domain <String>

The domain from which to backup GPOs. This defaults to the domain of the current user.



Required? false

Position? 2

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.



Requires the ability to create the folder the backups will be stored in and read Active Directory objects and

attributes.



Required? false

Position? named

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

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

System.String





OUTPUTS

None





NOTES





AUTHOR: Michael Haken

LAST UPDATE: 1/4/2017



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



PS C:\\>Export-GPOBackupsAndWmiFilter -Path "c:\\GPOBackups" -Domain "contoso.com"



Exports all of the GPO backups and WMI filter information for contoso.com to the specified path.











RELATED LINKS