Solved

I do not understand why my log in scripts are not working.

Posted on 2006-07-24
8
1,757 Views
Last Modified: 2008-01-09
I have a login script set in the AD in the login script under each users login profile to map each PC to specific shared data resources.
The name of the script is Login.bat and is located in a subfolder in the SYSVOL folder on our DC server; which seems to work fine.  Every new employee that logs in, gets all of the mapped drive set up in the Login.bat.

i.e.:
NET USE I: \\server1name\Data
NET USE M: \\server1name\HR Data
NET USE P: \\server1name\Accounting Data
NET USE S: \\server1name\Technology Data

The company has grown rather large and departments are more subdivided making it not necessary for everyone in the company to have access to all of the data.  Also, the server is getting loaded with all the data and I would like to move some data to another server.

I created a shared drive on server 2 and named it AR Accounting Data

I also created a new login script to put in specific users Login profile and I named it ARAD.bat

NET USE I: \\server1name\Data
NET USE M: \\server1name\HR Data \delete \yes
NET USE P: \\server1name\Accounting Data \delete \yes
NET USE S: \\server1name\Technology Data \delete \yes
NET USE J: \\server2name\AR Accounting Data

I tested this by only placing ARAD.bat in one persons profile and then logging in as them.
It did not work.  All of the old mapped drives showed up and the new mapped drive did not.

I tried to use the delete switch without the yes as well as with the yes without the "\".
When the log in screen comes up it goes too fast, but I think is shows an error ?? 1326 ?? or something like that.

What am I doing wrong?
0
Comment
Question by:tjmichael
8 Comments
 
LVL 10

Assisted Solution

by:ryangorman
ryangorman earned 50 total points
ID: 17168875
Add "Pause" to the bottom of your script and then run the script interactively.

e.g. \\DNSdomain.local\netlogon\login.bat

You'll be able to see the errors.

I suggest that you use
NET USE P: /delete
rather than
NET USE P: \\server1name\Accounting Data \delete \yes
0
 

Author Comment

by:tjmichael
ID: 17168909
I'm sorry, when I went to add the pause to the script, I noticed that the switches were correct

NET USE P: \\server1name\Accounting Data /delete /yes

My apologies.
0
 
LVL 43

Assisted Solution

by:Steve Knight
Steve Knight earned 100 total points
ID: 17169006
Not sure if you mean it is fixed now or not but could it also be because you have a space in the share name, perhaps try with

net use p: "\\server1name\accounting data"

If it has a space in it would certainly fail on older machines such as NT, to be honest I never use spaces in share names so maybe OK in 2000/XP now I guess.

Steve
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:tjmichael
ID: 17169090
It says:

   NET USE P: \\server1name\Accounting Data /delete /yes
   A command was used with conflicting switches.

   More help is available by typing NET HELPMSG 3510

I took out the /yes and received the same error
I also took out the "/" I recieved an error:
   System error 85 occurred.
   The local device name is already in use.

The new drive had a different error message:
   System error 1909 has occurred.
   The referenced account is currently locked out and may not be logged on to.

I have rights to get into the shared folder on server2, and if I manually map the drive it maps fine.

This dosen't make sense.
0
 

Author Comment

by:tjmichael
ID: 17169143
Thanks Steve (dragon-it)  That fixed the problem with creating the new drive, but the other drives still will not delete.
0
 
LVL 51

Accepted Solution

by:
Netman66 earned 100 total points
ID: 17169281
NET USE P: /delete

You do not need the UNC path during a delete, just the drive letter.  "Yes" is used on persistent drive mappings not deletes.



0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 17169285
Have you tried the " " around the command for the deletes too?

It could be it has never really worked and the drives have all been mapped by hand before?

Try this at the beginning of your script BTW for the future

net use /peristenet:no

Steve
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 17169289
Oops, yes Netman66 is right of course.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Organizations create, modify, and maintain huge amounts of data to help their businesses earn money and generally function.  Typically every network user within an organization has a bit of disk space to store in process items and personal files.   …
by Batuhan Cetin In this article I will be guiding through the process of removing a failed DC metadata from Active Directory (hereafter, AD) using the ntdsutil tool in a Windows Server 2003 environment. These steps are not necessary in a Win…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question