SHARE
TWEET

Untitled

a guest Jun 15th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function Backup_GPO {
  2.  
  3.     $stamp = Get-Date -UFormat "%m%d"
  4.     New-Item -ItemType "directory" -Name $stamp -Path \dc-16shareGPO_Backups -Force | out-null # create new folder to specify day backup is made
  5.     Backup-GPO -All -Path ("\dc-16shareGPO_Backups" + "$stamp" )
  6.     $folders = Get-ChildItem -Path \dc-16shareGPO_Backups$stamp
  7.     ForEach-Object {
  8.         # I want to reference the current folder here
  9.         [xml]$file = Get-Content -Path (folder that is being referenced in for loop)gpresult.xml
  10.         $name = $file.GPO.Name
  11.     }
  12.      
  13. for object in list:
  14.     print(object)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top