Announcement

Collapse
No announcement yet.

login banner

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

  • login banner

    anyone out there ever done a vbs log in banner.

    i'd like to make one with a logo or something alike.

    is that possible?

    thanks

  • #2
    Re: login banner

    What type of logon? Do you mean a windows logon? Do you want pictures in the logon? Why do you want VBS in the logon?
    ** Remember to give credit where credit is due and leave reputation points where appropriate **

    Comment


    • #3
      Re: login banner

      windows login..........

      so when they log in to the domain, they get the POPUP............similar to the login banner which you can apply via group policy .

      i would like to have our company logo on it plus the disclaimer......doesn't have to be vbs, whatever works.

      thanks.

      Comment


      • #4
        Re: login banner

        You can use a *.HTA script to create a "Splash Screen".
        http://www.microsoft.com/technet/scr.../thursday.mspx

        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
           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
           window.location.href="#Top"
           v = sVertical - sHorizontal
           For h = 0 to sHorizontal-1
             v = v + 1
             Window.resizeTo h,v
           Next
           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='#4169E1', EndColorStr='#F0F8FF')
        ">
        
        
        <DIV id="Splash" STYLE="progid:DXImageTransform.Microsoft.dropshadow(OffX=10, OffY=10, 
                Color='gray', Positive='true')">
        <CENTER>
        <br><br>
        A Sample HTA<br>
        The Microsoft Scripting Guys<br><br><br>
        <font size="2">Copyright 2005 Microsoft Corporation. All rights reserved.</font>
        </CENTER>
        </DIV>
        
        </body>
        </html>
        This example splash screen is just an HTML container: you can add pictures, add animation, do whatever you want to spiff it up even more.

        If you want to include objects (like pictures), put all the object in the same directory as the script, and use relative path in the script to the objects.
        Then use WinRAR to create an Advanced SFX file (= self extracting exe-file) of the complete dir. The SFX can extract silently, hidden and autoExecute the .HTA if you select it at "run program after extraction". This way you can create a standalone application, executed via a logonscript.

        \Rems
        Last edited by Rems; 9th March 2009, 22:49.

        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


        • #5
          Re: login banner

          great sample ...thanks for that.

          now i got to work out the last bit.....

          how to have it startup, have an "accept" or "decline" button. and then what to do after the action..

          thanks.

          Comment


          • #6
            Re: login banner

            If you invoke this script by using a logonscript that'll run synchronously (see: http://forums.petri.com/showpost.php...04&postcount=6). The user's Desktop (explorer.exe) then will not be loaded untill the user hits the accept button.
            When the user hits the decline button or when the script timed-out (60 sec), the user will be forced logged off automatically.

            Code:
            <!-- Author: Remco Simons [NL], 21st October 2007
                 forums.petri.com/showthread.php?p=83619#post83619 -->
            
            <html>
            
            <head>
            <title>Logon policy acceptance Screen</title>
            <HTA:APPLICATION
                 ApplicationName="Logon HTA"
                 SingleInstance="Yes"
                 WindowsState="Normal"
                 Scroll="No"
                 SCROLLFLAT="No"
                 Navigable="No"
                 SysMenu="No"
                 Caption="No"
                 Select=˙es"
                 MaximizeButton="No"
                 MinimizeButton="No"
                 BORDER = "thick"
                 INNERBORDER = "yes"
                 SHOWINTASKBAR="No"
                 CONTEXTMENU="No"
                 Icon = "%SystemRoot%\Explorer.exe">
            ></HEAD>
            
            <SCRIPT LANGUAGE="VBScript">
            
              sHorizontal = "500"
              sVertical = "600"
              cnt = 60 'seconds before auto logoff
              Set objWMIService = GetObject _
                 ("winmgmts:root\cimv2")
              set objShell = CreateObject _
                 ("WScript.Shell")
              Set Fso = CreateObject("Scripting.FileSystemObject")
              Set tempfolder = Fso.GetSpecialFolder(2)
              supportingcode = tempfolder & "\" & Fso.GetTempName
            
            Sub Window_OnLoad
              'Size Window
              Window.resizeTo sHorizontal,sVertical
              'Center window
              Set colItems = objWMIService.ExecQuery _
                 ("Select * From Win32_DesktopMonitor",,48)
              For Each objItem In colItems
                sWidth = objItem.ScreenWidth
                sHeight = objItem.ScreenHeight
                If sWidth > intHorizontal _
                  then intHorizontal = sWidth
                If sHeight > intVertical _
                  then intVertical = sHeight
              Next
              intLeft = (intHorizontal - sHorizontal) /2
              intTop = (intVertical - sVertical) /2
              Window.moveTo intLeft, intTop
              'default window content
              window.location.href="#Top"
              'iTimerID = window.setInterval("ShowSplash", 5000)
              iTimerID = window.setInterval("y", 1000, "VBScript")
            End Sub
            
            function y()
               Text1.innerHTML= "Time Left Before auto-Logging Off : " & Cnt
               cnt = cnt - 1
               If cnt < 0 then call logoff
            end function
            
            Sub reloadHTA()
               location.reload True
            End Sub
            
            Sub ShowSplash
               Splash.Style.Display = "None"
            End Sub
            
            Function HTA_Sleep(mSec)
              strRun = supportingcode & ".vbs"
              With Fso.OpenTextFile(strRun, 2, true)
                .WriteLine "On Error Resume Next"
                .WriteLine "Wscript.sleep wScript.Arguments(0)"
                .close
                strCommand = "cscript.exe //NoLogo " & strRun & " " & mSec
                objShell.run(strCommand), 0, True
                Fso.DeleteFile(strRun)
              End With
            End Function
            
            '-------------------------------------------------------------------
            Sub DeclineScript( oBtt )
               sAction = "LogOff"
               oBtt.style.color            = "white"
               oBtt.style.backgroundcolor  = "red"
               oBtt.style.fontstyle        = "italic"
               call logoff
            End Sub
            
            Sub logoff
              If Not sAction = "LogOn" Then
                session = objShell.ExpandEnvironmentStrings("%sessionname%")
                If UCase(session) = UCase("Console") Then session = Empty
                strCommand = "logoff.exe " & session
                objShell.Run(strCommand),0 ,True
                Cleanup
              End If
            End Sub
            
            Sub AcceptScript( oBtt )
               sAction = "LogOn"
               oBtt.style.color            = "white"
               oBtt.style.backgroundcolor  = "green"
               oBtt.style.fontstyle        = "italic"
               HTA_Sleep(100)
               'run vbScript from within this script:
               ' strVBS = "\\server\share\folder\file.vbs"
               ' objShell.run("cscript.exe //NoLogo " & strVBS), 0, True
               Cleanup
            End Sub
            
            Sub Cleanup
               Set objWMIService = Nothing
               set objShell = Nothing
               Set Fso = Nothing
               Set tempfolder = Nothing
               Self.Close()
            End Sub
            
            </SCRIPT>
            
            <!-- TABLE STYLE NORMAL--> 
              <STYLE type="text/css">  
                Table.Normal
                { 
                  font: 8.25pt Verdana;
                  color:#000080;
                  font-weight:bold;
                  filter:progid:DXImageTransform.Microsoft.Gradient
                  (GradientType=0,StartColorStr='#E9E9E9',EndColorStr='#9E9E9E');
                  padding-top:1;
                  padding-bottom:1;
                  Text-Align:;
                  vertical-align:;
                }
              </STYLE>
              
            <!-- TD STYLE MENUNORMAL -->
              <STYLE type="text/css">  
                TD.MenuNormal
                { 
                  font: 8.25pt Verdana;
                  color:#000080;
                  font-weight:bold;
                  filter:progid:DXImageTransform.Microsoft.Gradient
                  (GradientType=0,StartColorStr='#eeeeee',EndColorStr='#5e9ab9');
                  padding-top:1;
                  padding-bottom:1;
                  Text-Align:;
                  vertical-align:;
                  cursor:Hand;
                }
              </STYLE>
            
            <!-- BODY STYLE NORMAL--> 
              <STYLE type="text/css">  
                Body.Normal
                { 
                  font: 10.25pt Verdana;
                  color:#000080;
                  font-weight:bold;
                  filter:progid:DXImageTransform.Microsoft.Gradient
                  (GradientType=0,StartColorStr='#86cceb',endColorStr='#5589ab');
                  padding-top:1;
                  padding-bottom:1;
                  Text-Align:;
                }
              </STYLE>
            
            
            <Body Class='Normal'>
            <Center>
            <Table Class=Normal Width='270' height='30'>
                <TD Class=MenuNormal onClick="reloadHTA()">
                 &nbsp;&nbsp;<Span ID="Text1">Countdown
            </Span></TD></Table>
            
            
            <DIV id="Splash" STYLE="Height:200;Width:400;Border:0.1mm solid black;
             font:14pt arial;
             filter:progid:DXImageTransform.Microsoft.Gradient
            (GradientType=0, StartColorStr='#5589ab', EndColorStr='#86cceb')
            progid:DXImageTransform.Microsoft.dropshadow(OffX=10, OffY=10, 
                    Color='gray', Positive='true')">
            <br>
            A Sample HTA<br>
            The Microsoft Scripting Guys<br><br>
            <font size="2">Copyright 2005 Microsoft Corporation. All rights reserved.</font>
            <br></CENTER><br><br>
            <ul>
              <li>ewgsh hhxd rv hv dbvl edr hwef<br>
              ssv vdrjsrvjeje jeyjv</li>
              <li>rth rgb ughbh ht jh 456 brjtj</li>
              <li>tjt fgcy byj bbby v a ryhu</li>
              <li>itui gb gj 777</li>
              <li>tuktu hfetygjf gg ryjgyjgrthggyj 8</li>
              <li>ewgsh hhxd rv hv dbvl edr hwef</li>
              <li>rth rgb ughbh ht jh 456 brjtj</li>
              <li>tjt fgcy byj bbby v a ryhu</li>
              <li>itui gb gj 777</li>
              <li>tuktu hfetygjf gg ryjgyjgrthggyj 8</li>
              <li>rgdv</li>
            </ul><br>
            </DIV>
            
            <center><br><br>
            <Input type="button" value="   Accept   " onClick="AcceptScript Me"> &nbsp;
            <Input type="button" value="  Decline  "   onClick="DeclineScript Me">
            </center>
            </body>
            </html>

            [EDIT]
            Read here how to run this script on a 64-bit client OS
            (http://forums.petri.com/showthread.php?t=64421)



            \Rems
            Last edited by Rems; 19th September 2013, 11:50.

            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


            • #7
              Re: login banner

              rems that is absolutely awesome...

              now I have to add the contents of the map drives vbs script i have to the sub Cleanup section yeh?...or can i even point it to another .vbs file..that would probably be easier i think.

              thanks a million.

              Comment


              • #8
                Re: login banner

                Originally posted by dublin_101 View Post
                rems that is absolutely awesome...

                now I have to add the contents of the map drives vbs script i have to the sub Cleanup section yeh?...or can i even point it to another .vbs file..that would probably be easier i think.

                thanks a million.
                I edited my previous sample script a bit,

                Now in the subroutine "AcceptScript" you can see how to start a vbscript from within this HTA script.
                It is possible to start your logonscript this way,
                but you can also (better) keep starting the logonscript from your GPO (If you have more than one GPO starting logonscripts, change the order of the GPO processing). If you have more than one logonScript started from the same GPO, you can change the order of processing the scripts by editing a ini-file in the SysvolFolder...
                in:
                ...\SYSVOL\domain\Policies\\Policies\{Policy-GUID}\User\Scripts
                (where {Policy-GUID} is the id for the GPO, is the defauld path when you add a new logon/off script). Look in that hidden folder for the file "scripts.ini". In this file you can re-number the lines (be very carefull here not to mixup the line pairs nCmdLine and nParameters and count the items right). Making changes in the sysvolfolder is at your own risk.

                \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


                • #9
                  Re: login banner

                  Sub AcceptScript( oBtt )
                  sAction = "LogOn"
                  oBtt.style.color = "white"
                  oBtt.style.backgroundcolor = "green"
                  oBtt.style.fontstyle = "italic"
                  HTA_Sleep(100)
                  'run vbScript from within this script:
                  strVBS = "\\server\share\folder\file.vbs" <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                  objShell.run("cscript.exe //NoLogo " & strVBS), 0, True
                  Cleanup
                  End Sub


                  so the AcceptScript can in fact point to any other script right?....just point is as above where i have marked it with the <<<

                  thanks Rems..

                  Comment

                  Working...
                  X