Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  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)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement