Solved

Need to find a way to see what account services have in their 'log on' properties

Posted on 2014-02-17
9
312 Views
Last Modified: 2014-03-03
Hi, all. We have a user who is no longer with our company who used his username as a logon for some Windows services. I need to be able to run a query (report or 3rd party) on the domain to find out which services have this username associate with them. Any assistance would be greatly appreciated. Thanks in advance.

-R
0
Comment
Question by:roycbene
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 15

Expert Comment

by:Giovanni Heward
ID: 39865202
Try...

wmic service get Name,StartName

Open in new window


Combine with PsExec to run remotely.
0
 
LVL 3

Author Comment

by:roycbene
ID: 39865235
Thanks for the reply.

That works for an individual machine or even one machine at a time remotely. However, I need to be able to pinpoint an individual username. We have a lot of machines on our network and I need to be able to locate these logon accounts relatively quickly.
0
 
LVL 9

Expert Comment

by:Beartlaoi
ID: 39865242
Heres a VBScript that should do just what you want
Set args = Wscript.Arguments
If args.Count < 1 Then
	WScript.Echo "Usage: <ServerName> [UserName]"
	WScript.Quit
End If

strComputer = args(0)
WScript.Echo strComputer & " service accounts"
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colListOfServices = objWMIService.ExecQuery ("Select * from Win32_Service ")
For Each objService in colListOfServices
	bDisplayIt = True
	If args.Count >= 2 Then
		bDisplayIt = False
		For i = 1 to Args.Count - 1
			If UCase(objService.StartName) = UCase(args(i)) Then bDisplayIt = True
		Next
	End If
	If bDisplayIt Then wscript.echo objService.Name & ",""" & objService.DisplayName & """,""" & objService.StartName & """"
Next

Open in new window

0
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 
LVL 3

Author Comment

by:roycbene
ID: 39865263
Beartlaoi,

Thanks for the reply. I need to be able to run this on all the servers in my domain. This seems to be for a single machine, or am I wrong? If I am wrong, where would I run it from?
0
 
LVL 3

Author Comment

by:roycbene
ID: 39865382
I actually found the answer just writing a simple powershell script that queries a list of servers in a text file. Thanks for trying!
0
 
LVL 3

Author Comment

by:roycbene
ID: 39865445
I've requested that this question be closed as follows:

Accepted answer: 0 points for roycbene's comment #a39865382

for the following reason:

Found my own answer.
0
 
LVL 15

Expert Comment

by:Giovanni Heward
ID: 39865446
Why don't you post the script for prosperity and then accept that answer?
0
 
LVL 54

Expert Comment

by:McKnife
ID: 39865462
You could use the freeware "service credential manager", does just what you need.
0
 
LVL 15

Accepted Solution

by:
Giovanni Heward earned 500 total points
ID: 39865467
@echo off
setlocal enabledelayedexpansion
if not exist machines.txt	(
	for /f "tokens=2 delims==" %%c in ('dsquery * domainroot -limit 0 -filter "(&(objectCategory=computer)(operatingSystem=Windows Server*))"') do (
		set comp=%%c
		set comp=!comp:~0,-3!
		echo !comp!>>machines.txt
	)
)
for /f %%s in (machines.txt) do (call :getsvc %%s)
goto :eof

:getsvc
set /p p=Building service name list for %1...<nul
psservice \\%1 config>%1.txt 2>nul
echo Done.
goto :eof

Open in new window

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Scenario: Your operations manager has discovered an anomaly in your security system. The business will start to suffer within 15 minutes if it is a major IT incident. What should she do? We have 6 recommendations for managing major incidents (https:…
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question