4. RestoreAllGPOs.wsf
This
script restores all GPOs from the backup location. If you have archived
numerous GPOs in the backup location for a single GPO, the script will
restore only the most recent backup for each GPO. If you do not specify
a domain, the restore occurs in the current domain.
Syntax
Usage: RestoreAllGPOs.wsf BackupLocation [/Domain:value]
BackupLocation: File system location containing the GPO backups.
Domain: DNS name of domain.
Example & Output
This script simply restores all of the GPOs that have been archived in the gpo-backup share location to the domain.
cscript RestoreAllGPOs.wsf \\server1\gpo-backup
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
2 backups found at location \\server1\gpo-backup.
Processing backed up GPO 'Default Domain Policy'
The restore operation completed successfully.
Processing backed up GPO 'Default Domain Controllers Policy'
The restore operation completed successfully.
Restore succeeded for 2 GPOs.
Restore failed for 0 GPOs.
5. QueryBackupLocation.wsf
This
script provides a view into the location on the file system where you
have backed up GPOs. It allows you to see which GPOs are archived to a
specific location on the file system, whether the backup scripts ran
(BackupAllGPOs.wsf and BackupGPO.wsf), and detailed information about
the archived GPOs if the Verbose switch is used.
Syntax
Usage: QueryBackupLocation.wsf BackupFolder [/Verbose]
BackupFolder: File system location to query.
Verbose: Displays detailed information about each backup.
Example #1 & Output
This script queries the backup location in the gpo-backup share and returns a list of all GPOs that have been archived there.
cscript QueryBackupLocation.wsf \\server1\gpo-backup
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
The following GPOs are backed up at \\server1\gpo-backup:
-- Summary --
{31B2F340-016D-11D2-945F-00C04FB984F9} - Default Domain Policy
{6AC1786C-016F-11D2-945F-00C04fB984F9} - Default Domain Controllers Policy
Example #2 & Output
This
script queries the backup location in the gpo-backup share and returns
a list of all GPOs that have been archived there, including full
details about each of the archive points, including dates,
descriptions, and Backup IDs.
cscript QueryBackupLocation.wsf \\server1\gpo-backup /verbose
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.
The following GPOs are backed up at \\server1\gpo-backup:
-- Summary --
{31B2F340-016D-11D2-945F-00C04FB984F9} - Default Domain Policy
{6AC1786C-016F-11D2-945F-00C04fB984F9} - Default Domain Controllers Policy
-- Details --
GPO Name: Default Domain Policy
GPO ID: {31B2F340-016D-11D2-945F-00C04FB984F9}
2 backup(s)
BackupID: {A19258BC-2584-4081-80C6-24E5F6BD19F2}
Timestamp: Fri Nov 2 09:43:44 EDT 2007
Comment: Default Domain Policy 11/2/2007
BackupID: {4C02A6A1-3571-4D9E-9796-3A3401280197}
Timestamp: Wed Oct 31 22:43:04 EDT 2007
Comment:
GPO Name: Default Domain Controllers Policy
GPO ID: {6AC1786C-016F-11D2-945F-00C04fB984F9}
1 backup(s)
BackupID: {8A9A15DB-01EC-485E-BEE3-7F0B06AA18B1}
Timestamp: Wed Oct 31 22:43:20 EDT 2007
Comment: