パスワードをテキストファイルに保存するために使用されたスクリプトが1つあり、メールスクリプトはパスワードテキストファイルからこのパスワードを再呼び出し/マスタースクリプト。 パスワードを変更した後、エラーが表示されません。私たちが今得ているエラー:ConvertTo-SecureString:指定された状態で使用するキーが無効
Script used to generate secure password:
"Password" | ConvertTo-SecureString -AsPlainText -Force | ConvertFrom-SecureString | Out-File "D:\Scripts\Password.txt"
エラー:あなたが助けることができる場合
At C:\Scripts\Lync_HealthCheck_Prod.ps1:1199 char:82
+ $PasswrdS = Get-Content C:\Windows\System32\SecStrng.sec | convertto-securest
ring <<<<
+ CategoryInfo : InvalidArgument: (:) [ConvertTo-SecureString], C
ryptographicException
+ FullyQualifiedErrorId : ImportSecureString_InvalidArgument_Cryptographic
Error,Microsoft.PowerShell.Commands.ConvertToSecureStringCommand
New-Object : Exception calling ".ctor" with "2" argument(s): "Cannot process ar
gument because the value of argument "password" is null. Change the value of ar
gument "password" to a non-null value."
At C:\Scripts\Lync_HealthCheck_Prod.ps1:1218 char:27
+ $Creds1 = New-Object <<<< System.Management.Automation.PSCredential -A
rgumentList $CheckUser1, $PasswrdS
+ CategoryInfo : InvalidOperation: (:) [New-Object], MethodInvoca
tionException
+ FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.Power
Shell.Commands.NewObjectCommand
は素晴らしいことです。 、だから、あなたが実際にパスワードファイルから良質なコンテンツを読んでいる二重チェックを
"Cannot process argument because the value of argument "password" is null.
:
これは「指定された状態で使用するキーが無効です」とは何ですか? – JobaDiniz