This is a script that works fine loccaly, but i want to use it on several
other server in all different domains.

How can i do this? (I tried to send the admin credentials along, but i am
doing something wrong. I can't get it to work)

So if anyone knows how to adjust this so i can use it, you would make my day
less frustrating ;-))

Thanks in advance

Patrick


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.493 / Virus Database: 292 - Release Date: 25/06/2003

Re: Solution by Evertjan

Evertjan
Sun Jul 06 08:13:09 CDT 2003

Patrick wrote on 06 jul 2003 in microsoft.public.scripting.vbscript:
> Loop until strPassword <> ""

A small detail:

since no string can be smaller than an empty string:

Loop until strPassword > ""

also possible:

Loop while strPassword = ""

and since you do not want only spaces anyway, perhaps:

Loop while trim(strPassword) = ""


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Re: Solution by Patrick

Patrick
Sun Jul 06 16:22:29 CDT 2003

Thanks for the tips! The beauty lies within the details. :-))

Greetz
Patrick


"Evertjan." <exjxw.hannivoort@interxnl.net> wrote in message
news:Xns93B09ADEB3BE9eejj99@194.109.133.29...
Patrick wrote on 06 jul 2003 in microsoft.public.scripting.vbscript:
> Loop until strPassword <> ""

A small detail:

since no string can be smaller than an empty string:

Loop until strPassword > ""

also possible:

Loop while strPassword = ""

and since you do not want only spaces anyway, perhaps:

Loop while trim(strPassword) = ""


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.493 / Virus Database: 292 - Release Date: 25/06/2003



Re: Connecting WMI on server in another domain?? Help by Patrick

Patrick
Sun Jul 06 16:31:14 CDT 2003

In case anybody would like to use this...here's the result.

It lists the state of services on a remote computer( in an other domain, it
asks for username an password) It displays them in an explorer window.

Patrick

Option Explicit

Dim strComputer, strUser, strPassword, objExplorer, objDocument

Set objExplorer = CreateObject("InternetExplorer.Application")
objExplorer.Navigate "about:blank"
objExplorer.ToolBar = 0
objExplorer.StatusBar = 0
objExplorer.Width = 800
objExplorer.Height = 570
objExplorer.Left = 0
objExplorer.Top = 0
objExplorer.Visible = 1

Do While (objExplorer.Busy)
Loop

Set objDocument = objExplorer.Document
objDocument.Open

objDocument.Writeln "<html><head><title>Service Status</title></head>"
objDocument.Writeln "<body bgcolor='white'>"
objDocument.Writeln "<table width='100%'>"
objDocument.Writeln "<tr>"
objDocument.Writeln "<td width='50%'><b>Service</b></td>"
objDocument.Writeln "<td width='50%'><b>State</b></td>"
objDocument.Writeln "</tr>"

Do
strComputer = inputbox( "Please enter computername (or . for local
host)", "Input" )
Loop until strComputer <> ""
Do
strUser = inputbox( "Please enter username", "Input" )
Loop until strUser <> ""
Do
strPassword = inputbox( "Please enter password", "Input" )
Loop until strPassword <> ""
ListShares strComputer, strUser, strPassword

WScript.Echo vbCrlf & "Ready."


Sub ListShares( strComputer, strUser, strPassword )
Dim strObject
Dim objLocator, objWMIService, objService
Dim colServices


Set objLocator = CreateObject( "WbemScripting.SWbemLocator" )

Set objWMIService = objLocator.ConnectServer ( strComputer,
"root/cimv2", strUser, strPassword )

objWMIService.Security_.impersonationlevel = 3

Set colServices = objWMIService.ExecQuery("SELECT State FROM
Win32_Service")


For Each objService in colServices
objDocument.Writeln "<tr>"
objDocument.Writeln "<td width='50%'>" & objService.Name & "</td>"
objDocument.writeln "<td width='50%'>" & objService.State & "</td>"
objDocument.Writeln "</tr>"
Next

objDocument.Writeln "</table>"
objDocument.Writeln "</body></html>"
objDocument.Write()
objDocument.Close

End Sub











"Patrick" <Patrick.fiten@skynet.be> wrote in message
news:3f078596$0$299$ba620e4c@reader0.news.skynet.be...
This is a script that works fine loccaly, but i want to use it on several
other server in all different domains.

How can i do this? (I tried to send the admin credentials along, but i am
doing something wrong. I can't get it to work)

So if anyone knows how to adjust this so i can use it, you would make my day
less frustrating ;-))

Thanks in advance

Patrick


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.493 / Virus Database: 292 - Release Date: 25/06/2003