简体   繁体   中英

Powershell Get-Service to show all services executed with specific service account name

如何使用Powershell在Windows 2012r2下对服务进行排序,以仅显示在企业域环境中使用服务帐户“ ...名称...”执行的服务

You can do that by querying the WMI Win32_Service class using the Get-WmiObject cmdlet.

For example, this will retrieve all the Windows Services that run under the LocalSystem account:

Get-WmiObject -Query "select name, startname from Win32_Service where startname = 'LocalSystem'"

Alternatively, you can retrieve all Windows Services from WMI and filter them in PowerShell using:

Get-WmiObject Win32_Service | where StartName -eq "LocalSystem"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM