Find which account a service is set to “Log On As”

后端 未结 3 1317
悲&欢浪女
悲&欢浪女 2021-01-17 23:23

How to find out the user account (Local System/User etc) a service is set to run under (\"Log On As\")?

Unlike this similar question this code can\'t run from within

3条回答
  •  感动是毒
    2021-01-17 23:28

    This will do your Job

     Get-WMIObject Win32_Service | Where-Object {$_.startname -ne "localSystem" }| Where-Object {$_.startname -ne "NT AUTHORITY\LocalService" } |Where-Object {$_.startname -ne "NT AUTHORITY\NetworkService" } |select startname, name 
    

提交回复
热议问题