Arend_
(MM club member)
2006-01-16 04:00 PM
Net Send Scripting.

On a side project, for the fun of it i'm writing a LanMessenger, anyone know any way how to 'catch' the messages comming in ?

Richard H.Administrator
(KiX Supporter)
2006-01-16 04:16 PM
Re: Net Send Scripting.

Could you explain a little more about what you are trying to do?

If you are trying to intercept the text from a "net send" you might be able to use AutoIT to watch for a particular window to appear and then rip the text out of it and automatically close/hide it.


LonkeroAdministrator
(KiX Master Guru)
2006-01-16 04:28 PM
Re: Net Send Scripting.

not sure about the ripping though...

if you are doing some sorta send and receive script, you should actually go for your own implementation.
something with a file based messaging or so maybe...


Arend_
(MM club member)
2006-01-16 05:10 PM
Re: Net Send Scripting.

well, the Net Send command sends a ASCII based message over the network and once windows cacthes it is places it in a MessageBox and opens that to the user/computer it was send to. Basically what I want is to catch that message.

AutoIT catches it ? can't kix do it as well ?

Jooel: Yeah maybe file based, but it's slower and causes more stress on the network (I know not that much but still).


LonkeroAdministrator
(KiX Master Guru)
2006-01-16 05:30 PM
Re: Net Send Scripting.

actually, using a file would most likely be faster and more trustworthy.

anyways, I doubt that some proggy can catch a message from inside a messagebox.
autoIt may catch the message before windows alert service gets it, but from the messagebox, I don't think so.


Arend_
(MM club member)
2006-01-16 05:43 PM
Re: Net Send Scripting.

