Solved

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

Posted on 2006-07-24
8
1,745 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

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

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.

Question has a verified solution.

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

I guess it is not common knowledge to most Wintel engineers/administrators: If you have an SNMP-based monitoring system in your environment (and it's common to have SNMP or Syslog) it's reasonably easy to enable monitoring of the Windows Event logs,…
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.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

911 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

19 Experts available now in Live!

Get 1:1 Help Now