Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm having a problem running a custom PS script I created to attach systems into the console.

My PS script works when i'm running it interactively in the DPM Management Shell.

I was referencing this site:

I have been testing the script in cmd.

Connect-DPMServer : Unable to connect to (ID:948)
Verify that the DPM service is running on this computer.
At C:\Program Files\Microsoft System Center 2012\DPM\DPM\bin\Attach-ProductionS
erver.ps1:49 char:31

The script is a a simple one that passes computer names to the Attach-ProductionServer.ps1

Thanks for reading. -Paul

Here's my script:

param([string] $DPMServerName, [string] $PSFileList)

       $DPMServerName = ""

       $PSFileList = "\\Share1\DPM_LOGS.txt"

$UserName =  "`$DomAdmin"
$pwd = "Password"
$Domain = ""
$installPath = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Microsoft Data Protection Manager\Setup" "UIInstallPath").UIInstallPath
$dpmModuleFullPath = $installPath + "Modules\DataProtectionManager\DataProtectionManager.psd1"
Import-Module $dpmModuleFullPath

type $PSFileList | foreach -process {
    if (!$_.Equals(""))
        .\Attach-ProductionServer.ps1 -DPMServerName $DPMServerName -PSName $_  -Username $UserName -    Password $pwd -domain $Domain
# Get the date
$DateStamp = get-date -uformat "%m-%d-%y@%H-%M"
rename-item $PSFileList $DateStamp
share|improve this question
Are you trying to connect to a DPMServer called Using a sample script? Or did you deliberately set in that name for the sake of obscurity? –  Mathias R. Jessen May 31 '13 at 18:08
I set that in the name :D Management would be unhappy if my FQDN was published –  Paul Mung May 31 '13 at 21:00
But, is it the FQDN of the DPM Server? Or the name of a client/agent computer? Could you post your script? –  Mathias R. Jessen Jun 3 '13 at 22:10
The script will read a txt file that is populated with the computer names. It will pass each computer name through the loop and attach all systems to DPM. I have confirmed that this works when i run it from DPM-Management Shell –  Paul Mung Jun 4 '13 at 4:21
So, the script works when you run it interactively. How are you running it when it fails? Via scheduled task? What security context is it running under? –  Doug Luxem Jun 6 '13 at 2:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.