Actually it does get it from the messagebox, I found this script on one of the forum archives (modified it for the new AutoITX3.dll but it doesn't work.

Code:

break on
;$=setconsole("minimize")

$autoIt=CreateObject("AutoItX3.Control")
? @error
do
if $AutoIt.IfWinExist("Messenger-service", "")
$x=$AutoIt.WinActivate("Messenger-service", "")
$x=$AutoIt.Send("^c")
$x=$AutoIt.WinClose("Messenger-service", "")
$Paste=$AutoIt.ClipGet()
$text=split($paste,@crlf)
$header = split($text[3])
$body = ""
for $l = 5 to ubound($text) - 4
$body = $body + @crlf + $text[$l]
next
$from = $header[2]
$to = $header[4]
$date = $header[6]
$time = $header[7] + " " + $header[8]
$body = substr($body,3)
? $from
? $body
? "----"
endif
sleep 1
until @error



ShawnAdministrator
(KiX Supporter)
2006-01-16 05:45 PM
Re: Net Send Scripting.

You planning on using a GUI for this or pure script ?

Arend_
(MM club member)
2006-01-16 05:46 PM
Re: Net Send Scripting.

A Gui when the code works..

Arend_
(MM club member)
2006-01-16 06:11 PM
Re: Net Send Scripting.

I got it from this post: Re: capture net send messages

Basically the problem I see, is it Can not find the type of class "Messenger-service" eventhough that is what the popp message is called in the Title of it and in the TaskManager.


Les
(KiX Master)
2006-01-16 07:52 PM
Re: Net Send Scripting.

Net send will leave an Application Popup event in the system log that you can pull. It will contain the body of the message.

Richard H.Administrator
(KiX Supporter)
2006-01-17 10:29 AM
Re: Net Send Scripting.

This works for me, note the use of "ControlGetText" to get the message text rather than the kludgy cut'n'paste method.

Code:
Break ON
$=SetOption("Explicit","ON")

Dim $oAutoIT
Dim $sTitle,$sMessageText
Dim $iControlMessage

Dim $sFrom,$sTo,$sDate,$sTime

$sTitle="Messenger Service"
$iControlMessage=65535

$oAutoIT=CreateObject("AutoItX3.Control")
If @ERROR OR VarType($oAutoIT)<>9 "Cannot create AutoIT object - no registered perhaps?"+@CRLF Exit @ERROR EndIf

; Set some useful options.
$=$oAutoIT.Opt("MouseCoordMode",0)
$=$oAutoIT.Opt("WinTitleMatchMode",4)

While "True"
"Waiting for "+$sTitle+" window to appear..."+@CRLF
$=$oAutoIT.WinWait($sTitle)
$sMessageText=$oAutoIT.ControlGetText("last","",$iControlMessage)
$=$oAutoIt.WinClose("last")
; Parse message text
$sMessageText=split($sMessageText,@CRLF)
$sFrom=Split($sMessageText[0]+" ")[2]
$sTo=Split($sMessageText[0]+" ")[4]
$sDate=Split($sMessageText[0]+" ")[6]
$sTime=Split($sMessageText[0]+" ")[7]+" "+Split($sMessageText[0]+" ")[8]
$sMessageText[0]=""
$sMessageText=SubStr(Join($sMessageText,@CRLF),5)
"From :"+$sFrom+@CRLF
"To :"+$sFrom+@CRLF
"Body is: "+$sMessageText+@CRLF
"------------------"+@CRLF
; Give the window a chance to close...
Sleep 0.2
Loop



Arend_
(MM club member)
2006-01-17 12:32 PM
Re: Net Send Scripting.

Perfect, Thx Richard
I should have picked up on the WinWait property.

btw for the ones with dutch OS's the name of the window is "Messenger-service" and on english OS's "Messenger service" don't ask me why.


Arend_
(MM club member)
2006-01-17 06:37 PM
Re: Net Send Scripting.

The code works fine commandline wise, but getting it into a gui is a different problem, Only option I see is to write it into a second script and call for that. Anyone have any other idea's ?

Edit: Calling a second script isn't an option either, it still leaves the KiXForms Gui hanging.


ShawnAdministrator
(KiX Supporter)
2006-01-17 06:59 PM
Re: Net Send Scripting.

Are you limited to using Messenger or can you home-brew your own protocol ... wouldn't be too-too tough to use Kixforms Socket support to write a little client/server thing, using an unused open port.

Stevie
(Starting to like KiXtart)
2006-01-18 03:18 AM
Re: Net Send Scripting.

You can use the au3info.exe included with autoit to capture the real title and id of the messagebox window so that you can script the capture of it.

--OR--

I could move to page 2 to see that is no longer an issue.


LonkeroAdministrator
(KiX Master Guru)
2006-01-18 07:28 AM
Re: Net Send Scripting.

lol.

Arend_
(MM club member)
2006-01-18 08:48 AM
Re: Net Send Scripting.

Yeah I'll have to look into socket support, probably a better idea in the end anyway. However I do have an idea.
like mIRC it would be handy if kixforms of kix itself could watch events for instance:

Code:

on SockOpen:*:{
if $socketname = "somesocketnamehere"
;do stuff
endif
}


But probably won't see the light of day since if you would implement such a thing it has to look trough your scripts and see if a script waits for such an event, so you would have to load your script into kix or kixforms memory.

If you want to see an example of my idea goto my site SphinxScript and download the SSFserv addon, open the .mrc file in notepad and search for "sockopen"


Richard H.Administrator
(KiX Supporter)
2006-01-18 10:19 AM
Re: Net Send Scripting.

It's not a problem to include it in a GUI script, you just need to use a non-blocking check.

The example script I gave you blocks simply because that is most efficient for that script, but there is no reason that you shouldn't call the routine in your GUI polling loop if you use (say) ".WinExists" instead of ".WinWait".

The code to get the message will be identical.

For example:
Code:
; GLOBAL SETUP - PLACE AT SCRIPT START----------------------
GLOBAL $oAutoIT, $sMessengerTitle, $iControlMessenger
$sMessengerTitle="Messenger Service"
$iControlMessenger=65535

$oAutoIT=CreateObject("AutoItX3.Control")
If @ERROR OR VarType($oAutoIT)<>9 "Cannot create AutoIT object - no registered perhaps?"+@CRLF Exit @ERROR EndIf

; Set some useful options.
$=$oAutoIT.Opt("MouseCoordMode",0)
$=$oAutoIT.Opt("WinTitleMatchMode",4)

; END OF GLOBAL SETUP---------------------------------------

; Check for new message function
Function udfCheckForMessage()
If $oAutoIT.WinExists($sMessengerTitle)
$udfCheckForMessage=$oAutoIT.ControlGetText("last","",$iControlMessage)
$=$oAutoIt.WinClose("last")
EndIf
EndFunction



Now, in your event polling loop you only need to do something like:
Code:

$sMessage=udfCheckForMessage()
If $sMessage
; Parse and action message
End If



Arend_
(MM club member)
2006-01-18 05:31 PM
Re: Net Send Scripting.

I've been trying to get your code to work all day Richard but can't. (edited, removed obsolete code)

(Please note the "Messenger-service / Messenger Service" difference)

Here's a simple dialog I tried it with
Code:

Break On

$System = CreateObject("Kixforms.System")
If Not $System
$nul= MessageBox("KiXforms.Net Not Initiated. This Script Will Now Close.","Error",16)
Quit()
EndIf
$nul = $System.Application.EnableVisualStyles

; GLOBAL SETUP - PLACE AT SCRIPT START----------------------
GLOBAL $oAutoIT, $sMessengerTitle, $iControlMessenger
$sMessengerTitle="Messenger-service"
$iControlMessenger=65535

$oAutoIT=CreateObject("AutoItX3.Control")
If @ERROR OR VarType($oAutoIT)<>9 "Cannot create AutoIT object - no registered perhaps?"+@CRLF Exit @ERROR EndIf

; Set some useful options.
$=$oAutoIT.Opt("MouseCoordMode",0)
$=$oAutoIT.Opt("WinTitleMatchMode",4)

; END OF GLOBAL SETUP---------------------------------------

$Form1 = $System.Form()
$Form1.Left = 368
$Form1.StartPosition = 0 ;FormStartPosition_Manual
$Form1.Size = $System.Size(240,358) ;(Width,Height)
$Form1.Text = "LAN Messenger"
$Form1.Top = 0

$Label1 = $System.Label()
$Label1.BorderStyle = 0 ;FixedSingle
$Label1.Left = 24
$Label1.Text = "Gebruiker"
$Label1.TextAlign = 16 ;MiddleLeft
$Label1.Top = 19
$Label1.Width = 55
$nul = $Form1.Controls.Add($Label1)

$ComboBox1 = $System.ComboBox()
$ComboBox1.Height = 21
$ComboBox1.ItemHeight = 13
$ComboBox1.Left = 89
$ComboBox1.Text = "Select..."
$ComboBox1.Top = 20
$nul = $Form1.Controls.Add($ComboBox1)

$RichTextBox1 = $System.RichTextBox()
$RichTextBox1.Height = 171
$RichTextBox1.Left = 13
$RichTextBox1.Text = ""
$RichTextBox1.Top = 68
$RichTextBox1.Width = 209
$nul = $Form1.Controls.Add($RichTextBox1)

$TextBox1 = $System.TextBox()
$TextBox1.Height = 61
$TextBox1.Left = 13
$TextBox1.Text = ""
$TextBox1.Top = 258
$TextBox1.Width = 125
$TextBox1.Multiline = -1
$nul = $Form1.Controls.Add($TextBox1)

$Button1 = $System.Button()
$Button1.Height = 61
$Button1.Left = 152
$Button1.Text = "Send!"
$Button1.Top = 258
$Button1.Width = 70
$Button1.Click = "SendMSG()"
$nul = $Form1.Controls.Add($Button1)

$Form1.Show ;Displays the Form
Init()
While $Form1.Visible
$Nul = Execute($Form1.DoEvents())
$RichTextBox1.Text = $RichTextBox1.Text + @CRLF + CatchMSG()
Loop
Exit 0

Function SendMSG()
Dim $msg, $rcpt, $x
$msg = $TextBox1.Text
$rcpt = $ComboBox1.Text
If $rcpt = "Select..."
$x = MessageBox("You have to select a user first!","Info",0)
Goto "end"
EndIf
$log = $log + @CRLF + "Jij zegt tegen " + $rcpt + ":" + @CRLF + $msg + @CRLF
$RichTextBox1.Text = $log
$TextBox1.Text = ""
:end
EndFunction

Function CatchMSG()
If $oAutoIT.WinExists($sMessengerTitle)
$CatchMSG=$oAutoIT.ControlGetText("last","",$iControlMessage)
$=$oAutoIt.WinClose("last")
; $log = $log + @CRLF + $oAutoIT.ControlGetText("last","",$iControlMessage) + @CRLF
; $RichTextBox1.Text = $log
EndIf
EndFunction

Function Init()
;ComboBoxbox 1 Info
$Users = GetObject("WinNT://@ldomain")
$Users.filter = "User",""
For Each $User In $Users
$x = $ComboBox1.Items.Add($User.Name)
Next
EndFunction



Richard H.Administrator
(KiX Supporter)
2006-01-19 10:27 AM
Re: Net Send Scripting.

Your problem is that you are never returning to your script.

The "$Nul = Execute($Form1.DoEvents())" line will block until an event is ready to process (I'm guessing here as I'm not a big KixForms.Net user).

You need the form to return control to the script so that you can action your own code, probably by using a timer.


LonkeroAdministrator
(KiX Master Guru)
2006-01-19 12:06 PM
Re: Net Send Scripting.

yup.
no nonblocking doEvents in kf .net currently.


Richard H.Administrator
(KiX Supporter)
2006-01-19 01:54 PM
Re: Net Send Scripting.

Jooel,

Can you post a method of using a timer to return a no-op event so that control is passed back to the script every (say) 0.1 seconds?


LonkeroAdministrator
(KiX Master Guru)
2006-01-19 02:15 PM
Re: Net Send Scripting.

out of hat code would be:
Code:

$Timer = $System.Timer
$Timer.Interval = 1000 ;1000ms = 1s
$Timer.Tick = "doSomeOtherScriptStuff()" ;the event that fires every second
$Timer.Start

function doSomeOtherScriptStuff()
"hey, we have control." ?
"in this udf we can do what ever we want."
?
endfunction



Arend_
(MM club member)
2006-01-19 04:54 PM
Re: Net Send Scripting.

Thx Richard H, Jooel, Shawn and Les

It works splendidly now, here's the final code:
(keep in mind, the dialog is very plain and simple)
Code:

Break On

$System = CreateObject("Kixforms.System")
If Not $System
$nul= MessageBox("KiXforms.Net Not Initiated. This Script Will Now Close.","Error",16)
Quit()
EndIf
$nul = $System.Application.EnableVisualStyles

; GLOBAL SETUP - PLACE AT SCRIPT START----------------------
GLOBAL $oAutoIT, $sMessengerTitle, $iControlMessage
$sMessengerTitle="Messenger-service"
$iControlMessage=65535

$oAutoIT=CreateObject("AutoItX3.Control")
If @ERROR OR VarType($oAutoIT)<>9 "Cannot create AutoIT object - no registered perhaps?"+@CRLF Exit @ERROR EndIf

; Set some useful options.
$=$oAutoIT.Opt("MouseCoordMode",0)
$=$oAutoIT.Opt("WinTitleMatchMode",4)

; Timer to catch messages
$Timer = $System.Timer
$Timer.Interval = 1000 ;1000ms = 1s
$Timer.Tick = "CatchMSG()" ;the event that fires every second
$Timer.Start

; END OF GLOBAL SETUP---------------------------------------

$Form1 = $System.Form()
$Form1.Left = 368
$Form1.StartPosition = 0 ;FormStartPosition_Manual
$Form1.Size = $System.Size(240,358) ;(Width,Height)
$Form1.Text = "LAN Messenger"
$Form1.Top = 0

$Label1 = $System.Label()
$Label1.BorderStyle = 0 ;FixedSingle
$Label1.Left = 24
$Label1.Text = "Gebruiker"
$Label1.TextAlign = 16 ;MiddleLeft
$Label1.Top = 19
$Label1.Width = 55
$nul = $Form1.Controls.Add($Label1)

$ComboBox1 = $System.ComboBox()
$ComboBox1.Height = 21
$ComboBox1.ItemHeight = 13
$ComboBox1.Left = 89
$ComboBox1.Text = "Select..."
$ComboBox1.Top = 20
$nul = $Form1.Controls.Add($ComboBox1)

$RichTextBox1 = $System.RichTextBox()
$RichTextBox1.Height = 171
$RichTextBox1.Left = 13
$RichTextBox1.Text = ""
$RichTextBox1.Top = 68
$RichTextBox1.Width = 209
$nul = $Form1.Controls.Add($RichTextBox1)

$TextBox1 = $System.TextBox()
$TextBox1.Height = 61
$TextBox1.Left = 13
$TextBox1.Text = ""
$TextBox1.Top = 258
$TextBox1.Width = 125
$TextBox1.Multiline = -1
$nul = $Form1.Controls.Add($TextBox1)

$Button1 = $System.Button()
$Button1.Height = 61
$Button1.Left = 152
$Button1.Text = "Send!"
$Button1.Top = 258
$Button1.Width = 70
$Button1.Click = "SendMSG()"
$nul = $Form1.Controls.Add($Button1)

$Form1.Show ;Displays the Form
Init()
While $Form1.Visible
$Nul = Execute($Form1.DoEvents())
Loop
Exit 0

Function SendMSG()
Dim $msg, $rcpt, $x
$msg = $TextBox1.Text
$rcpt = $ComboBox1.Text
If $rcpt = "Select..."
$x = MessageBox("You have to select a user first!","Info",0)
Goto "end"
EndIf
$log = $log + @CRLF + "Jij zegt tegen " + $rcpt + ":" + @CRLF + $msg + @CRLF
$RichTextBox1.Text = $log
run "net send $rcpt $msg"
$TextBox1.Text = ""
:end
EndFunction

Function CatchMSG()
Dim $sMessageText, $sFrom, $sDate, $sTime
If $oAutoIT.WinExists($sMessengerTitle)
$sMessageText=$oAutoIT.ControlGetText("last","",$iControlMessage)
$=$oAutoIt.WinClose("last")

$sMessageText=split($sMessageText,@CRLF)
$sFrom=Split($sMessageText[0]+" ")[2]
$sTo=Split($sMessageText[0]+" ")[4]
$sDate=Split($sMessageText[0]+" ")[6]
$sTime=Split($sMessageText[0]+" ")[7]+" "+Split($sMessageText[0]+" ")[8]
$sMessageText[0]=""
$sMessageText=SubStr(Join($sMessageText,@CRLF),5)

$log = $log + @CRLF + $sFrom + " zegt tegen jou:" + @CRLF + $sMessageText + @CRLF
$RichTextBox1.Text = $log
EndIf
EndFunction

Function Init()
;ComboBoxbox 1 Info
$Users = GetObject("WinNT://@ldomain")
$Users.filter = "User",""
For Each $User In $Users
$x = $ComboBox1.Items.Add($User.Name)
Next
EndFunction



ShawnAdministrator
(KiX Supporter)
2006-01-19 05:05 PM
Re: Net Send Scripting.

hehee, I'm impressed. It even works on my non-properly-joined-to-domain laptop using local admins ... getting NET SEND messages displayed to the console though. Can you silence them by shelling and redirecting output to bit-bucket, or will that screw things up ?

Arend_
(MM club member)
2006-01-19 05:19 PM
Re: Net Send Scripting.

Instead of the Users Filter one could also use the Computers filter of course. (Keep in mind: EN = "Messenger Service", NL = "Messenger-service")
I think it'll screw things up since it grabs the text directly from the "Messenger-service" window. But you could, as Les mentioned before" grab the msg's from the logs, that way you could hide em altogether I think.


ShawnAdministrator
(KiX Supporter)
2006-01-19 05:37 PM
Re: Net Send Scripting.

I was getting console messages like this:

An error occurred while sending a message to ADMINISTRATOR.

The message alias could not be found on the network.

More help is available by typing NET HELPMSG 2273.

Found that if I changed this line:

run "net send $rcpt $msg"

to this:

shell "cmd /c net send $rcpt $msg >nul 2>nul"

then the messages went away.


Arend_
(MM club member)
2006-01-19 05:57 PM
Re: Net Send Scripting.

Oh! I thought you were referring to the Incomming messages
Yeah the outgoing is very primitive, usually once I get something to work for myself I leave it at what it is I only really clean up and script nice when it's for someone else


ShawnAdministrator
(KiX Supporter)
2006-01-19 06:04 PM
Re: Net Send Scripting.

wah - you saying we dont count as "someone else" ? You getting kinda comfortable on the old board here eh ? ;0)

