Powershell を使用して交換サーバーに接続し、キューからメッセージを削除することになっている Python コードがあります。(私はPowershellが初めてです)
これもこれにつながったことがわかりました。これは基本的に私がすべきだと言っています:
Remove-Message -Server SERVERNAME -Filter {FromAddress -like '*MATCH*'} -WithNDR $false
コードによってどこSERVERNAME
にMATCH
指定されますか...私の問題は、Powershellでこれをどのように実行する必要があるかでしたか? だから私はこれをしました:
powershell -NoExit -Command "COMMAND"
COMMAND
上記のコマンドはどこにありますか。そして、それをサブプロセスで実行したいと思います。コマンドを手動でテストすると、次のエラーが発生します。
The term 'Remove-Message' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:15
+ Remove-Message <<<< -Server SERVERNAME -Filter {FromAddress -like '*MATCH*'} -WithNDR $false
+ CategoryInfo : ObjectNotFound: (Remove-Message:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
したがって、引数をPowershellに正しく渡していると思いますが、何か間違っていると思います。