Announcement

Collapse
No announcement yet.

script path changing the \\server variable to point to multiple locations

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

  • script path changing the \\server variable to point to multiple locations

    We have a script that's in the netlogon folder on the DCs that's used as a logon script.
    The content of the script has a line that runs the executable with a server variable ex) \\DC1\netlogon\app.exe).
    The \\DC1 here is one of the DCs and the "app.exe" resides on all the DCs (DC2, DC3). Is there a way to change the \\server (\\DC1) variable in the script to point to all the DCs and not just a single DC so we have a redundancy in place?

  • #2
    Re: script path changing the \\server variable to point to multiple locations

    Create a new share on each DC. Move the app to the share. Set up a domain DFS root and add a link to the share for each DC. Change the logon script to reflect the DFS path.

    Comment


    • #3
      Re: script path changing the \\server variable to point to multiple locations

      We actually have DFS in place but just using it for the replication not the name space because we found that if one of the DFS name space servers goes down, the access to those shares becomes really slow until the other DFS name space server comes back up.
      So we were looking for a way in the script to point to multiple sources.

      thanx.

      Comment


      • #4
        Re: script path changing the \\server variable to point to multiple locations

        Maybe you can you use:
        %logonserver%\netlogon\app.exe

        or:
        \\domain.local\netlogon\app.exe


        \Rems
        Last edited by Rems; 2nd September 2008, 22:10.

        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: script path changing the \\server variable to point to multiple locations

          Yes, I've tried %logonserver%\ and domain\ but didn't work.
          Thanx

          Comment


          • #6
            Re: script path changing the \\server variable to point to multiple locations

            Is it a vbscript or batch?

            retrieve script's path:

            vbs:
            scriptPath = WScript.ScriptFullName
            scriptPath = Left(scriptPath, InstrRev(scriptPath, "\"))
            wscript.ECHO ScriptPath & "app.exe"

            batch:
            ECHO %~dp0app.exe


            \Rems


            p.s.
            - Use the fqdn of the domain in \\domain.local\netlogon and on each computer add *.domain.local to the Local Intranet zone.
            - what is app.exe doing exactly?
            Last edited by Rems; 2nd September 2008, 22:13.

            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: script path changing the \\server variable to point to multiple locations

              It's a batch script.
              It echoes the path to one of the DCs.
              \\dc2\netlogon\app.exe

              Comment


              • #8
                Re: script path changing the \\server variable to point to multiple locations

                Can you use %~dp0app.exe to execute the program from the batch? Can you run this logonscript manually without errors?

                What is the app.exe doing? How is it executed from the batch and have you configured the policy "Run logon scripts synchronously"?

                \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: script path changing the \\server variable to point to multiple locations

                  Thanks, it works now. I've added the *.domain as the local intranet zone and had it to run synchronously by GPO and changed the path in the script to use \\domain\netlogon\app.exe. Is running the "Run logon scripts synchronously" necessary?

                  Comment


                  • #10
                    Re: script path changing the \\server variable to point to multiple locations

                    Originally posted by 2008vm View Post
                    Is running the "Run logon scripts synchronously" necessary?
                    That depens on - which commands are used to start the app within the logon script - and - how long the app must stay active.
                    Normaly I prefer to run logonscripts synchronously, so other startup pograms cannot interfere, or users are able to terminate the logonscript process-tree.
                    It could be that in your case the logon script cannot run synchronously, you'll have to find out.

                    What I do sometime is making the logonscript to add the domain.local to the Local Intranet zone by script via the registry, and to add path\executable to a new entry in the RunOnce key of the user. The executable now has it "own" 'space and time' to run in. (The logon scripts in this scenario must run synchronously)

                    \Rems


                    -=EDIT=-
                    This sample shows a logonscript batch lauching an exe that is on the network.
                    This batch run a check if the domain.local %LocalIntranetZone% exists before opening the exe. IF NOT EXISTS, the script will add the zone and will also delete it again after the exe is opened.
                    http://forums.petri.com/showpost.php?t=27436&p=120976
                    (don't mind the "%AcceptEula%" thing, that is just for the other exe)
                    .
                    Last edited by Rems; 5th September 2008, 19:09. Reason: typos

                    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