0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Windows Serviceに関して Powershellより取得

Last updated at Posted at 2025-04-02

Windowsのサービス一覧は目視確認だとServices.mscからできる
Powershellからでもできる

以下の項目に分けて取得方法を記述
①サービス一覧を全取得し、ログに出力
②サービスで特定の状態(稼働中、停止中)で取得し、ログに出力
③特定のサービスに絞って詳細を取得し、ログに出力

①サービス一覧を全取得し、ログに出力
以下の記述となる

サービス全取得

Get-Service >C:\work\Log\Service.txt

②サービスで特定の状態(稼働中、停止中)で取得し、ログに出力
以下の記述となる。稼働中はRunning、停止中はStoppedに置き換える

特定な状態のサービスを取得し、ログに出力

Get-Service | Where-Object { $_.Status -eq "Running" } >C:\work\Log\Service_Running.txt

③特定のサービスに絞って詳細を取得し、ログに出力
例としてWindows Update (サービス名:wuauserv)

Windows Updateのサービス情報取得し、ログに出力

$serviceName ="wuauserv"
Get-Service -Name $serviceName | Select-Object -Property Name,DisplayName,Status,DependentServices,ServicesDepenndedOn   >C:\work\Log\Service_wuauserv.txt

挙動は下記のようになる
サービス 詳細情報.jpg

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?