サービスの現在の設定を表示したいと思いますsc failure
。これは可能ですか?
バックグラウンド:
Saltstack を使用してサービスの状態構成をセットアップしています。現在、サービスがセットアップされると、コマンド ラインが実行されて、次のような障害動作が設定されます。
sc failure serviceName reset= 30 actions= restart/5000
に渡された引数の現在の値を照会してsc failure
、Salt が変更を行う必要があるかどうかを確認し、新しい構成をプッシュするときに値の変更を記録できるようにしたいと考えています。
sc failure
とのドキュメントから、sc query
これをサポートするものは何もありません。
レジストリの にHKLM:\SYSTEM\CurrentControlSet\services\myService\
、キーがありますFailureActions
。しかし、このキーの値を読み取って目的の状態と比較する方法がわかりません。
PS C:\Users\blaffoy> (Get-ItemProperty -path $key -name failureactions).failureactions
30
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
20
0
0
0
1
0
0
0
136
19
0
0
A little bit of experimentation indicates that the first number corresponds to the reset
parameter, but beyond that I don't know how to reconcile the rest of the output.