?
Solved

wmi connection to a remote computer

Posted on 2011-03-03
2
Medium Priority
?
526 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
khaaz earned 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
Suggested Courses

752 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