Solved

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

Posted on 2006-07-24
8
1,782 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
what is the performance monitor? How can we use it? 3 86
inactive users 13 94
ADMT Intra Forest migration questions 7 299
Event-ID 3001, 3011 - LoadPerf - Windows Server 2003 14 96
Many of us need to configure DHCP server(s) in their environment. We can do that simply via DHCP console on server or using MMC snap-in on each computer with Administrative Tools installed in a network. But what if we have to configure many DHCP ser…
Learn about cloud computing and its benefits for small business owners.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

734 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