syg_hira's tech memo

windows server関連のTipsのおぼえがき

Get Windows service properties (Updated)

This command get get windows services properties with TSV.

  • DisplayName
  • Name
  • Status(Stopped or Running)
  • StartMode(Auto, Manual or Disabled)
  • StartName(Service Account)
Get-Service | sort-object DisplayName |ForEach-Object -Process{$Filter="Name='$($_.Name)'";$Service=(Get-WmiObject Win32_Service -filter $Filter);$("$($Service.DisplayName)`t$($Service.Name)`t$($_.Status)`t$($Service.StartMode)`t$($Service.StartName)")}