We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

How to push out a domain message through vbscript??

amoos
amoos asked
on
Medium Priority
330 Views
Last Modified: 2012-05-06
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??
Comment
Watch Question

Network Administrator
CERTIFIED EXPERT
Commented:
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

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

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
DonNetwork Administrator
CERTIFIED EXPERT

Commented:
Net send messages will always display the "from" by default, send to yourself for example
DonNetwork Administrator
CERTIFIED EXPERT

Commented:
just a FYI :

The messenger service needs to be running on remote systems for net send to work
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.