Announcement

Collapse
No announcement yet.

Logonscript not running for Windows 7

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

  • Logonscript not running for Windows 7

    Hello! I am reasonably unsure on where to put this entry into your excellent forum. Feel free to move it anywhere you might feel like.

    In my organisation we have always prided ourselves in having Windows XP. In the end, the changed has forced our hand, and we have decided to enter the scary world of Windows 7.

    We have a wds-server which we "tank" up the computers, all primed for the wonderful world of Windows 7.

    Problem is that our wonderful logonscript is not running on our windows 7 computers. It's based on kix and bat-files.

    Any good advice from the digital audience today?

    THanks in advance!

    Snugg

  • #2
    Re: Logonscript not running for Windows 7

    What do you mean with not running?

    It doesn't start? It gives errors? Is it a script in the startup folder? Is it a policy?
    A little more information might help

    Comment


    • #3
      Re: Logonscript not running for Windows 7

      Could you give us a teeny clue as to the contents of the login script and especially what errors are being generated?
      If you run the script manually, does it work?
      What permissions does the logon account have ?-- Win7 is a LOT more restrictive than XP
      Tom Jones
      MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
      PhD, MSc, FIAP, MIITT
      IT Trainer / Consultant
      Ossian Ltd
      Scotland

      ** Remember to give credit where credit is due and leave reputation points where appropriate **

      Comment


      • #4
        Re: Logonscript not running for Windows 7

        Originally posted by Ossian View Post
        Could you give us a teeny clue as to the contents of the login script and especially what errors are being generated?
        If you run the script manually, does it work?
        What permissions does the logon account have ?-- Win7 is a LOT more restrictive than XP
        Hi there!

        A teeny clue on the contents would be:

        - a .bat-file that calls on the kix logonscript.

        all directories for different groups
        if Ingroup ("domain\m_school")
        use F: "\\server\users\%username%"
        endif

        If Ingroup ("domain\p_school")
        addprinterconnection"\\domain\nameprinter")
        endif

        And some installation batch-files that goes like:

        ;Install application
        If Ingroup ("domain\63_appusers")
        SHELL '%comspec% /e:1024 /c "\\domain\logonscript\appusers.bat'
        endif

        That's it really. It calls on batch-scripts that install the different applications, maps directories and printers.

        THE LOGONSCRIPT DOES NOT RUN AT ALL.

        Sorry about the caps lock, I thought I might emphasize the fact that the logonscript does not run at all on my Windows 7 computers. Quite annoying tbh.

        Comment


        • #5
          Re: Logonscript not running for Windows 7

          Can a solution be to upgrade kix32 to a newer version?

          howtodoit?

          Comment


          • #6
            Re: Logonscript not running for Windows 7

            have you joined computers to the domain ? (well, I dunno, you didn't say,l so maybe you havent!!)

            SEcondly,

            edit your "a.bat" file.
            Add, at th very top, before the kix script, the following:

            echo "Wait here please"
            pause


            Now log on to the computer, and see if the script runs.
            Please do show your appreciation to those who assist you by leaving Rep Point https://www.petri.com/forums/core/im.../icon_beer.gif

            Comment


            • #7
              Re: Logonscript not running for Windows 7

              Have you tested with administrator and normal user?
              Have you tried to put notepad.exe in same the GPO that launches the logon.bat?
              Have you tried to start the script by \\domainname\netlogon\logon.bat
              gerth

              MCITP sa, ea & va, [email protected]

              Comment


              • #8
                Re: Logonscript not running for Windows 7

                First of all, make sure you have upgraded all Win7 machines to SP1. because the hotfix kb976494 is included in SP1,
                (here is the complete list of Security updates and Hotfixes included in Windows 7 and Windows Server 2008 R2 SP1)



                Originally posted by mr_snuggles View Post

                a .bat-file that calls on the kix logonscript.
                THE LOGONSCRIPT DOES NOT RUN AT ALL.

                Sorry about the caps lock, I thought I might emphasize the fact that the logonscript does not run at all on my Windows 7 computers.
                Still not sure what is not running - is it the "a .bat-file that calls on the kix logonscript" that not runs (this is in fact the logonscript) or do you meant the batch(es) invoked by KIX do not run (these batches and the kix32.exe are all just secundary processes of the logonscript because they are invoked by and live under the real logon script, and.. when logon scripts are configured running synchronously the subprocesses will be killed when the actual logonscript ends).

                So you are running a batch that launches KIXtart. And KIXtart on his turn, is calling other batch(es).
                (seems a bit unnecessary complicated for a logon script, if you'd asked me)



                Like gerth also asked, are you testing the script with a user account that is a member of the local Administrators group? Is UserAccountControl enabled on the Win7 clients?

                What path is used to run the logon batch? And on what path is the KIX executable located, and the kix-code?. You might have to add the location to the Trusted zone.

                Make sure there is no zone information set on the kix executable file what might blocking it from running.

                How is the policy "Run logon scripts Synchronously" configured for the machines/users? disable it. note This policy appears in the Computer Configuration and User Configuration folders. The policy set in Computer Configuration takes precedence over the policy set in User Configuration.
                Consider to enable the policy "Always wait for the network at startup and logon".


                Test the logon batch when logged-in as regular user. By starting the batch manually after logon.
                Does the batch run, and did it run successfully?

                Now edit your logon script a little for testing purpose, (keep it the same name and location as the original script!)
                Code:
                @echo off & cls
                Set "scriptpath=%~0\.."
                
                call:MyBatch >"%temp%.\logonscript.log" 2>&1
                goto:EOF
                
                :MyBatch
                echo.Logon Script Started at %time%
                
                :: assuming the kix-executable and code-file are in the same folder as the logon script.
                start ""/b /w "%scriptpath%\KIX32.exe" "%scriptpath%\yourFile.KIX"
                
                echo.Script Ended at %time%
                exit /b 0
                Also configure the two policies as I mentioned earlier (then run GPupdate /force and reboot the computer).
                Logon again as regular user - the logonscript will automatically run.
                After a few minutes open the file "logonscript.log" that is in your %temp% folder with notepad.

                /Rems
                Last edited by Rems; 9th May 2011, 13:54.

                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: Logonscript not running for Windows 7

                  Originally posted by tehcamel View Post
                  have you joined computers to the domain ? (well, I dunno, you didn't say,l so maybe you havent!!)

                  SEcondly,

                  edit your "a.bat" file.
                  Add, at th very top, before the kix script, the following:
                  echo "Wait here please"
                  pause
                  Now log on to the computer, and see if the script runs.
                  the logon_business.bat does not run, when I add at the very top.

                  The computers gets joined to the domain by the almighty waik.

                  Comment


                  • #10
                    Re: Logonscript not running for Windows 7

                    Originally posted by Rems View Post
                    First of all, make sure you have upgraded all Win7 machines to SP1. because the hotfix kb976494 is included in SP1, (here is the complete list of Security updates and Hotfixes included in Windows 7 and Windows Server 2008 R2 SP1)

                    Still not sure what is not running - is it the "a .bat-file that calls on the kix logonscript" that not runs (this is in fact the logonscript) or do you meant the batch(es) invoked by KIX do not run (these batches and the kix32.exe are all just secundary processes of the logonscript because they are invoked by and live under the real logon script, and.. when logon scripts are configured running synchronously the subprocesses will be killed when the actual logonscript ends).
                    logon_company.bat is supposed to be running -> calling on logon_company.kix. This script is again supposed to be calling for different bat-files depending of which part of the company the different users belong to, and which applications, directories and printers they are supposed to have.

                    Originally posted by Rems View Post
                    Like gerth also asked, are you testing the script with a user account that is a member of the local Administrators group? Is UserAccountControl enabled on the Win7 clients?
                    I have added a users as a member of the local administrators group, without it helping at all.

                    I have tried turning off UAC, without it giving me anything.

                    Originally posted by Rems View Post
                    What path is used to run the logon batch? And on what path is the KIX executable located, and the kix-code?. You might have to add the location to the Trusted zone.
                    the path to the logon-script is e:\logonscript or \\localhost\logonscript\logon_company.bat and KIX is a subdirectory of this.

                    Originally posted by Rems View Post
                    Make sure there is no zone information set on the kix executable file what might blocking it from running.
                    How do I do this?

                    Originally posted by Rems View Post
                    How is the policy "Run logon scripts Synchronously" configured for the machines/users? disable it.
                    This is neither disabled or enabled in the GP.

                    note This policy appears in the Computer Configuration and User Configuration folders. The policy set in Computer Configuration takes precedence over the policy set in User Configuration.
                    Consider to enable the policy "Always wait for the network at startup and logon".


                    Test the logon batch when logged-in as regular user. By starting the batch manually after logon.
                    Does the batch run, and did it run successfully?

                    Now edit your logon script a little for testing purpose, (keep it the same name and location as the original script!)
                    Code:
                    @echo off & cls
                    Set "scriptpath=%~0\.."
                    
                    call:MyBatch >"%temp%.\logonscript.log" 2>&1
                    goto:EOF
                    
                    :MyBatch
                    echo.Logon Script Started at %time%
                    
                    :: assuming the kix-executable and code-file are in the same folder as the logon script.
                    start ""/b /w "%scriptpath%\KIX32.exe" "%scriptpath%\yourFile.KIX"
                    
                    echo.Script Ended at %time%
                    exit /b 0
                    Also configure the two policies as I mentioned earlier (then run GPupdate /force and reboot the computer).
                    Logon again as regular user - the logonscript will automatically run.
                    After a few minutes open the file "logonscript.log" that is in your %temp% folder with notepad.

                    /Rems[/QUOTE]

                    Comment


                    • #11
                      Re: Logonscript not running for Windows 7

                      could you tell us where in AD you have the script configured ?
                      Perhaps a screen dump of the relevant properties page?


                      could you also please respond to Gerth's post about whether you can manually run the script ?
                      Please do show your appreciation to those who assist you by leaving Rep Point https://www.petri.com/forums/core/im.../icon_beer.gif

                      Comment


                      • #12
                        Re: Logonscript not running for Windows 7

                        Originally posted by tehcamel View Post
                        could you tell us where in AD you have the script configured ?
                        Perhaps a screen dump of the relevant properties page?


                        could you also please respond to Gerth's post about whether you can manually run the script ?
                        Yes, the script is running along nicely if i start it up from \\server\logonscript\business.bat

                        When you ask where in AD the script is defined? Do you happen to mean \\servername\logonscript? that is where the script lies.

                        Comment


                        • #13
                          Re: Logonscript not running for Windows 7

                          Originally posted by mr_snuggles View Post
                          I have added a users as a member of the local administrators group, without it helping at all.

                          I have tried turning off UAC, without it giving me anything.
                          The question was whether or not the users were local Admins and whether or not UAC was enabled. Please don't take two steps ahead, because then we can not diagnose the problem.
                          And provide answers to all questions please.

                          Is SP1 for Windows 7 installed?

                          Enable the policy "Always wait for the network at startup and logon" and test using the sample batch that is writing the start time and end time to a log-file.

                          What is the OS on the domain controller(s)?


                          Originally posted by mr_snuggles View Post
                          the path to the logon-script is e:\logonscript or \\localhost\logonscript\logon_company.bat and KIX is a subdirectory of this.
                          Can you explain how the script can be "here or there"?
                          Can you explain those paths e: an localhost?? If that is the path you have configured to run the script from at login I am sure that is one of the reasons why the logon script is not running at all.


                          Originally posted by mr_snuggles View Post
                          Yes, the script is running along nicely if i start it up from \\server\logonscript\business.bat

                          When you ask where in AD the script is defined? Do you happen to mean \\servername\logonscript? that is where the script lies.
                          It means where is it configured
                          - in a GPO linked to the OU where the users are (b.t.w. is it an OU or are the User in the default users container)
                          - or is the GPO linked to an other level in AD structue
                          - is loopback policy active?
                          - or is the script configured on the "Profile" tab of the user properties dialog in the Active Directory Users and Computers MMC.

                          If the logon script is on just some \\server and not somewhere in the directory domain.local\sysvol\domain.local then without having the trusted sites configured, there could be a security related issue also causing the logonscript wouldn't run.


                          /Rems
                          Last edited by Rems; 10th May 2011, 07:14.

                          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


                          • #14
                            Re: Logonscript not running for Windows 7

                            Thanks for the response! Most helpful, and it's deeply appreciated. I'll try to respond as good as I can.

                            Originally posted by Rems View Post

                            Is SP1 for Windows 7 installed?
                            Yes it is.


                            Originally posted by Rems View Post
                            Enable the policy "Always wait for the network at startup and logon" and test using the sample batch that is writing the start time and end time to a log-file.
                            I will test it, but.... the script runs perfectly as long as it is Windows XP, and not Windows 7.


                            Originally posted by Rems View Post
                            What is the OS on the domain controller(s)?
                            Which one of them? We raised the level to Windows 2008 last thursday. Before that, Windows 2003.

                            Originally posted by Rems View Post
                            Can you explain how the script can be "here or there"?
                            Can you explain those paths e: an localhost??
                            It's kind of hard to explain how the script can be here and there We have at 3 domain controllers in our little organisation at least. And in our co-op we have maybe 30-40?

                            But on this particular server, I find the logonscript under \\localhost\logonscript or \\servername\logonscript or by using e:\logonscript

                            Originally posted by Rems View Post
                            It means where is it configured
                            - in a GPO linked to the OU where the users are (b.t.w. is it an OU or are the User in the default users container)
                            - or is the GPO linked to an other level in AD structue
                            - is loopback policy active?
                            - or is the script configured on the "Profile" tab of the user properties dialog in the Active Directory Users and Computers MMC.
                            That is a darn good question. I have checked the OU (and it is an OU), and we have a default domain policy, and a default policy for our OU.

                            The script is not configured on the "profile" tab in AD.
                            Last time I checked loopback policy is active.

                            The thing is that the windows 7 computers we are having trouble with, comes under some new GP called Windows 7. BUT we also needs them to run the logonscript.


                            Originally posted by Rems View Post
                            If the logon script is on just some \\server and not somewhere in the directory domain.local\sysvol\domain.local then without having the trusted sites configured, there could be a security related issue also causing the logonscript wouldn't run.
                            That might be me not being totally correct describing the problem, or being outright unclear.

                            This logonscript has been running perfectly on our Windows XP computers for years, and still does. But it doesn't run on our new Windows 7 computers at all.

                            Since this is a pretty large organisation with a head IT department and many subsidiaries, I may not be privvy to the complete picture.

                            I will have to see if I can make the time to rewrite the batch file today, because I am so lucky to be almost alone in the office today, with a million things to do. And after work hours I am required to be in the kids kindergarten, doing some work. In between that I have family, a car to repair, and some other small stuff. I don't complain, just explain.

                            Thanks for all the help so far!

                            Comment


                            • #15
                              Re: Logonscript not running for Windows 7

                              On one of the Windows 7 computers log on as regular user. It must be of course, a user for whom the problem logon script is suppost to run.

                              Then this user must run this command:
                              Code:
                              cmd /c reg.exe Export "HKCU\Software\Policies\Microsoft\Windows\System\Scripts\Logon" "%temp%.\$reg"&&start notepad.exe "%temp%.\$reg"
                              Copy the complete output to here. If there would be no values in the output please let me know that too.

                              In the output you see one (or maybe more than one) entry named "Script", the value is a command line. Is it pointing to "\\\\yourdomain.local\\....." or to a "\\\\servername\\.....". When it is the name of a server is that server one of the domain controllers?


                              /Rems
                              Last edited by Rems; 23rd May 2011, 18:53.

                              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