Solved

Object Not a Collection

Posted on 2011-09-28
1
291 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
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…

770 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