how to list service accounts used to start services on a windows 2012 r2 server

DK Bridges 1 Reputation point

I need to document which services on my Windows 2012 R2 and Windows 2016 servers have service accounts starting them. I do not want to log into hundreds of servers and manual gather this information. There has got to be a better way. Do you know how I accomplish this task?

Windows Server 2016
Windows Server 2016
A Microsoft server operating system that supports enterprise-level management updated to data storage.
2,321 questions
Windows Server 2012
Windows Server 2012
A Microsoft server operating system that supports enterprise-level management, data storage, applications, and communications.
1,510 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Clément BETACORNE 2,021 Reputation points


    Your best option for your request will be to use PowerShell and Active Directory Module, below an example of what you can do :

    $Computers = Get-ADComputer -Filter * -properties OperatingSystem | Where-Object {$_.OperatingSystem -like "*server*"}
    $colObj = @()
    foreach($Computer in $Computers) {
        try {
            $services = Get-WmiObject win32_service -computername $Computer.Name -ErrorAction Stop
            foreach($service in $services) {
                $hash = @{
                computerName = $Computer.Name
                serviceName = $
                account = $service.startname
                startmode = $service.startmode
                $exportObj = New-Object PSObject -Property $hash
                $colObj = $colObj + $exportObj
        catch {
            Write-Output "Could not request service"
    Write-Output $colObj

    Note : It can be improved but at least you have materials to start your documentation


    0 comments No comments

  2. Limitless Technology 39,186 Reputation points

    Hello @DK Bridges

    you can use powershell to get the information you are looking for:


    Hope this helps with your query!

    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments