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

Tags: ,

Sponsored Links



Logon script not working correctly

Software Development


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
Expertz's Avatar
Member
 
Join Date: Dec 2007
Posts: 1,432
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
Team Leader's Avatar
Member
 
Join Date: Dec 2007
Posts: 1,516
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
Modifier's Avatar
Member
 
Join Date: Jan 2008
Posts: 1,502
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
kelfro's Avatar
Member
 
Join Date: Apr 2008
Posts: 1,976
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
Modifier's Avatar
Member
 
Join Date: Jan 2008
Posts: 1,502
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


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 10:06 PM
Script logon Gianluca Active Directory 8 22-04-2010 09:48 PM
GP Logon Script works first time at second user logon Roland Schoen Active Directory 2 09-11-2009 06:49 PM
help with logon vbs script theunlikely@gmail.com Windows Server Help 4 19-03-2009 08:57 AM
Logon Script will not run Absolutely Windows Server Help 5 29-01-2008 06:26 PM


All times are GMT +5.5. The time now is 04:15 AM.