Backup GPOs basing on GPO DisplayName

$invalidChars = ‘:\\/’ + [RegEx]::Escape(-join [IO.Path]::InvalidPathChars)

$backupDir = ‘C:\temp\backup’
Get-GPO -All -Domain <DOmain Name>| ForEach-Object {
$name = $_.DisplayName -replace “[$invalidChars]”, ‘_’
$gpoDir = Join-Path $backupDir -ChildPath $name
New-Item $gpoDir -Type Directory | Out-Null
Backup-GPO -Domain <DOmain Name> -Guid $_.Id -Path $gpoDir
}

13 Comments

  1. I’ve been exploring for a little for any high-quality articles or blog posts on this kind of house . Exploring in Yahoo I at last stumbled upon this site. Reading this info So i’m satisfied to show that I have a very just right uncanny feeling I found out exactly what I needed. I most no doubt will make certain to don’t overlook this site and provides it a glance regularly.

  2. Wonderful work! This is the type of information that are meant to be shared across the net. Disgrace on the search engines for no longer positioning this put up higher! Come on over and discuss with my site . Thank you =)

  3. It is in reality a nice and useful piece of information. I?¦m satisfied that you just shared this useful info with us. Please keep us informed like this. Thanks for sharing.

  4. I simply could not leave your site before suggesting that I extremely loved the standard information a person supply for your guests? Is gonna be back ceaselessly in order to inspect new posts

Leave a Reply

Your email address will not be published.