[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 319
  • Last Modified:

How to push out a domain message through vbscript??

i am very familiar with net send and i was wondering if anyone knows how i can make the net send with input boxes??

for example i want to have to input boxes in the script that the user will enter in the username or computer name and then type in the message they want to send and then click ok and it sends the message out.  basically make a gui for net send.

would it be simple input boxes in the script??
0
amoos
Asked:
amoos
  • 3
1 Solution
 
Donald StewartNetwork AdministratorCommented:
This should be what you are asking for :-)


http://www.myitforum.com/articles/11/view.asp?id=12448


strComputer = InputBox("Enter Machine Name")
strMessage = InputBox("Enter Message Text")

Set WSHShell = WScript.CreateObject("WScript.Shell")

strCommand = "Net Send" & Chr(32) & strComputer & Chr(32) & strMessage
objShell.Run StrCommand

0
 
amoosAuthor Commented:
modified it a little and this seems to work fine but i would like to have a from input box to.  do you think that is possible??

Dim arrPCnames()
intSize = 0

Set objShell = Wscript.CreateObject("WScript.Shell")

'Get computer names
PC2Reach = InputBox("Please enter the computer name. For additional computers, separate each with a comma")

'Get message
Message2Send = InputBox("Type your message.", "Send a message")

arrStations = Split(PC2Reach, ",")

'Send message
For Each PC2Reach In arrStations
objShell.Run "net send " & PC2Reach & " " & Message2Send

ReDim Preserve arrPCnames(intSize)
arrPCnames(intSize) = PC2Reach
intSize = intSize + 1

Next

'Summary of command
MsgBox "Here's you message:" & vbCrLf & _
vbCrLf & _
Message2Send & vbCrLf & _
vbCrLf & _
"Computers that got the message:"

For Each strName in arrPCNames
Wscript.Echo strName
Next
0
 
Donald StewartNetwork AdministratorCommented:
Net send messages will always display the "from" by default, send to yourself for example
0
 
Donald StewartNetwork AdministratorCommented:
just a FYI :

The messenger service needs to be running on remote systems for net send to work
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now