Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Permission Denied 'GetObject'

Status
Not open for further replies.

kanna89

Technical User
Nov 30, 2012
1
0
0
IN
Hi,

I am trying to write a script to stop services automatically in a Windows server 2003 R2. i am having a text file with the server name and services name and use the concept of array for stopping all the services.,


Sample script as follows,

Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & splitArray(0) & "\root\cimv2") 'Computer name
Set colItems = objWMIService.ExecQuery("Select * from Win32_Service where DisplayName = '" & splitArray(1) & "'") 'Service name
For Each objItem in colItems

But when i execute the script from the 32-bit server i get the error,
Microsoft VBScript Runtime error (at the line For loop in the script): ActiveX component can't create the object.

When i tried to execute the same script from 64-bit server , i get the error,

Error:permission Denied 'GetObject'
Source:Microsoft VBScript Runtime error
Code:800A0046

Can someone please help me out
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top