• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 283
  • Last Modified:

Popup menu when logging to a server

Hi,

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.

regards
Sharath
0
bsharath
Asked:
bsharath
  • 4
  • 3
1 Solution
 
RazwerCommented:
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.
0
 
RobSampsonCommented:
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
        .left=200
        .top=200
        .height=400
        .width=400
        .menubar=0
        .toolbar=1  
        .statusBar=0
        .navigate "C:\temp\test.html"
        .visible=0
End With

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

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

Regards,

Rob.
0
 
bsharathAuthor Commented:
RobSampson

Where should i put this script?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
RobSampsonCommented:
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.

Regards,

Rob.
0
 
bsharathAuthor Commented:
Will not the GPO over ride the local logon script?
Can you give me the exact path to put this.
0
 
RobSampsonCommented:
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.

Regards,

Rob.
0
 
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
0
 
RobSampsonCommented:
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
IE.Quit
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
   Document.Close
   Set objShell = CreateObject("WScript.Shell")
   objShell.Run "logoff", 1, False
End Sub
</script>

Regards,

Rob.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

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