Home All Groups Group Topic Archive Search About

How do i do this in VB .Net

Author
31 Mar 2006 2:38 PM
Jonathan Smith
I have the following VBScript:

Const cComputerName = "SC-Mail"
Const cWMINameSpace = "root/cimv2/applications/exchange"
Const cWMIInstance = "ExchangeServerState"

Dim ExchangeServerList
Dim ExchangeServer

Set ExchangeServerList =
GetObject("winmgmts:{impersonationLevel=impersonate}!//" & cComputerName &
"/" & cWMINameSpace).InstancesOf(cWMIInstance)

For each ExchangeServer in ExchangeServerList

WScript.Echo "DN: " & ExchangeServer.Name

Next

That gives me our mail server's name. I have spent the last two days
unsuccesfully trying to do the same job in VB .Net. How do i do
it??!?!?!?!?!!?

Author
31 Mar 2006 3:43 PM
Terry Olsen
Take a look at this. Hopefully it can help you.

http://boycot.no-ip.com/vb/RemoteWMI.vb.html


*** Sent via Developersdex http://www.developersdex.com ***