none
Error while running the Get-CASHealth.ps1 script on Exch 2013 CU12 RRS feed

  • Question

  • Hi There,

    Our Servers CAS servers were on CU4 and recently we upgraded to CU12. Cashealth.ps1 was working fine in CU4 and now with CU12 its giving an error

    Cannot process argument transformation on parameter 'Server'. Cannot convert value "Server01" to type
    "Microsoft.Exchange.Configuration.Tasks.ServerIdParameter". Error: "Cannot convert hashtable to an object of the
    following type: Microsoft.Exchange.Configuration.Tasks.ServerIdParameter. Hashtable-to-Object conversion is not
    supported in restricted language mode or a Data section."
    + CategoryInfo : InvalidData: (:) [Get-ActiveSyncVirtualDirectory], ParameterBindin...mationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Get-ActiveSyncVirtualDirectory
    + PSComputerName

    any help would be greatly appreciated.

    Thanks
    Senthams

    Posting the script here,

    Write-Host "Getting ActiveSync Urls"
    foreach ($CAS in $CASinSite)
    {
    $CASActiveSyncUrls = @(Get-ActiveSyncVirtualDirectory -Server $CAS -AdPropertiesOnly | Select InternalURL,ExternalURL)
    foreach ($CASActiveSyncUrl in $CASActiveSyncUrls)
    {
    if (!($SiteActiveSyncInternalUrls -Contains $CASActiveSyncUrl.InternalURL.AbsoluteUri) -and ($CASActiveSyncUrl.InternalURL.AbsoluteUri -ne $null))
    {
    $SiteActiveSyncInternalUrls += $CASActiveSyncUrl.InternalURL.AbsoluteUri
    }
    if (!($SiteActiveSyncExternalUrls -Contains $CASActiveSyncUrl.ExternalURL.AbsoluteUri) -and ($CASActiveSyncUrl.ExternalURL.AbsoluteUri -ne $null))
    {
    $SiteActiveSyncExternalUrls += $CASActiveSyncUrl.ExternalUrl.AbsoluteUri
    }
    }
    }
    if ($SiteActiveSyncInternalUrls.Count -gt 1) { Write-Warning "More than 1 ActiveSync internal URL found in site"}
    if ($SiteActiveSyncExternalUrls.Count -gt 1) { Write-Warning "More than 1 ActiveSync external URL found in site"}

    Wednesday, September 21, 2016 4:02 PM

All replies

  • Cannot process argument transformation on parameter 'Server'. Cannot convert value "Server01" to type

    "Microsoft.Exchange.Configuration.Tasks.ServerIdParameter". Error: "Cannot convert hashtable to an object of the
    following type: Microsoft.Exchange.Configuration.Tasks.ServerIdParameter. Hashtable-to-Object conversion is not
    supported in restricted language mode or a Data section."

    Error you are getting is Hashtable-to-Object conversion is not supported in restricted language mode or a Data section."

    i feel Changes are required to the below block:

    Change below Block of code from:

    foreach ($CAS
    in $CASinSite)
    
    {
    
    $CASActiveSyncUrls 
    = @(Get-ActiveSyncVirtualDirectory
    -Server $CAS
    -AdPropertiesOnly 
    | Select InternalURL,ExternalURL)

    Change Block of Code To:

    foreach ($CAS
    in $CASinSite)
    
    {
    
    $CASActiveSyncUrls 
    = @(Get-ActiveSyncVirtualDirectory
    -Server $CAS.FQDN
    -AdPropertiesOnly 
    | Select InternalURL,ExternalURL)

    Revert with the outcome of the script execution post changes. Also reply any other error messages you see while running the script.

    if the changes above doesn't help then see if the below links provide any insight and help you fix your issue.

    https://social.technet.microsoft.com/Forums/exchange/en-US/ba139f2f-723f-46b8-88d6-8a7176d4c3a3/exchange-2013-kerberos-unable-to-run-rollalternateserviceaccountpasswordps1?forum=exchangesvrgeneral

    https://www.granikos.eu/en/justcantgetenough/PostId/181/hashtable-to-object-conversion-is-not-supported-in-restricted-language-mode


    Pavan Maganti ~ ( Exchange | 2003/2007/2010/E15(2013)) ~~ Please remember to click “Vote As Helpful" if it really helps and "Mark as Answer” if it answers your question, “Unmark as Answer” if a marked post does not actually answer your question. ~~ This Information is provided is "AS IS" and confers NO Rights!!


    • Edited by PK M Saturday, September 24, 2016 3:15 PM Add couple of Hyperlinks
    Saturday, September 24, 2016 3:09 PM