G
Guest
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??!?!?!?!?!!?
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??!?!?!?!?!!?