Estou com um problema ao executar um script PS personalizado que criei para conectar sistemas ao console.
Meu script PS funciona quando estou executando-o de forma interativa no Shell de Gerenciamento do DPM.
Eu estava fazendo referência a este site: link
Eu testei o script em 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
O script é simples e passa nomes de computador ao Attach-ProductionServer.ps1
Obrigado pela leitura. -Paul
Aqui está meu 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