Skip Ribbon Commands
Skip to main content

Ondrej Sevecek's English Pages

:

Engineering and troubleshooting by Directory Master!
MCM: Directory

Quick Launch

Ondrej Sevecek's English Pages > Posts > How to load Data Protection Manager (DPM) PowerShell module into an empty session
November 06
How to load Data Protection Manager (DPM) PowerShell module into an empty session

You may want to create custom PowerShell PS1 scripts that make use of the Data Protection Manager (DPM) commandlets. In order to be able to use the DPM cmdlets, basically, you must Import-Module DataProtectionManager.psd1.

You can do it two differente ways. Either load directly the full default initialization script which shows welcome banner and some initial help about DPM cmdlets - the one which is loaded from the GUI shortcut:

C:\Program Files\Microsoft System Center 2012\DPM\DPM\bin\dpmcliinitscript.ps1

Or simply load the DataProtectionManager.psd1 module directly. If you looked into the previously mentioned initialization script DpmCliInitScript.PS1, you would see the following three, very nicely generic, lines:

$installPath = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Microsoft Data Protection Manager\Setup" "UIInstallPath").UIInstallPath

$dpmModuleFullPath = $installPath + "Modules\DataProtectionManager\DataProtectionManager.psd1"

Import-Module $dpmModuleFullPath

Comments

Error when running the Get-ItemProperty

Running Get-ItemProperty générâtes the following error:

Get-ItemProperty : Requested registry access is not allowed.
At C:\Program Files\Microsoft System Center 2012 R2\DPM\DPM\bin\DpmCliInitScript.ps1:69 char:17
+ $installPath = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Microsoft Data Protec ...


How do you correct this?
 on 14/06/2016 15:55

Re: How to load Data Protection Manager (DPM) PowerShell module into an empty session

Zrovna se mi to hodilo...
 on 18/04/2017 11:59

Add Comment

Sorry comments are disable due to the constant load of spam *


This simple antispam field seems to work well. Just put here the number.

Title


You do not need to provide any value this column. It will automatically fill with the name of the article itself.

Author *


Body *


Attachments