Solved

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

Posted on 2014-02-17
9
300 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
Comment Utility
Try...

wmic service get Name,StartName

Open in new window


Combine with PsExec to run remotely.
0
 
LVL 3

Author Comment

by:roycbene
Comment Utility
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
Comment Utility
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
Comment Utility
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
Google Storage: Standard vs. Nearline vs. Coldline

Google Cloud Storage has a number of classes to choose from. Although there are a lot in common, they vary in price and usage terms. This post explains Google Cloud Storage classes and helps to understand which  one to choose.

 
LVL 3

Author Comment

by:roycbene
Comment Utility
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
Comment Utility
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
Comment Utility
Why don't you post the script for prosperity and then accept that answer?
0
 
LVL 53

Expert Comment

by:McKnife
Comment Utility
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
Comment Utility
@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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Ever wondered why Windows 8 and 10 don't seem to accept your GPO-based software deployment while Windows 7 does? Read on.
OfficeMate Freezes on login or does not load after login credentials are input.
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…

771 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

11 Experts available now in Live!

Get 1:1 Help Now