@Nino Bilic @Lukas Sassl
The following Script breaks aswell, executed from ManagementToolsOnly Server, working from MBX Server when started with RunAsAdmin...
Still doing some "research" on our handmade scripts...
[PS] C:\Program Files\Microsoft\Exchange Server\V15\Scripts>.\StartDagServerMaintenance.ps1 -serverName ex6 -overrid
eMinimumTwoCopies
Cannot process argument transformation on parameter 'Identity'. Cannot convert the "ex-dag" value of type
"Deserialized.Microsoft.Exchange.Data.Directory.ADObjectId" to type
"Microsoft.Exchange.Configuration.Tasks.DatabaseAvailabilityGroupIdParameter".
+ CategoryInfo : InvalidData: (:) [Get-DatabaseAvailabilityGroup], ParameterBindin...mationException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,Get-DatabaseAvailabilityGroup
+ PSComputerName : ex9.domain.com
Cannot process argument transformation on parameter 'Identity'. Cannot convert the "ex-dag" value of type
"Deserialized.Microsoft.Exchange.Data.Directory.ADObjectId" to type
"Microsoft.Exchange.Configuration.Tasks.DatabaseAvailabilityGroupIdParameter".
+ CategoryInfo : InvalidData: (:) [Get-DatabaseAvailabilityGroup], ParameterBindin...mationException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,Get-DatabaseAvailabilityGroup
+ PSComputerName : ex9.domain.com
Log-Error : [14:39:24.208 UTC] GetCriticalMailboxResources: Could not find a DAG that server ex6 belongs to.
At C:\Program Files\Microsoft\Exchange Server\V15\Scripts\DagCommonLibrary.ps1:79 char:4
+ Log-Error ($DagCommonLibrary_LocalizedStrings.res_0005 -f ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Log-Error