Arend_
(MM club member)
2006-01-19 06:33 PM
Re: Net Send Scripting.

LOL, well you we're helping me in the first place
Besides, yeah I am gettin kinda comfortable, whenever help is needed there is always someone around to help, you don't find that very often anymore. So to express my gratitude I've cleaned it up, still the Dialog is a simple one

Code:

Break On

$System = CreateObject("Kixforms.System")
If Not $System
$nul= MessageBox("KiXforms.Net Not Initiated. This Script Will Now Close.","Error",16)
Quit()
EndIf
$nul = $System.Application.EnableVisualStyles

GLOBAL $oAutoIT, $sMessengerTitle, $iControlMessage, $log
$sMessengerTitle="Messenger-service"
$iControlMessage=65535

$oAutoIT=CreateObject("AutoItX3.Control")
If @ERROR OR VarType($oAutoIT)<>9
? "Cannot create AutoIT object - no registered perhaps?" + @CRLF
Exit @ERROR
EndIf

; Set some useful options.
$=$oAutoIT.Opt("MouseCoordMode",0)
$=$oAutoIT.Opt("WinTitleMatchMode",4)

; Timer to catch messages
$Timer = $System.Timer
$Timer.Interval = 1000 ;1000ms = 1s
$Timer.Tick = "CatchMSG()" ;the event that fires every second
$Timer.Start

