Solved

Object Not a Collection

Posted on 2011-09-28
1
298 Views
Last Modified: 2012-05-12
I have a script that modfies the user account and password used for a windows service, but I have issues with running it, I get 'Object Not a Collection'.


Option Explicit
dim strComputer, objWMIService, colServiceList,colServices,objService
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
 & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colServiceList = objWMIService.ExecQuery _
 ("SELECT * FROM Win32_Service WHERE StartName = '.\\Scheduler'")
For Each objService in colServices
 errServiceChange = objService.Change _
 ( , , , , , , ".\TESTDOMAN\svcuser" , "santa10")
Next

Open in new window

0
Comment
Question by:rimmena
1 Comment
 
LVL 10

Accepted Solution

by:
ienaxxx earned 500 total points
ID: 36720117
u're trying to recall colservicelist as colservices in the loop declaration
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
Setting up a Microsoft WSUS update system is free relatively speaking if you have hard disk space and processor capacity.   However, WSUS can be a blessing and a curse. For example, there is nothing worse than approving updates and they just have…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

830 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