Page 1 of 1 1
Topic Options
#121672 - 2004-06-22 08:14 PM Need to send a message to groups in NT Domain
Rdestito Offline
Lurker

Registered: 2004-06-22
Posts: 3
Hello all,
I need to send network messages to the users in a given NT 4 Domain group.
Example: send a "Attention - New MKT campaign" to all users in the DEP_MKT global group .

The piece of code bellow, does exactly that . But I got a problem.... If a user (from that group) is not logged in, the sendmessage function get stucked and the remainning users receive nothing .

Well, thought about 2 options :
a) A function that would return me if a given user is currently logged in
b) A timeout function that would abort sendmessage execution

Any idea ?

Rds

Rogerio

Function Groupmembers($target, $group, optional $flag)

$group = getobject("WinNT://$target/$group")

for each $member in $group.members
$nome = $member.name
? $nome
sleep 1
$ReturnCode = sendmessage($nome,"teste de envio para grupos")
? $ReturnCode
next


endfunction

;----------------------------------

break on



$members = groupmembers("Brazil","DEP_MKT",2)

Top
#121673 - 2004-06-22 08:47 PM Re: Need to send a message to groups in NT Domain
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL


for each $user in $group.members
$nome = $member.name
run 'cmd /c net send '+$nome+' teste de envio para grupos'
next
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#121674 - 2004-06-22 09:32 PM Re: Need to send a message to groups in NT Domain
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Wouldnt it be..

for each $user in $group.members
$nome = $user.name
run 'cmd /c net send '+$nome+' teste de envio para grupos'
next

Top
#121675 - 2004-06-22 09:59 PM Re: Need to send a message to groups in NT Domain
Rdestito Offline
Lurker

Registered: 2004-06-22
Posts: 3
Thanks for you both ... the script ran fine but I got another question ....
Since the user is going to provide the group name, I must prompt him for this information... I am using the GETS for that but this is a very "basic" interface .
Is there a command or function like MessageBox (graphic) to input data from the user and store that in a VAR ?

Thanks again
Rogerio

Top
#121676 - 2004-06-22 10:32 PM Re: Need to send a message to groups in NT Domain
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
XLSInputBox() UDF
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#121677 - 2004-06-22 10:39 PM Re: Need to send a message to groups in NT Domain
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
One could also really go to town and build a KiXform based on Chris' KiXforms - Active Directory Browser if only it was AD and not NT.

Edited by Les (2004-06-22 10:40 PM)
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#121678 - 2004-06-22 11:38 PM Re: Need to send a message to groups in NT Domain
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
search here for kixnetmessenger
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Henriques) and 2516 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.213 seconds in which 0.18 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org