Announcement

Collapse
No announcement yet.

Welcome pop-up after login

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Welcome pop-up after login

    Hi,

    How to make welcome message pop-up that contain user name, name of user login, etc after user login.

    Thanks

  • #2
    Re: Welcome pop-up after login

    Originally posted by echo_rc View Post
    welcome message pop-up that contain user name, name of user login, etc after user login.
    Use a logon script. Launch a separate program or use scripting. There are many ways.

    The simplest solution would be like this:

    for /f "tokens=2*" %%a in ('net user "%username%" /domain ^| find /i "full name"') do set displayname=%%d
    echo %username% %displayname%

    -vP

    Comment


    • #3
      Re: Welcome pop-up after login

      Save the sample code below with the extension HTA.
      However it is not possible to configure a hta-file as GPO script, you can launch the HTA from within a batch or vbscript.
      Or,, you can use one of the autoruns paths - i.e. create a entry in one of the 'run' or 'runonce' keys in the registry to execute the HTA (a startupscript or a logonscript can create the autorun entry for you).
      Code:
      <html>
      
      <head>
      <title>Simple Splash Screen</title>
      <HTA:APPLICATION
           ApplicationName="Logon Splash Screen.HTA"
           SingleInstance="Yes"
           WindowsState="Normal"
           Scroll="No"
           SCROLLFLAT="No"
           Navigable="No"
           MaximizeButton="No"
           SysMenu="No"
           Caption="No"
           SHOWINTASKBAR="No"
           CONTEXTMENU="No"
      ></HEAD>
      
      <SCRIPT LANGUAGE="VBScript">
      
        Sub Window_OnLoad
        On Error Resume Next
         Window.resizeTo 0,0
         sHorizontal = 370
         sVertical = 195
         Set objWMIService = GetObject _
           ("winmgmts:\\.\root\cimv2")
         Set colItems = objWMIService.ExecQuery _
           ("Select * From Win32_DesktopMonitor",,48)
         '# Size Window
         For Each objItem In colItems
           sWidth = objItem.ScreenWidth
           sHeight = objItem.ScreenHeight
           If sWidth > intHorizontal _
             then intHorizontal = sWidth
           If sHeight > intVertical _
             then intVertical = sHeight
         Next
         '# Center window
         intLeft = (intHorizontal - sHorizontal) /2
         intTop = (intVertical - sVertical) /2
         Window.moveTo intLeft, intTop
         '# Default window content
         Set oNetwork = CreateObject("WScript.Network")
         DataArea1.InnerHTML = oNetwork.UserDomain
         DataArea2.InnerHTML = oNetwork.UserName
         v = sVertical - sHorizontal
         For h = 0 to sHorizontal -1
           v = v + 1
           Window.resizeTo h,v
         Next
         If err.number >0 Then Self.Close()
         iTimerID = window.setInterval("ShowSplash", 5000)
        End Sub
      
        Sub ShowSplash
         Splash.Style.Display = "None"
         Self.Close()
        End Sub
      
      </SCRIPT>
      
      <BODY STYLE="font:14 pt arial; filter:progid:DXImageTransform.Microsoft.Gradient
      (GradientType=0,StartColorStr='#E9E9E9',EndColorStr='#9E9E9E')
      ">
      <DIV id="Splash" STYLE="progid:DXImageTransform.Microsoft.dropshadow(OffX=10, OffY=10, 
              Color='gray', Positive='true')">
      <CENTER>
      <br><br>
      Welcome <span id=DataArea2></span><br>
      <br>
      <font size="2">you are logged on to <span id=DataArea1></span></font>
      </CENTER>
      </DIV>
      
      </body>
      </html>
      To test the HTA just dubbleklick on the saved file.
      And this is how you can execute a hta-application via a command-line:
      mshta.exe "path\scriptfolder\logonmessage.hta"

      Instead of CreateObject("WScript.Network") in the sample above you couls also create an instance of the object "ADSystemInfo". With that object you can get the distinguished name of the logged-on domainuser. Then adjust the code a little bit. Use the LDAP provider to bind to the userobject in the Active Directory by using its DN (the LDAP provider uses the dn in the ADsPath).
      Now you are able to get any value of that user's account attributes you that like to show in the popup.
      sample: http://www.microsoft.com/technet/scr...5/hey1103.mspx


      related thread:
      http://forums.petri.com/showthread.php?t=19065


      \Rems

      This posting is provided "AS IS" with no warranties, and confers no rights.

      __________________

      ** Remember to give credit where credit's due **
      and leave Reputation Points for meaningful posts

      Comment

      Working...
      X