Get-ActiveSyncDeviceAccessRule を Exchange 管理シェルで直接正しく実行できます。(参照: http://technet.microsoft.com/en-us/library/dd776124.aspx )
次に、以下のようにバッチファイルを書きましたが、CommandNotFoundException
. このコマンドレットを cmd.exe で使用する方法を教えてください。誰でも私を助けることができますか?ありがとうございました。
(編集者注: 書式設定のために次の 3 行が折り返されています。本来は 1 行です)
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Get-ActiveSyncDeviceAccessRule >C:\ActiveSyncDeviceAccessRule_output.txt
2>C:\standardError.txt
echo %errorlevel% >C:\exitCode.txt
そして、次のようにエラーが発生しstandardError.txt
ます。
The term 'Get-ActiveSyncDeviceAccessRule' 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:31
+ Get-ActiveSyncDeviceAccessRule <<<<
+ CategoryInfo : ObjectNotFound: (Get-ActiveSyncDeviceAccessRule:
String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException