Link to home
Start Free TrialLog in
Avatar of Martin_01
Martin_01Flag for United States of America

asked on

Backup my Active Directory from my Hypr-v domain controller

I am trying to Backup my Active Directory from my Hypr-v domain controller to its house server via powershell.
The parameters i have run across :
- can make a "one time" MS Backup from the MS Backup software gui on DC of the to the housed server hard drive.
- can not make a "scheduled" MS Backup from MS Backup software gui on DC of the to the housed server hard drive.
--issues
---backup account does not have rights. (yes i gave full admin\backup admin rights)

-can make a "one time" MS Backup from the MS Backup software using powershell on DC of the to the housed server hard drive.
-can not run twice a "one time" MS Backup from the MS Backup software using powershell on DC of the to the housed server hard drive.
--issue
---backup job name already exist (must change name in script to run again
- can not make a "scheduled" MS Backup from MS Backup software powershell on DC of the to the housed server hard drive.
--issues
---will run once, but job name issue comes in


PS script
Register-ScheduledJob -Name “System State Backup10” -Trigger @{Frequency = “Daily”; At = “12:00”} -ScriptBlock {
      # Create new Backup Policy
      $Policy = New-WBPolicy

      # Add System State to the policy
      Add-WBSystemState -Policy $Policy

      # Set Backup Location
      $BackupLocation = New-WBBackupTarget -VolumePath "\\xxxsvra\svrA"

      # Add backup location to policy
      Add-WBBackupTarget -Policy $Policy -Target $BackupLocation

      # Start Backup Using Policy
      Start-WBBackup -Policy $Policy

ref link i used: https://blogs.technet.microsoft.com/poshchap/2015/02/05/schedule-a-system-state-backup-with-powershell/
Avatar of Shreedhar Ette
Shreedhar Ette
Flag of India image

Martin,

From GUI when you configure the backup you need to select option "Backup Schedule" for backup to run daily at specific time.

Please refer the step by step article:
https://www.c-sharpcorner.com/UploadFile/cd7c2e/how-to-schedule-backup-for-daily-update-in-windows-server-20/
Avatar of Martin_01

ASKER

that gives me the permission issue. do you know a powershell fix? for my script i included?
ASKER CERTIFIED SOLUTION
Avatar of Afthab T
Afthab T
Flag of United Arab Emirates image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial