Solved

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

Posted on 2014-02-17
9
309 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
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
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 14

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 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Reading the Web.Config using IIS 7.5? 4 38
changing harddisk on computer in corporate 10 46
Laptop "remote wipe" -- stolen ? 10 93
Disk Quota Windows 2012 R2 5 53
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…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

803 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