$Form1 = $System.Form()
$Form1.Left = 368
$Form1.StartPosition = 0 ;FormStartPosition_Manual
$Form1.Size = $System.Size(240,358) ;(Width,Height)
$Form1.Text = "LAN Messenger"
$Form1.Top = 0

$Label1 = $System.Label()
$Label1.BorderStyle = 0 ;FixedSingle
$Label1.Left = 24
$Label1.Text = "Gebruiker"
$Label1.TextAlign = 16 ;MiddleLeft
$Label1.Top = 19
$Label1.Width = 55
$nul = $Form1.Controls.Add($Label1)

$ComboBox1 = $System.ComboBox()
$ComboBox1.Height = 21
$ComboBox1.ItemHeight = 13
$ComboBox1.Left = 89
$ComboBox1.Text = "Select..."
$ComboBox1.Top = 20
$nul = $Form1.Controls.Add($ComboBox1)

$RichTextBox1 = $System.RichTextBox()
$RichTextBox1.Height = 171
$RichTextBox1.Left = 13
$RichTextBox1.Text = ""
$RichTextBox1.Top = 68
$RichTextBox1.Width = 209
$nul = $Form1.Controls.Add($RichTextBox1)

$TextBox1 = $System.TextBox()
$TextBox1.Height = 61
$TextBox1.Left = 13
$TextBox1.Text = ""
$TextBox1.Top = 258
$TextBox1.Width = 125
$TextBox1.Multiline = -1
$nul = $Form1.Controls.Add($TextBox1)

