Reflect PowerShell module


Author
Message
jphughan
jphughan
Macrium Evangelist
Macrium Evangelist (15K reputation)Macrium Evangelist (15K reputation)Macrium Evangelist (15K reputation)Macrium Evangelist (15K reputation)Macrium Evangelist (15K reputation)Macrium Evangelist (15K reputation)Macrium Evangelist (15K reputation)Macrium Evangelist (15K reputation)Macrium Evangelist (15K reputation)Macrium Evangelist (15K reputation)
Group: Forum Members
Posts: 10K, Visits: 65K
This idea is an extension of a wish made by @RefDM elsewhere.  Currently, Reflect adds a "Macrium Reflect" tab to the Properties pane of its backup files.  It contains quite a bit of useful information, but to my knowledge there is no way to retrieve any of it programmatically.  Since Reflect already includes some convenient functionality to help users run backups via scripts, I think a natural extension of that would be to make the information in that tab more available in a scripting context for the benefit of users who use scripts.  But then I thought of some other capabilities that could be extremely useful, so now I'm envisioning a PowerShell module that includes the following cmdlets:
  • Get-ReflectBackupProperties -- accepts one or more file or folder paths (including folder recursion support) and returns everything from the Macrium Reflect tab for all of those files.  The properties in the Summary section and the Comment could be returned as individual properties, and the area that shows what the backup contains could be returned as a collection.  The returned content should also include the full path to each file for the reason mentioned below.
  • Get-ReflectMatchingBackups -- accepts a specific file (with support for specifying the various matching options that apply to F&F matching) and returns the output of the above cmdlet for every other file in its containing folder that is part of a matching backup set. Since the file path would be included in the returned object, the output could be piped to other standard PowerShell cmdlets for copy/move/delete operations, and having the rest of the above cmdlet's output such as Backup Type and Backup Date would allow this cmdlet to be used for implementing retention policies outside of Reflect if a user's needs were more complex than Reflect supported.
  • Get-ReflectBackupSet -- accepts a specific file and returns the same output as above, but only for the files that are part of the same set.  I realize that getting all files in a single set can already be achieved somewhat easily with regular PowerShell as long as the user hasn't deliberately renamed their backup set files inconsistently, but it would still be handy.
  • Get-ReflectBackupChildren -- accepts a specific file and returns the same output as above for all files in the set that depend on that file.
  • Get-ReflectBackupParents -- accepts a specific file and returns the same output as above for all files in the set on which it depends.
  • Delete-ReflectBackup -- accepts a specific file, and if it has any child backups, lists them and prompts to confirm deleting those as well before proceeding.  Support a "-Force" parameter to delete child backups automatically and also a "-NoOrphan" parameter to automatically cancel this if a backup has dependent backups.
  • Consolidate-ReflectBackup -- accepts "From" and "To" files as well as a password (as a SecureString) if needed.

Edited 19 June 2018 8:27 PM by jphughan
RefDM
RefDM
Talented Member
Talented Member (119 reputation)Talented Member (119 reputation)Talented Member (119 reputation)Talented Member (119 reputation)Talented Member (119 reputation)Talented Member (119 reputation)Talented Member (119 reputation)Talented Member (119 reputation)Talented Member (119 reputation)Talented Member (119 reputation)
Group: Forum Members
Posts: 94, Visits: 266
Hear, hear! w00t

RayG
RayG
Expert
Expert (628 reputation)Expert (628 reputation)Expert (628 reputation)Expert (628 reputation)Expert (628 reputation)Expert (628 reputation)Expert (628 reputation)Expert (628 reputation)Expert (628 reputation)Expert (628 reputation)
Group: Forum Members
Posts: 315, Visits: 1.4K
jphughan - 19 June 2018 5:49 PM
Get-ReflectBackupProperties -- accepts one or more file or folder paths (including folder recursion support) and returns everything from the Macrium Reflect tab for all of those files.  The properties in the Summary section and the Comment could be returned as individual properties, and the area that shows what the backup contains could be returned as a collection.  The returned content should also include the full path to each file for the reason mentioned below.

This goes a little way to what you want:

https://gallery.technet.microsoft.com/scriptcenter/Get-ExtensionAttribute-ff7dc182?ranMID=24542&ranEAID=je6NUbpObpQ&ranSiteID=je6NUbpObpQ-1CL49dBMHsyeUX3rOKCDUw

