How to load Data Protection Manager (DPM) PowerShell module into an empty session RRS feed

  • Question

  • Hi Everyone,

    I've got a fresh installation of DPM 2012 R2 UR 9 on a Windows server 2012 R2

    I wanted to import my scripts running previously on DPM2010 on DPM 2012 R2.

    I ran into a problem when I wanted to load the DataProtectionManager module into a powershell session.

    Looking at what has been said until now, none of these method worked for me:

    Import-Module DataProtectionManager


    Import-Module Microsoft.DataProtectionManager.2012.Powershell 

    Finally, the one that is supposed to work well is the code copied directly from the DpmClilniSCript.ps1:

    # Import the DPM PowerShell module
    $installPath = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Microsoft Data Protection Manager\Setup" "UIInstallPath").UIInstallPath
    $dpmModuleFullPath = $installPath + "Modules\DataProtectionManager\DataProtectionManager.psd1"
    Import-Module $dpmModuleFullPath 

    Yet, when I ran this code Under a PS ISE  I get this 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 ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : PermissionDenied: (HKEY_LOCAL_MACH...n Manager\Setup:String) [Get-ItemProperty], SecurityException

        + FullyQualifiedErrorId : System.Security.SecurityException,Microsoft.PowerShell.Commands.GetItemPropertyCommand

    Anyone came across this problem?

    It is really annoying to see that MS can't make thing simple!

    Thank you for your help

    Tuesday, June 14, 2016 1:21 PM

All replies