Hi Alex,
thx for the hint its working.
For all others:
Raise the timeout for Server AgentCommandTimeOut and on Agent ExecTimeout (PSSnapIn needs to load a few seconds) (defaults are: 2000 on agent and 4000 on server)
Server Configuration:
AgentCommandTimeOut = 20000
Agent Configuration (for example):
ExecTimeout = 20000
ExternalParameter = DAG2013Healthstatus.status:"C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" "C:\Scripts\Get-MailboxDatabaseCopyStatus.ps1"
Content of PS1
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn
Get-MailboxDatabaseCopyStatus | fl -Property Status
Thx