Batch "msg" works across a domain?

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Callum_Dawson

Thread Starter
Joined
Mar 9, 2009
Messages
560
I've made a notice script for my domain, so if needs be, I can send a message to a certain user(s). But when testing, it only works for local users, it won't work across the domain. Is there any option for "msg" or method to make it work on other computers (even if I must input the computer name). The very simple script is below;

Code:
@echo off
echo -------------------------------
echo ------Domain Notice Tool-------
echo -------------------------------
set /p user=Username: 
set /p message=Message: 
msg %user% /v /w %message%
pause
 

Squashman

Retired Trusted Advisor
Joined
Apr 4, 2003
Messages
19,786
Have yet to play around with msg.exe but it looks like you need to use the server name they are logged on to.
 

Callum_Dawson

Thread Starter
Joined
Mar 9, 2009
Messages
560
I added "set /p c=Computer: " and "/SERVER:%c%" to the script, but it just says "Error 5 getting session names." Now I've just tried it from the client to the server and it works perfectly. So why can't the server send messeges to the client(s)?
 

Callum_Dawson

Thread Starter
Joined
Mar 9, 2009
Messages
560
I looked into PsExec, it's exactly what I need, just it doesn't function correctly... I remotely executed a batch script where it asks for the message, it executed, exept the variable only saved the first character I entered.
 
Joined
Aug 7, 2007
Messages
9,028
On the clients you have to make a registry change to allow the incoming connection:

Click Start | Run (or press WinKey+R), type regedit, press Enter
Navigate to here:
Code:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server
Change the AllowRemoteRPC item from 0 to 1 (If not present, add it)
You'll have to reboot for it to take effect.

You can use this .reg file in a logon script:
Code:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server]
"AllowRemoteRPC"=dword:00000001
It may not take effect until the next boot though
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top