Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 15-12-2008
Member
 
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
Reply With Quote
  #2  
Old 16-12-2008
Member
 
Join Date: Dec 2007
Posts: 1,592
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
Reply With Quote
  #3  
Old 16-12-2008
Member
 
Join Date: Dec 2007
Posts: 1,542
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
Reply With Quote
  #4  
Old 16-12-2008
Member
 
Join Date: Jan 2008
Posts: 1,515
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.
Reply With Quote
  #5  
Old 16-12-2008
Member
 
Join Date: Apr 2008
Posts: 2,001
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?
Reply With Quote
  #6  
Old 16-12-2008
Member
 
Join Date: Jan 2008
Posts: 1,515
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Logon script not working correctly"
Thread Thread Starter Forum Replies Last Post
Dumping logon name and logon script values to a text file - blank logon script field Phil McNeill Windows Server Help 3 17-08-2010 09:06 PM
Run logon script Sandy22 Operating Systems 6 08-06-2010 10:16 AM
Logon Script Does Not Work c54618 Operating Systems 1 01-05-2008 08:40 AM
domain logon script does not run Onetoomany Windows Server Help 4 11-02-2008 05:37 AM
logon script help HandelMan Small Business Server 1 31-01-2008 03:26 AM


All times are GMT +5.5. The time now is 02:45 PM.