$Button1 = $System.Button()
$Button1.Height = 61
$Button1.Left = 152
$Button1.Text = "Send!"
$Button1.Top = 258
$Button1.Width = 70
$Button1.Click = "SendMSG()"
$nul = $Form1.Controls.Add($Button1)

$Form1.Show ;Displays the Form
Init()
While $Form1.Visible
$Nul = Execute($Form1.DoEvents())
Loop
Exit 0

Function SendMSG()
Dim $msg, $rcpt, $x
$msg = $TextBox1.Text
$rcpt = $ComboBox1.Text
If $rcpt = "Select..."
$x = MessageBox("You have to select a user first!","Info",0)
Goto "end"
EndIf
$log = $log + @CRLF + "You said to " + $rcpt + ":" + @CRLF + $msg + @CRLF
$RichTextBox1.Text = $log
shell "%comspec% /c net send $rcpt $msg > nul"
$TextBox1.Text = ""
:end
EndFunction

Function CatchMSG()
Dim $sMessageText, $sFrom, $sTo, $sDate, $sTime
If $oAutoIT.WinExists($sMessengerTitle)
$sMessageText=$oAutoIT.ControlGetText("last","",$iControlMessage)
$=$oAutoIt.WinClose("last")
$sMessageText=split($sMessageText,@CRLF)
$sFrom=Split($sMessageText[0]+" ")[2]
$sTo=Split($sMessageText[0]+" ")[4]
$sDate=Split($sMessageText[0]+" ")[6]
$sTime=Split($sMessageText[0]+" ")[7]+" "+Split($sMessageText[0]+" ")[8]
$sMessageText[0]=""
$sMessageText=SubStr(Join($sMessageText,@CRLF),5)
$log = $log + @CRLF + $sFrom + " says to you:" + @CRLF + $sMessageText + @CRLF
$RichTextBox1.Text = $log
EndIf
EndFunction

Function Init()
Dim $Users, $User
$Users = GetObject("WinNT://@ldomain")
$Users.filter = "User",""
For Each $User In $Users
$x = $ComboBox1.Items.Add($User.Name)
Next
EndFunction