Take the 2-minute tour ×
Server Fault is a question and answer site for professional 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: http://social.technet.microsoft.com/Forums/en-US/dpmpowershell/thread/ef802ac3-b5c8-4b8d-a29b-8d4a24bd3eca/

I have been testing the script in cmd.

Connect-DPMServer : Unable to connect to contoso-dpm01.fake.com. (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)

 if(!$args[0])
{
   if(!$DPMServerName)
   {
       $DPMServerName = "contoso-dpm01.fake.com"
   }
}

   if(!$PSFileList)
   {
       $PSFileList = "\\Share1\DPM_LOGS.txt"
   }

$UserName =  "`$DomAdmin"
$pwd = "Password"
$Domain = "fake.com"
$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 contoso.com? 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

1 Answer 1

In my experience, this is a UAC issue. The script needs elevation to complete successfully.

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.