Unable to add Data Protetcion Manager PSSnap-In to the Powershell from c# code RRS feed

  • Question


     Hi All,

       This issue is related to System Center Data Protection manager.

          We have a server machine for System center Data Protection manager 2012, we are trying to remote execute Data Protection Manager              cmdlets in the Powershell  of DPM server. Inorder to do this, we have written a c# program that creates a runspace, the above problem              occurs while adding the PsSnapIn for Data Protection Manager (Microsoft.DataProtectionManager.2012.Powershell).

                 See the code below.


                    System.Management.Automation.Runspaces.RunspaceConfiguration runspaceConfig = System.Management.Automation.Runspaces.RunspaceConfiguration.Create();

                runspaceConfig.AddPSSnapIn("Microsoft.DataProtectionManager.2012.Powershell", out warning); /*Error occurs here*/

                this.runspace = System.Management.Automation.Runspaces.RunspaceFactory.CreateRunspace(runspaceConfig);

    • Moved by Larry Yin Wednesday, March 28, 2012 10:50 PM (From:DPM 2012 Beta - Locked)
    Tuesday, January 10, 2012 5:23 AM


  • Closing for housekeeping.

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Mike J. [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, September 3, 2013 9:13 PM