troubleshooting Question

Connecting using for Windows Vista Machines

Avatar of mikedaves
mikedaves asked on
Windows OSMicrosoft Legacy OSMicrosoft Development
13 Comments1 Solution892 ViewsLast Modified:
In order to connect to xp pc's remotely, I changed the call  to the following code below from a winnmgts call.  It works all the time for XP on a remote pc.  However now my call will not work for a Windows Vista pc that is local to the application.  I am not sure whether the connectserver  method can make a local dcom call.  Obvisously the winnmgts did.  I want robust code that can connect to either Windows XP remotely or locally, Windows Vista remotely or locally and if possible Windows 7 locally and remotely.  Do I have to change the calls for each type.  What happens if I don't know the OS I am connecting to?  Can I use the connectserver method for all?  Is there a problem with the authentication type for Vista as opposed to XP?
Set objLocator = CreateObject("WbemScripting.SWbemLocator")
    Set objWMIService = objLocator.ConnectServer(strComputer, "root\cimv2", strDomain & "\" & stradministrator, strAdministratorPassword)

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 13 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 13 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros