Solved

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

Posted on 2014-02-17
9
305 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
9 Comments
 
LVL 14

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
 
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
The curse of the end user strikes again      

You’ve updated all your end user’s email signatures. Hooray! But guess what? They’re playing around with the HTML, adding stupid taglines and ruining the imagery. Find out how you can save your signatures from end users today.

 
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 14

Expert Comment

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

Expert Comment

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

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

Too many email signature changes to deal with?

Are you constantly being asked to update your organization's email signatures? Do they take up too much of your time? Wouldn't you love to be able to manage all signatures from one central location, easily design them and deploy them quickly to users. Well, you can!

Question has a verified solution.

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

Both MMF (multi-mode fiber) and SMF (single-mode fiber) are types of optical fiber that can aid in communication applications. These thin strands of silica or glass will allow communication to occur between devices. The transmission of light between…
A safe way to clean winsxs folder from your windows server 2008 R2 editions
This tutorial will give a an overview on how to deploy remote agents in Backup Exec 2012 to new servers. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as connecting to a remote Back…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

862 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now