Solved

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

Posted on 2006-07-24
8
1,729 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
 

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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

705 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now