Popup menu when logging to a server


I have win 2000 and win 2003 servers in my domain.What i want is when a user tries to login to the machine trough Mstsc or Console a box has to popup and say some warnings before logging.I already have a GPO running which pops with the network related warnings.But i want to specify machine related data as who the owner is what is the contact no etc.

How can i do this.

LVL 11
Who is Participating?
Yes, this script would be a VBS file.
To present information to the user, you will need to build a HTML page for the script to call.
Where the script says:
.navigate "C:\temp\test.html"

create an empty html file for that, because that is not used to display info.
Then where the script says:
.showModalDialog "C:\temp\test.html"

that is page that you will build to include the information.  Also, I forgot to put
at the end, which is required to close the first page (that is not visible).

What I suggest you do is build the page with the information, and include two buttons: "Accept" and "Decline".

Then, in the code for the Accept button, just close the dialog window, and the user can continue working.  In the code for the Decline button, close the form, then invoke a VBS procedure that closes the page, and runs the "logoff" command to force them to log off again.

<Script Language='vbs'>
Sub Decline_Logoff
   Set objShell = CreateObject("WScript.Shell")
   objShell.Run "logoff", 1, False
End Sub


as far as i know this is not possible. You could try environment variables like %username% but this will not work. The box pops up when you hit CTRL+ALT+DELETE so that is prior to login procedure. It can not read user vars as it simply doesnt know. Microsoft has tied GPO that much that there are also no 3rd party apps to make this happen.
What you could do is make an option in your login script using one of many options (VB recommended) and use that to pop up the box after login. You can push the login script over GPO.
Razwer is right.
You would only be able to acheive such a thing after login, once you can access the environment variables.  You might be able to launch a script that could log the user off again, but it would be tricky to stop them doing anything while that script is running.  You would have to make some sort of modal dialog, in which case you could try:
Set IE = CreateObject("InternetExplorer.Application")
With IE
        .navigate "C:\temp\test.html"
End With

'wait a while until IE as finished to load
Do while IE.busy

IE.Document.Script.showModalDialog "C:\temp\test.html",,"dialogHeight:1024;dialogLeft:0;dialogTop:0;dialogWidth:768;resizable:no"


Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

bsharathAuthor Commented:

Where should i put this script?
You would have to make sure that it does what you want first, and it's only a really basic idea showing a ModalDialogBox.  It does not provide any functionality as yet.

You would put this in an ordinary logon script, but probably assigned to only your Terminal Servers.


bsharathAuthor Commented:
Will not the GPO over ride the local logon script?
Can you give me the exact path to put this.
No, it wouldn't override any existing login script that runs when people log onto the TS.
You could either create a new GPO and assign it to an OU that has your Terminal Servers in it, but you may have other computers in that OU that you don't want this to apply to.
Therefore, one of the easier to implement, but hard to manage in future (unless you keep good documentation), would be to just place a shortcut to the script in the Documents and Settings\All Users\Start Menu\Programs\StartUp folder.


bsharathAuthor Commented:
Ok i shall save it in the given location.What is the file ext i need to save this script .vbs?
Where can i put in my data
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.