Skip to content

Instantly share code, notes, and snippets.

@ddhahn
Created February 1, 2013 16:42
Show Gist options
  • Save ddhahn/4692482 to your computer and use it in GitHub Desktop.
Save ddhahn/4692482 to your computer and use it in GitHub Desktop.
Backup GPO's that are named in a file
#Backup GPO's who's names are in a file
import-module grouppolicy
$gpofile = "C:\temp\gpos.txt"
$gpos = get-content($gpofile)
foreach($gpo in $gpos) {
$gpobackup = backup-gpo $gpo -path "c:\temp\gpobackup"
write-host "Backed up $gpo"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment