Posts Tagged ‘Data Prtoection Manager’

Not that long ago, I created an article about DPM and I referenced DPM commands to be run in the DPM shell and only now realised that not everyone has the DPM console installed as this is not the easiest console to install and get working.

So, I am now the Proud Owner of Learn Windows PowerShell in a month of Lunches and I am an now playing and have figured out how to import the necessary commands with Remoting. There are some steps you need to follow to get PSRemoting working across an enterprise, this might help.

Once this is done, let the Magic begin.

First, lets create a New-PSSession

1. New-PSSession –ComputerName <FQDN of DPM Server> (figured this one out the hard way)

example : New-PSSession –ComputerName

Second, lets use Invoke-Command to import the module (we are going to add the DPM Snapin)

2. invoke-Command -ScriptBlock {add-pssnapin Microsoft.DataProtectionManager.PowerShell}  -Session (Get-PSSession –ComputerName <FQDN of DPM Server>)

Third, we are going to import these commands using Import-PSSession (you can add a prefix here using –prefix to identify them in a unique way)

3. Import-PSSession -Session (Get-PSSession -ComputerName <FQDN of DPM Server>) -module Microsoft.DataProtectionManager.PowerShell

Fourth, you can run Get-Command to confirm this (filtered by DPM)

4. Get-Command *DPM*

Cleaned up transcript and copied into a word file for ease here


For those of who read my previous post, you would have noticed the attach-productionserver.ps1 command. If you are really observant you would have noticed that it and a few others are not here.

So, lets try to get a workaround for that.

It is still a work in progress, however i am using Enter-PSSession for now

1. Enter-PSSession –ComputerName <FQDN of DPM Server>

2. Navigate to the DPM Bin Folder

   cd ‘C:\Program Files\Microsoft DPM\DPM\bin’

3. You will now see that the attach- commands are available

4. When done, use Exit-PSSession

Cleaned up transcript and copied into a word file for ease here


I recommend you follow Don Jones, author of the above mentioned book and PowerShell MVP

Hope you find this helpful and as interesting as I did.


Follow me

facebook-small322 twitter-small322


Have you ever been in a situation where you have either removed or added a new DPM server to your environment?

It happened to me just the other day, I had to “re-think” my DPM design and starting using “Local” to each Data Centre DPM servers to backup my data at each Data Centre. However, this was not the case before this, we were using the same product, but a different strategy. Now I had DPM agents in both datacentres connecting to DPM servers not in the same Data Centre. For Example, I had Server A (Data Centre 1) with a DPM agent from my secondary DPM Server (Data Centre 2) protecting it. So, I went searching and found my answer and it turned out to be amazingly simple thanks to POWERSHELL. DPM has a POWERSHELL management shell (thank goodness) and some built-in scripts for just this (truly amazing). Within 10 minutes I had changed my DPM agents to report to the DPM Servers and began creating protection as needed like SharePoint (see previous post).

To be safe, these are the steps I followed.

1. Remove old agent

2. Install new agent using CMD prompt

3. Ran attach-productionserver.ps1 to re-allocate to new server.

All steps are nicely listed on Microsoft Technet

This was really easy and well worth the investment in time.

On a side, was also made aware of a DPM Hotfix Rollup Package


Hopefully this helps someone else as well.


Follow me

facebook-small3 twitter-small3