Registered users    
MembershipMembership:
Latest New UserLatest:Matt Frye
New TodayNew Today:1
New YesterdayNew Yesterday:3
User CountOverall:23339

Private messaging    
You must be logged in to use this module.
Top 10 posters    
NamePosts
Mariette Knap12904
Marina Roos12523
Eriq Neale2114
Stan Guinn1914
Michael Patrick1913
Robert Pearman1771
Nick Pieters1425
Stewart Brown617
william warren603
Kevin D.579
Welcome unauthorized visitor    
If you want to join us in the discussions on this forum you need to register first. Registration is free! If you are already a registered user please login to join the forum.
Small Business Server Support Forum    
Subject: Logon script not working??
Prev Next
You are not authorized to post a reply.

Author Messages
Travis Wallace User is Offline
United States
Member since
4/14/2005

Registered Users
Posts: 21

12/01/2005 12:15 AM  
Hello all.
 
I am trying to use the regular login script to automatically map a network drive on all of my clients. I have edited the SBS_LOGIN_SCRIPT.bat file located at \\server\winnt\sysvol\sysvol\domain.local\scripts (the NETLOGON share). I added the following line:
 
net use m: \\servername\directory

I tried rebooting a workstation to test it, and the drive is not mapping. I checked the event log on the workstation, and I don't see any errors. In the interest of full disclosure, the directory I am trying to map to is not just a one word name. Am I changing the wrong script, or is there something else I need to do to get this to work?  If it doesn't, I can do it manually, but from what I have read, this should work. Any help would be appreciated. Thanks in advance.

Travis
Steve Lister User is Offline
New Zealand
Member since
3/30/2005

Registered Users
Posts: 234

12/01/2005 01:26 AM  
Travis
 
Is the directory shared?
If the share name has a space in it, you will need to put quotes around it in the command
 
i.e. net use m: "\\server\a share"
 
You can test this from a command prompt, so you don't have to keep logging out.
 
HTH
Steve
Travis Wallace User is Offline
United States
Member since
4/14/2005

Registered Users
Posts: 21

12/01/2005 05:10 PM  
Steve,
 
Thanks for the reply. It is shared, so I put quotes around the line as you instructed. Still isn't mapping the drive. The syntax I used is as follows:
 
 
I just realized that the share name is exactly the same as the actual folder name. Should I change the share name to something different? Thanks for the help.
 
Travis
Des Quinn User is Offline
United Kingdom
Member since
5/20/2005

Registered Users
Posts: 281

12/01/2005 06:01 PM  
what is the error when you try it from a command line?
can your ping the servr name?
can you open it from the Start > Run dialog with \\servername\folder name?
Travis Wallace User is Offline
United States
Member since
4/14/2005

Registered Users
Posts: 21

12/01/2005 06:18 PM  
Des,
 
Thanks for the reply. The funny thing is that when I try it from the command line, it works like a charm. I can ping the server, and I can open the share from the Run dialog. Is there some sort of special syntax I have to use in the login script? From what I have seen there isn't, but that maybe everything I have seen assumes the reader knows the syntax. Thanks again for the help.
 
Travis
Des Quinn User is Offline
United Kingdom
Member since
5/20/2005

Registered Users
Posts: 281

12/01/2005 06:35 PM  
put a pause after the command so you can see the displayed error mesage as the login scipt is being processed.
Travis Wallace User is Offline
United States
Member since
4/14/2005

Registered Users
Posts: 21

12/01/2005 06:37 PM  
How do I do that?
 
Thanks,
Travis
Des Quinn User is Offline
United Kingdom
Member since
5/20/2005

Registered Users
Posts: 281

12/01/2005 06:45 PM  
edit the login script
and type pause
save login script
Travis Wallace User is Offline
United States
Member since
4/14/2005

Registered Users
Posts: 21

12/01/2005 06:59 PM  
Okay, here is the output on the command line from the batch file running:
 
C:\Documents and Settings\username.domain>\\servername\Clients\Setup\setup.exe /s servername
C:\Documents and Settings\username.domain>net use m:"\\servername\Ministry Shared Folders"
System error 67 has occurred.
The network name cannot be found.
 
Thanks again for the help.
 
Travis
Mariette Knap User is Offline
The Netherlands
Member since
3/24/2005

Forum Admins
Posts: 12904

12/01/2005 09:09 PM  
Instead use a policy to attach this login script:

 Concentrix Login script
