Solved

wmi connection to a remote computer

Posted on 2011-03-03
2
507 Views
Last Modified: 2012-05-11
I'm trying to get the events log from a remote computer, using the following code. I can get the information if I'm working on the computer but not if connected in remote. My local computer is Windows 7 and the remote W2003.

Therefore,  what should I do?
strComputer = "."

Set objWMIService = GetObject("winmgmts:" _
 & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Open in new window

0
Comment
Question by:Pakhu1
2 Comments
 
LVL 2

Accepted Solution

by:
khaaz earned 500 total points
ID: 35026599
You should try this  (after having set strcomputer, struser, strpassword with the ip address of your remote computer, and a user/password that has access to this computer)


strComputer="192.168.0.10"
strUser="myDomain\adminaccount"
strPassword="adminpassword"

Set WbemLocator= CreateObject("wbemscripting.swbemlocator")
set objWMIService=wbemLocator.connectServer(strComputer,,strUser,strPassword)
	
	

Open in new window

0
 

Author Closing Comment

by:Pakhu1
ID: 35034377
Thank you!!!
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup". After a while, you have entered a loop for Auto repair which does not fix anything and you will be in a  panic as all your work w…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

744 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

12 Experts available now in Live!

Get 1:1 Help Now