Solved

wmi connection to a remote computer

Posted on 2011-03-03
2
510 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

A Bare Metal Image backup allows for the restore of an entire system to a similar or dissimilar hardware. They are highly useful for migrations and disaster recovery. Bare Metal Image backups support Full and Incremental backups. Differential backup…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

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