LoginSignup
1
1

More than 5 years have passed since last update.

Windows7のログオン/オフをトリガーにPOSTイベントを投げる

Last updated at Posted at 2018-01-23

TL:DR

ログオン/オフ 1時にPower Shell Scriptを実行し、
Invoke-RestMethod コマンドを用いてPOSTイベントを投げる

準備

  1. Power Shell v3.0 をインストールする 2
  2. Power Shell のセキュリティポリシを変更する 3

管理者権限でPowerShell起動後、以下のコマンドを実行する

Set-ExecutionPolicy RemoteSigned

POSTイベントを投げるスクリプトの作成

任意のエディタで <ファイル名>.ps1 を作成する。

Invoke-RestMethod -Uri "YOUR URL" -Method POST

スクリプトを登録

ファイル名を指定して実行

gpedit.msc

画像のようにログオン/オフのプロパティを開く

image.png

スクリプトをディレクトリに配置

画像下側の「ファイルの表示」を押下後、エクスプローラが開く。
エクスプローラより開かれたディレクトリに Power Shell Script を配置する

登録

画像右側の「追加」を押下後、スクリプトを選択する。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1