' Author: Concentrix b.v. [Mariëtte Knap]
' Date: 16-08-2005
On Error Resume Next
Set
nUser = WScript.CreateObject("Wscript.Network")
Do while nUser.username = ""
WScript.Sleep 250
Loop
Set
IExplore = WScript.CreateObject("InternetExplorer.Application","event_")
Set Drives = nUser.EnumNetworkDrives
IExplore.Navigate "about:Blank"
IExplore.Width = 300
IExplore.Height = 350
IExplore.Toolbar =
False
IExplore.StatusBar = False
IExplore.Visible = True
IExplore.Resizable = False
IExplore.Top = 10
IExplore.Left = 10
IExplore.Visible =
True
StartTime = Now
Set UserObj = GetObject("WinNT://" & nUser.UserDomain & "/" & nUser.Username)
UserName = "User"
Do While Not IExplore.ReadyState = 4
WScript.Sleep 250
Loop
IExplore.Document.Title = "Customer Name Loginscript"
IExplore.Document.Body.Style.FontFamily = "Verdana"
IExplore.Document.Body.Style.FontSize = "10"
IExplore.Document.Body.InnerHTML = IExplore.Document.Body.InnerHTML & "Customer Name
"
IExplore.Document.Body.InnerHTML = IExplore.Document.Body.InnerHTML & "Your Company Name

"
IExplore.Document.Body.InnerHTML = IExplore.Document.Body.InnerHTML & "Running for " & nUser.UserName & "
@" & Now & "
@"&nUser.UserDomain&"

"
IExplore.Document.Body.InnerHTML = IExplore.Document.Body.InnerHTML & GroupStr & "
"
IExplore.Document.Body.InnerHTML = IExplore.Document.Body.InnerHTML & "Mapping drives:
"
For i = 0 To Drives.Count -1 Step 2
nUser.RemoveNetworkDrive Drives.Item(i)
IExplore.Document.Body.InnerHTML = IExplore.Document.Body.InnerHTML & "Removed " & Drives.Item(i) & "
"
next
IExplore.Document.Body.InnerHTML = IExplore.Document.Body.InnerHTML & "Connect drive G: with servername...
"
nUser.MapNetworkDrive "P:", "\\servername\folder3"
IExplore.Document.Body.InnerHTML = IExplore.Document.Body.InnerHTML & "Connect drive G: with servername...
"
nUser.MapNetworkDrive "G:", "\\servername\folder2"

'
IExplore.Document.Body.InnerHTML = IExplore.Document.Body.InnerHTML & "Connect drive G: with servername...
"
nUser.MapNetworkDrive "Z:", "\\servername\folder1", false, "Loginname", "password"
IExplore.Document.Body.InnerHTML = IExplore.Document.Body.InnerHTML & "End

"
IExplore.Document.Body.InnerHTML = IExplore.Document.Body.InnerHTML & "Loginscript took: " & DateDiff("s",StartTime,Now) & " second(s)..."
IExplore.Document.Body.InnerHTML = IExplore.Document.Body.InnerHTML & ""
WScript.Sleep (2000)
IExplore.Quit

Mariëtte Knap Smallbizserver.Net AdministratorMission accomplished. We have joined the branch office to our SBS 2003 Headquarters and have the same user experience on the branch office as we have on our local  network at the Headquarters. Want to know how? Signup up for a subscription and get instant access to the article series 'How to add an additional Domain Controller from a remote office to the SBS domain'
Michael Hernandez User is Offline
United States
Member since
2/9/2006

Registered Users
Posts: 5

12/11/2006 05:09 PM  
Just looking at his original line of: net use m:"\\servername\Ministry Shared Folders", there isn't a "space" between the colon(:) and the path "\\servername\Ministry Shared Folders".

adding a space like so:

net use m: "\\servername\Ministry Shared Folders"

should work.
You are not authorized to post a reply.



ActiveForums 3.7
Forum policy    
These Discussion Forums are dedicated to the discussion of the Small Business Server and related server and client software. For the benefit of the community please observe the following posting guidelines:
  1. No Advertising. This includes promotion of commercial products and non-commercial products which are not directly related to Small Business Server and related server and client software.
  2. No Flaming or Trolling.
  3. No Profanity, Racism, or Prejudice.
  4. Site Moderators have the final word on approving/removing a thread or post or comment.