Get-ExtensionAttribute -fullname "<Drive>\<Path>\<File>" -ExtensionAttribute BackupMethod,DateCreated,BackupComment

To get info on all the files use C:\Dir
To get info on a single file use: C:\Dir\BackupFile.mrimg

To get some extra info on the backup add the 'MacriumInfo' extension name:

Get-ExtensionAttribute -fullname "W:\Macrium Backup\Win10-x64\" -ExtensionAttribute MacriumInfo,'BackupMethod',DateCreated,'BackupComment'

I cant explain why including the "MacriumInfo" attribute produces useful information - in fact any non existing attribute will produce the same result.

However, To make this bit work you need to comment out line 77:
#$AttributeValues = New-Object System.Management.Automation.ValidateSetAttribute($Values)

Otherwise Powershell says the item you want is not in the list of valid values



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

Edited 20 June 2018 3:49 PM by RayG
jphughan
jphughan
Macrium Evangelist
Macrium Evangelist (15K reputation)Macrium Evangelist (15K reputation)Macrium Evangelist (15K reputation)Macrium Evangelist (15K reputation)Macrium Evangelist (15K reputation)Macrium Evangelist (15K reputation)Macrium Evangelist (15K reputation)Macrium Evangelist (15K reputation)Macrium Evangelist (15K reputation)Macrium Evangelist (15K reputation)
Group: Forum Members
Posts: 10K, Visits: 65K
Nice find!  That would definitely help @RefDM with his original wish to have a way to determine the type of backup.  However, it does seem to have some issues.  First, the DateCreated attribute corresponds to the Windows timestamp of the same name not the Backup Date/Time.  I have a Synthetic Full set that began over a year ago but whose current Backup Date is a few weeks ago; the date shown by DateCreated is the former.  I tried using "BackupTime" and "BackupDate", but neither pulled that info.

Additionally, although the BackupMethod and BackupComment fields return properly when I run this on a Server 2016 system, when I run this on my Win10 1803 system against the exact same backup file, those attributes return identical copies of the MacriumInfo content, i.e. more than what's expected and the Backup Comment nowhere to be found, just as if they were non-existent attribute names.  I haven't dug into that one yet, but I didn't even know something like this was possible, so thanks for pointing me to it!

And RefDM, now that this is available, assuming it works as expected on your PC as well, if you want any help building a script that does something based on the backup type now that there's a way to pull it in a scripting environment, feel free to PM! Smile


Edited 20 June 2018 4:43 PM by jphughan
RefDM
RefDM
Talented Member
Talented Member (119 reputation)Talented Member (119 reputation)Talented Member (119 reputation)Talented Member (119 reputation)Talented Member (119 reputation)Talented Member (119 reputation)Talented Member (119 reputation)Talented Member (119 reputation)Talented Member (119 reputation)Talented Member (119 reputation)
Group: Forum Members
Posts: 94, Visits: 266
Bump.

I wonder if there is any hope to see this wish list element to find its way into a backlog of some future MR iteration or increment...

The point is to create a way to retrieve the metadata Reflect adds to the "Macrium Reflect" tab in the Properties pane of its backup files.

So, for example to retrieve the backup method used to create a backup file from a program or BAT command file or PowerShell script. Currently I cannot see any robust way to perform this.

XBower
XBower
New Member
New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)
Group: Forum Members
Posts: 12, Visits: 228
Hi all.
This sounds really interesting, could be just what I've been looking for.
But, I could be a bit thick here.
I simply can't find anything useful in the supplied link.
Should there be a script or something that I can download?
A little guidance would be appreciated.

BR


RefDM
RefDM
Talented Member
Talented Member (119 reputation)Talented Member (119 reputation)Talented Member (119 reputation)Talented Member (119 reputation)Talented Member (119 reputation)Talented Member (119 reputation)Talented Member (119 reputation)Talented Member (119 reputation)Talented Member (119 reputation)Talented Member (119 reputation)
Group: Forum Members
Posts: 94, Visits: 266
Please have a look on this post... Smile
XBower
XBower
New Member
New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)
Group: Forum Members
Posts: 12, Visits: 228
RefDM - 5 February 2021 9:36 AM
Please have a look on this post... Smile

Yeah...
Thanks man.
With a little fiddling with all the goodies in that link, I finally managed to put together something that does just what I want.
I just new that there might be a (not so very easy) way to extract this information.
Well, happy days, I've got it running very well now.

Thanks again.
BR

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