Announcement

Collapse
No announcement yet.

User Acceptance Policy

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

  • User Acceptance Policy

    Hi All,

    I found the following ".hta" script and would love to implement it as a working GPO with only a few minor changes.

    thread # 19065 "login banner"


    The script is saved as an .hta file and is invoked by a -cmd file as a user logon GPO on Server 2012. The message appears when the user logs on. The problem I'm having is that the decline button fails to execute the log off command. I have enabled "Run logon scripts synchronously", I'm now testing this script on a local desktop trying to get the decline button to execute the logoff command. I have discovered that when using the run command and pointing to the -cmd file that launches the .hta it all works fine, and logs the user off the desktop!!!!


    I have tried to execute the script from a -cmd file in a GPO but still the decline button does not work. I know this script works and I must be missing something within the logon process, but I'm puzzled as to what it is.

    Would appreciate some assistance as I'm new to all of this.

    Thanks
    Last edited by bailes; 15th September 2013, 13:34. Reason: fixed the internal url with [THREAD]-tags

  • #2
    Re: User Acceptance Policy

    Is the auto-logoff after 60 seconds (see the count downbar on top of the window) able to logoff the user?


    /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


    • #3
      Re: User Acceptance Policy

      Hi REM ,

      The 60 second auto logoff also doesn't work.
      The dialogue box closes but the user is still logged on.

      Comment


      • #4
        Re: User Acceptance Policy

        What happens if you execute the HTA directly on the server rather than run it via a cmd prompt?

        Comment


        • #5
          Re: User Acceptance Policy

          Hi Wullieb,

          I have found that executing either -hta or invoking it by -cmd file appears not to work from the server. Either way the hta file runs but the "decline" button fails to logoff the user.


          Placing a folder on a local desktop and running the -cmd file to execute the .hta file works.
          I'm trying to implement the banner from a GPO on server 2012 to Windows 8 pro machines.
          Last edited by bailes; 17th September 2013, 13:18.

          Comment


          • #6
            Re: User Acceptance Policy

            I'm executing a simple command file called "policy" locally to invoke the .hta which works successfully.

            "mshta.exe "C:\script\userpolicy.hta""


            The command script via GPO is the same except for the path to the cmd file
            "\\FQDN\sysvol\domain\scripts\policy.cmd"

            Comment


            • #7
              Re: User Acceptance Policy

              Originally posted by bailes View Post
              Originally posted by bailes View Post
              [...]
              Placing a folder on a local desktop and running the -cmd file to execute the .hta file works.
              I'm trying to implement the banner from a GPO on server 2012 to Windows 8 pro machines.
              I'm executing a simple command file called "policy" locally to invoke the .hta which works successfully.

              "mshta.exe "C:\script\userpolicy.hta""


              The command script via GPO is the same except for the path to the cmd file
              "\\FQDN\sysvol\domain\scripts\policy.cmd"


              Glad you got it sorted.
              Thanks for sharing the solution with us.

              It is not really nessesary to use a separate launcher batch file though to invoke the .hta,
              you can also enter %windir%\system32\mshta.exe in the GPO as the script, and enter the path to the hta file between quotes as script parameter.



              I found out the problem with the Decline button (actually the logoff.exe command) is not whether the script is supported by Windows server 2012 or Windows 8 pro but it has to do with the 64-bit OS and its sysWOW64 programs.
              By default the file association for hta on a 64-bit machine is the mshta.exe from the sysWOW64 folder, and not the 64-bit version in the system32 folder. So the script's environment is adapted to sysWOW64 (=32-bit).

              By launching the hta file from a 64-bit command prompt (opening cmd.exe from the system32 folder and call the hta file from there, like you succesfully tried earlier) the command logon.exe will execute succesfully.
              Also when launching the hta file from a command line with mshta.exe in it from the system32 folder will start the 64-bit version of mshta.exe and the command logon.exe will execute succesfully.
              Why logoff.exe in the script does not run in a 32-bit environment on a 64-bit client is simply because there is no logoff.exe file existing in the sysWOW64 folder (on a server OS there is but not on a client OS).


              to make the script run without unexpected problems in any 64-bit Windows environment (i.e. also on a terminal server) I had to change the logoff sub routine a bit.
              The subroutine should be changed to:
              Code:
              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
              Hope you like the forums and spend more time here.

              /Rems
              Last edited by Rems; 19th September 2013, 12:12.

              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


              • #8
                Re: User Acceptance Policy

                Hi Rem,

                Thank you so much for your help on this.

                Comment

                Working...
                X