Remedy Web サービスのいずれかを使用しているときに、認証情報を挿入するのにかなりの困難があります。
$URL = "https://itsm.url.com/arsys/WSDL/public/server_name/HPD_IncidentInterface_WS";
$URI = New-Object System.Uri($URL);
$ITSM = New-WebServiceProxy -Uri $URI -Namespace ITSM;
$Credentials = New-Object ITSM.AuthenticationInfo;
$Credentials.userName = "UserName";
$Credentials.password = "PassworD";
$Credentials.authentication = '';
$ITSM.AuthenticationInfoValue = $Credentials;
コードは、表示されている最後の行で停止します。これは、生成されるエラー メッセージです。
Exception setting "AuthenticationInfoValue": "Cannot convert the "ITSM.AuthenticationInfo" value
of type "ITSM.AuthenticationInfo" to type "ITSM.AuthenticationInfo"."
At C:\\ITSM Automation\Automate Incident Modification.ps1:45 char:8
+ $ITSM. <<<< AuthenticationInfoValue = $Credentials;
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyAssignmentException
「タイプ「ITSM.AuthenticationInfo」の「ITSM.AuthenticationInfo」値をタイプ「ITSM.AuthenticationInfo」に変換できません。」...うーん...なに?これをどのようにトラブルシューティングしますか?
誰かがアイデアを持っているなら、私はすべて耳を傾けます。
関数「New-WebServiceProxy」は、ここにあります。