【完全に備忘録】scコマンドでwinrmサービスの状況を調べる

winrmサービスが開始されているのかや起動設定がどうなっているのかを確認したいことがときどきあるが、すぐ忘れてしまうのでメモ。
learn.microsoft.com

普段、powershellを使用しているが,powershellではscはset-contentのエイリアスなのでうまく動作しないということをネットで知り、cmdを打ってから作業。

PS >cmd
Microsoft Windows [Version 10.0.19044.2006]
(c) Microsoft Corporation. All rights reserved.

D:\tmp>sc query  winrm

SERVICE_NAME: winrm
        TYPE               : 30  WIN32
        STATE              : 4  RUNNING
                                (STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x0

D:\tmp>sc qc winrm
[SC] QueryServiceConfig SUCCESS

SERVICE_NAME: winrm
        TYPE               : 20  WIN32_SHARE_PROCESS
        START_TYPE         : 2   AUTO_START  (DELAYED)
        ERROR_CONTROL      : 1   NORMAL
        BINARY_PATH_NAME   : C:\WINDOWS\System32\svchost.exe -k NetworkService -p
        LOAD_ORDER_GROUP   :
        TAG                : 0
        DISPLAY_NAME       : Windows Remote Management (WS-Management)
        DEPENDENCIES       : RPCSS
                           : HTTP
        SERVICE_START_NAME : NT AUTHORITY\NetworkService

D:\tmp>exit
PS >stop-transcript

netコマンドを使うと以下のような感じか。

PS >net start | sls ws-management

   Windows Remote Management (WS-Management)

scコマンドとnetコマンドの違いについては以下を参照方。
(私には理解するための知識が欠けていますが・・・)
ryoichi0102.hatenablog.com

2022-10-08 p.s.

稼働確認ならget-serviceコマンドレットでも行えるようだ。こちらの方が標準的なのかな。
PSRemotingを使用していないのでPSRemotingの設定をしていないremote computerに対しても調べることができるようだ。
PS >get-service "win*"

Status   Name               DisplayName
------   ----               -----------
Stopped  WinDefend          Microsoft Defender Antivirus Service
Running  WinHttpAutoProx... WinHTTP Web Proxy Auto-Discovery Se...
Running  Winmgmt            Windows Management Instrumentation
Running  WinRM              Windows Remote Management (WS-Manag...