Re: Using NET SEND for a pop-up box



I'm not surprised. NET SEND doesn't use DNS and at the time of login only
DNS can be known to be stable ... so ...

Why not use a batch file and some ECHO commands instead?

@echo off
echo "This is an important message!"
echo "If you read it you will know why"
pause

This batch/CMD file displays text in a window and waits for the user to
press a key to continue.

--
Richard G. Harper [MVP Shell/User] rgharper@xxxxxxxxx
* NEW! Catch my blog ... http://msmvps.com/blogs/rgharper/
* PLEASE post all messages and replies in the newsgroups
* The Website - http://rgharper.mvps.org/
* HELP us help YOU ... http://www.dts-l.org/goodpost.htm


"Neko-" <neko-@xxxxxxxxx> wrote in message
news:1170164772.682177.255150@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On a request of one of our HR users I've been asked to investigate the
possibility to show a pop-up box during the loginscript to alert users
to certain important messages. Our environment exists primarily of a
Windows 2000/2003 AD, with the workstations being active under Windows
2000 SP4.

I've done a bit of testing and found that NET SEND <username>
"message" would suit our needs best. The loginscript has therefore
been appended with the following (broken up in 3 parts):

Net use L: \\server\netlogon
L:
CD\files
Sc.exe config "messenger" start= auto

C:
Net start messenger
Net use L: /delete

Net send %username% "A notification goes here"

The first part is using the SC command Microsoft released to make sure
the 'Messenger Service' is set to automatically start. This incase
it's disabled through some means.

The second part initiates the acual starting of the 'Messenger
Service' incase this has not yet been started. If it has, it'll
generate an error, but overall nothing to worry about.

The last bit uses the %username% variable (which contains the username
of the user) to initiate the command to send a message to the locally
logged on user.

Now running this batchfile manually on any PC results in it doing
exactly what we expect it to do. The user receives a pop-up box with
the notice just as requested. When running this from the loginscript
however, it fails.

The last command is filled in with the correct username (this has been
verified by pausing the script and checking the actual command
syntaxes given), and then returns an error:

An error occurred while sending a message to <username>.
The message alias could not be found on the network.
More help is available by typing NET HELPMSG 2273.

What I have found is that this means the username is not yet known on
the network, eventho the user has just logged in and authenticated.
More mind-boggeling is the fact that after logging in (and the failure
exhibiting itself) and then running a manual session of the same login-
script results in it doing exactly what we would expect it to do,
namely pop-up the box.

Anyone have any thoughts on this?

Thanks in advance,
J. van Doornik



.



Relevant Pages

  • Re: call procedure vbscrip in page html
    ... In prompt of command I use echo %username% to return the name from the ...
    (microsoft.public.scripting.vbscript)
  • Re: Query for blank passwords in Active Directory
    ... Depending on your Domain Controllers configuration, it may be extremely easy to enumerate users, even without having credentials for accessing the AD domain. ... If rpcclient's "enumusers" command doesn't work, it may still be possible to get the users list scanning for SIDs. ... If you're stuck on Windows as testing plaform, you should also take a look at enum.exe. ... username as well as username = password). ...
    (Pen-Test)
  • Re: Connect to VPN from command line?
    ... Yes, and again from my original question, how can I make the call ... WITHOUT embedding username and password in the command line? ... Windows Explorer can launch a network connection using saved ...
    (microsoft.public.windowsxp.general)
  • Re: Problem Restated: OPA0 on DS10L
    ... %REM-I-TOQUIT, connection established ... Username: Username: R\ ... Too many parameters - reenter command with fewer parameters ... I.E. did SET HOST/DTE just dump the data already in the typeahead buffer ...
    (comp.os.vms)
  • Re: Dialup -tabla rasa
    ... >> Below are the edited settings. ... This time the modem came up as ttyS4. ... I opened a terminal and entered the command ... I logged out, and then tried to log in, entering Su_- at Username ...
    (Fedora)