locked
Logon Script in Windows 7 RRS feed

  • Question

  • Hej all!

    These login script trouble and other various problems were discuess to death but I got another one for you:

    In the Windows 2003 Server enviroment, we have some Windows 7 workstations/laptops. Now I have compiled togehter logon script, that has no errors in it and is distributed by default domain policy. Now the script definately runs - BUT - only in Windows 7 I get this strange behaviour; it does not connect network drives defined in it, but if I go to the server share and run it manually, the drives are connected corectly and are there. I tried this with UAC on and off, I tried sleep the script, I tried to distribute it trough user policy - nothing seems to work. Can aynone shine some ligh on this issue and how to proceed?

    Note that other settings are processed just fine...foe example I added the strMsgBox to test it out and the message box is opened just fine so the iteration goes trough mapping drives logic...

    Thanks in advance!


    I am the First One.
    Friday, February 11, 2011 12:26 PM

Answers

  • I don't have it in front of me so I'll go off of memory and just the logic.  Our script basically does this:

     

    check for windows version
    if "6.1" goto :Win7
    if "whatever XP was" goto :XP
    ...etc


    :Win7

    If %variable on computer or AD% = personnel then
    goto :PER
    If %variable on computer or AD% = engineering then
    goto :ENG
    ....
    ...etc

    :PER
    net use x: /delete
    net use y: /delete
    net use z: /delete
    net use x: \\computer name \share name /persistent
    net use y: \\computer name \share name /persistent
    net use z: \\computer name \share name /persistent
    ...
    check personnel app versions...
    ...other stuff


    :ENG
    net use a: /delete
    net use b: /delete
    net use c: /delete
    net use a: \\computer name \share name /persistent
    net use b: \\computer name \share name /persistent
    net use c: \\computer name \share name /persistent

    check engineering app versions...
    ...other stuff
    ...
    ...
    goto :EOF

    :WinXP
    ...
    ...

    ...
    goto :EOF

    :EOF
    ...last minute stuff
    ...

     

    Or you could just have it call a different batch or .vbs file for each dept./OS/etc

     

    Or depending on how many variations of drive mappings you have...if you don't have too many you could as you said just make a GPO for each and scope them accordingly.

     

    As for the logon process time, I know our XP boxes take quite awhile to logon but our 7 boxes w/ the same scripts take about 1/4 the time.  I disabled the logon script section for 7 and have been using just Group Policy for about 2 months now and 7 is still a day & night different to our XP boxes running solely on scripts for things like that.  Your environment may be radically different that ours so I couldn't say which is best for you.  I hope that helps.

    • Marked as answer by Leo Huang Friday, February 18, 2011 9:02 AM
    Saturday, February 12, 2011 7:33 PM

All replies

  • Hej all!

    These login script trouble and other various problems were discuess to death but I got another one for you:

    In the Windows 2003 Server enviroment, we have some Windows 7 workstations/laptops. Now I have compiled togehter logon script, that has no errors in it and is distributed by default domain policy. Now the script definately runs - BUT - only in Windows 7 I get this strange behaviour; it does not connect network drives defined in it, but if I go to the server share and run it manually, the drives are connected corectly and are there. I tried this with UAC on and off, I tried sleep the script, I tried to distribute it trough user policy - nothing seems to work. Can aynone shine some ligh on this issue and how to proceed?

    Note that other settings are processed just fine...foe example I added the strMsgBox to test it out and the message box is opened just fine so the iteration goes trough mapping drives logic...

    Thanks in advance!


    I am the First One.

    I experienced the same issue and simply settled on mapping drives w/ Group Policy Preferences.  Works fine for XP & 7.

     

    We had similar issues after XP SP3 which required us to forcefully disconnect/delete the drive mappings, then map them in the script.   You might try this for your 7 PC's.

    Friday, February 11, 2011 9:45 PM
  • hm, interesting proposal - now why I didn't think of that; but the real issue is if drive mapping is supported per user - we need that because many individual users are using specific mappings, that is also why we use logon script - it can check logon username and od specific stuff for him...

    EDIT: I can see that I can assign as many group policies as I want BUT there is catch; the logon process is starting to get very slow as so many policies are appliying...and advice on that?


    I am the First One.
    Saturday, February 12, 2011 9:43 AM
  • I don't have it in front of me so I'll go off of memory and just the logic.  Our script basically does this:

     

    check for windows version
    if "6.1" goto :Win7
    if "whatever XP was" goto :XP
    ...etc


    :Win7

    If %variable on computer or AD% = personnel then
    goto :PER
    If %variable on computer or AD% = engineering then
    goto :ENG
    ....
    ...etc

    :PER
    net use x: /delete
    net use y: /delete
    net use z: /delete
    net use x: \\computer name \share name /persistent
    net use y: \\computer name \share name /persistent
    net use z: \\computer name \share name /persistent
    ...
    check personnel app versions...
    ...other stuff


    :ENG
    net use a: /delete
    net use b: /delete
    net use c: /delete
    net use a: \\computer name \share name /persistent
    net use b: \\computer name \share name /persistent
    net use c: \\computer name \share name /persistent

    check engineering app versions...
    ...other stuff
    ...
    ...
    goto :EOF

    :WinXP
    ...
    ...

    ...
    goto :EOF

    :EOF
    ...last minute stuff
    ...

     

    Or you could just have it call a different batch or .vbs file for each dept./OS/etc

     

    Or depending on how many variations of drive mappings you have...if you don't have too many you could as you said just make a GPO for each and scope them accordingly.

     

    As for the logon process time, I know our XP boxes take quite awhile to logon but our 7 boxes w/ the same scripts take about 1/4 the time.  I disabled the logon script section for 7 and have been using just Group Policy for about 2 months now and 7 is still a day & night different to our XP boxes running solely on scripts for things like that.  Your environment may be radically different that ours so I couldn't say which is best for you.  I hope that helps.

    • Marked as answer by Leo Huang Friday, February 18, 2011 9:02 AM
    Saturday, February 12, 2011 7:33 PM