Results 1 to 6 of 6

Thread: Logon script not working correctly

  1. #1
    Join Date
    Dec 2008
    Posts
    7

    Logon script not working correctly

    I have a logon script I want to use on Small Business Server 2003 to map two network drives on the workstations. There are five servers on the network and I do not want drives mapped on these. There must be something wrong with my syntax because the servers always get their drives mapped. Any suggestions?

    @echo off
    rem check to see if a SBS member
    \\SERVER1\Clients\Setup\setup.exe /s SERVER1
    rem
    rem check if server - skip drive mappings if server
    rem
    if %computername% == Server1 goto end
    if %computername% == AVPS3 goto end
    if %computername% == Avpserver1 goto end
    if %computername% == NAS goto end
    if %computername% == ERP goto end
    rem
    rem All client computers but server run these commands
    rem
    net time \\Server1 /set /y
    net use z: /d
    net use z: \\NAS\users\%username%
    net use y: /d
    net use y: \\nas\shared
    :end

  2. #2
    Join Date
    Dec 2007
    Posts
    1,599

    Re: Logon script not working correctly

    You host needs to turn on Parent Pathing (which most won't). Your path is a parent path to the root /logon/_private/logon.inc

    Alternatively try setting it to a relative path (relative to you page) logon/_private/logon.inc

  3. #3
    Join Date
    Dec 2007
    Posts
    1,547

    Re: Logon script not working correctly

    You can do a WMI query against the Win32_NetworkConnection class to determine whether the drive is mapped before unmapping it. However, it might be simplest to just delete all network drives at the beginning.
    http://www.microsoft.com/technet/scr...5/hey0915.mspx

  4. #4
    Join Date
    Jan 2008
    Posts
    1,521

    Re: Logon script not working correctly

    The script is correct. Just a cosmetic change need to be done. Just add /I in all the conditions for skipping drive mapping. This will solve the problem, as far as I think. Try it and let me now if that works.

  5. #5
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Logon script not working correctly

    I had used such kind of a script earlier but I dont remember the script now. To me, the script looks correct. I didn't understand what modifier is talking about /I. Modifier, can you please tell me where exactly to add this tag?

  6. #6
    Join Date
    Jan 2008
    Posts
    1,521

    Re: Logon script not working correctly

    Quote Originally Posted by kelfro View Post
    I had used such kind of a script earlier but I dont remember the script now. To me, the script looks correct. I didn't understand what modifier is talking about /I. Modifier, can you please tell me where exactly to add this tag?
    Code:
    @echo off
    rem check to see if a SBS member
    \\SERVER1\Clients\Setup\setup.exe /s SERVER1
    rem 
    rem check if server - skip drive mappings if server 
    rem 
    if /I %computername% == Server1 goto end
    if /I %computername% == AVPS3 goto end 
    if /I %computername% == Avpserver1 goto end 
    if /I %computername% == NAS goto end 
    if /I %computername% == ERP goto end 
    rem 
    rem All client computers but server run these commands 
    rem 
    net time \\Server1 /set /y 
    net use z: /d
    net use z: \\NAS\users\%username%
    net use y: /d
    net use y: \\nas\shared
    :end
    Note the '/I' in all the conditions.

Similar Threads

  1. Replies: 3
    Last Post: 17-08-2010, 09:06 PM
  2. Run logon script
    By Sandy22 in forum Operating Systems
    Replies: 6
    Last Post: 08-06-2010, 10:16 AM
  3. Logon Script Does Not Work
    By c54618 in forum Operating Systems
    Replies: 1
    Last Post: 01-05-2008, 08:40 AM
  4. domain logon script does not run
    By Onetoomany in forum Windows Server Help
    Replies: 4
    Last Post: 11-02-2008, 05:37 AM
  5. logon script help
    By HandelMan in forum Small Business Server
    Replies: 1
    Last Post: 31-01-2008, 03:26 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,560,282.13074 seconds with 17 queries