Run Program at the End of Backup - Not Working Due to SYSTEM Account


Author
Message
Steven Marty
Steven Marty
New Member
New Member (49 reputation)New Member (49 reputation)New Member (49 reputation)New Member (49 reputation)New Member (49 reputation)New Member (49 reputation)New Member (49 reputation)New Member (49 reputation)New Member (49 reputation)New Member (49 reputation)
Group: Forum Members
Posts: 37, Visits: 105
Hello,

I have an issue that is similar to the problem others are having with scheduled backups not having network access due to the scheduled backup running under the context of SYSTEM.

I have a daily backup scheduled that after completion, runs a program that synchronizes files on NAS1 to NAS2.  To run my program task post-backup, I have configured it to run using the Run a program or script at the end option found at Reflect Defaults | Scripts | PowerShell Run Programs.  With v6, the scheduled backup ran under my account and everything was working correctly.  Now, since upgrading to v7, the scheduled backup runs under SYSTEM, my program task also runs under SYSTEM.  Since SYSTEM has no network access, the post-backup task does not work.

Keep in mind that the only way to run my post-backup program is to select my Backup Definition File and either generate a VBScript or PowerShell file.  Support told me that I need to manually edit the PowerShell script and configure it to RunAs my desired account.  Support won't, however, help me edit the script to put in the necessary parameters because I'm told Macrium does not support "custom" scripts.  Not sure I agree that this is a "custom" script as there is no other way to accomplish this in the program.

Macrium support provided some links but after reading those articles and doing some searching on my own, I'm not sure exactly how to best accomplish this.  I'm hopeful that someone would be able to help me get this "custom" script edited so the post-backup program runs under the proper account (that has the necessary network access).  BTW, I'm running Macrium Reflect Workstation.

A suggestion for Macrium...I think there should be a provision under the Reflect Defaults | Scripts to specify what account to use when running the specified scripts.  This would be the same as has been done in Reflect Defaults | Network | Network Logon.

Gork
Gork
Guru
Guru (1.3K reputation)Guru (1.3K reputation)Guru (1.3K reputation)Guru (1.3K reputation)Guru (1.3K reputation)Guru (1.3K reputation)Guru (1.3K reputation)Guru (1.3K reputation)Guru (1.3K reputation)Guru (1.3K reputation)
Group: Forum Members
Posts: 647, Visits: 2.7K
Good find.  I agree, if Macrium is going to imbue Reflect with the selling point of allowing the user to run scripts they need to allow, and support, the user to run those scripts.  The change of what user runs the scripts because of the move to SYSTEM running scheduled backups feels like to me like an oversight on Macrium's part.
Froggie
Froggie
Macrium Hero
Macrium Hero (2.3K reputation)Macrium Hero (2.3K reputation)Macrium Hero (2.3K reputation)Macrium Hero (2.3K reputation)Macrium Hero (2.3K reputation)Macrium Hero (2.3K reputation)Macrium Hero (2.3K reputation)Macrium Hero (2.3K reputation)Macrium Hero (2.3K reputation)Macrium Hero (2.3K reputation)
Group: Forum Members
Posts: 1.4K, Visits: 12K
I think there were a LOT of oversights associated with this v7 release...
RayG
RayG
Expert
Expert (627 reputation)Expert (627 reputation)Expert (627 reputation)Expert (627 reputation)Expert (627 reputation)Expert (627 reputation)Expert (627 reputation)Expert (627 reputation)Expert (627 reputation)Expert (627 reputation)
Group: Forum Members
Posts: 315, Visits: 1.4K
This *may* help

First you need to get and save the credentials for the user under which the script is to run (note I hope this is not an administrators account) You only need to do this once just to get the credentials.

Open a powershell window, Copy/Paste these 2 lines and run them. You choose the location and file name:

$creds = Get-Credential
$creds | Export-CliXml -Path 'D:\creds.xml'

This will save the user/password info in an encrypted form that is SPECIFIC to the user AND the computer

Then in the backup powershell script you have, you need to add this line where you want to run the Post-Backup script:

Start-Process -Credential (Import-CliXml -Path 'D:\creds.xml) -FilePath powershell -ArgumentList ("-executionpolicy bypass -noprofile -file " + "`"D:\Post-Backup.ps1`"")

I hope that is sufficient for you to get going. Change Drives/Paths/filenames etc to those YOU need.



Regards
RayG
Windows10 Pro X64 V20H2 B19042.985 MR v8.0.6161

Steven Marty
Steven Marty
New Member
New Member (49 reputation)New Member (49 reputation)New Member (49 reputation)New Member (49 reputation)New Member (49 reputation)New Member (49 reputation)New Member (49 reputation)New Member (49 reputation)New Member (49 reputation)New Member (49 reputation)
Group: Forum Members
Posts: 37, Visits: 105
I have moved my comments and concerns over to this thread as it's basically the same issue.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Login

Explore
Messages
Mentions
Search