Solved

Why is my login script not working properly?

Posted on 2013-12-06
46
469 Views
Last Modified: 2014-01-08
Ok, below is my logon script and file1 is a new 2012 file server.  All of the drives map properly except the V drive, see below.  It is not for every user, but everyday I have about 10-15 users, all different complain that the V drive is not there.  All we do, it run the script manually, and it maps.  This is definitely not rocket science, but I am missing something...  Please assist.  




echo off

ipconfig /flushdns

net use K: \\file1\formswp
net use L: \\file1\dictation
net use M: \\server\users\%username%
net use N: \\file1\pins
net use O: \\file1\stips
net use P: \\file1\briefs
net use R: \\file1\indexes
net use U: \\file1\urlings
net use V: \\file1"\scanned documents" /PERSISTENT:yes
net use X: \\server\installs


exit
0
Comment
Question by:sXmont1j6
  • 24
  • 13
  • 9
46 Comments
 
LVL 17

Expert Comment

by:Chris Millard
Comment Utility
it should read:-

net use V: "\\file1\scanned documents" /persistent:yes

you have the quotes in the wrong place.
0
 

Author Comment

by:sXmont1j6
Comment Utility
I had that the other day, but will try again because I added the persistent:yes.  

Can you explain to me why I need to add the persistent:yes?
0
 
LVL 26

Expert Comment

by:pony10us
Comment Utility
roybridge is correct.

Something else you may wish to think about is deleting any existing mappings at the start of the script

net use * /delete /y
0
 

Author Comment

by:sXmont1j6
Comment Utility
Can one explain why I add the persistent just for the V drive mapping?
0
 
LVL 26

Expert Comment

by:pony10us
Comment Utility
Adding the persistent is so that the drive will be there after a reboot.  If the computer is taken off the network then the drive will still be mapped but will show as disconnected.  When it is placed back on the network it will once again be able to access the files without having to map it again. For example, a laptop that is taken home at night.

This also "locks" that drive letter to that location unless/until deleted.
0
 

Author Comment

by:sXmont1j6
Comment Utility
Ok, I won't remove that setting.  Thanks guys, I will do this.
0
 

Author Comment

by:sXmont1j6
Comment Utility
Alright, I am again at a loss, see steps I took.  Below is the script that runs at logon:

echo off

ipconfig /flushdns

net use * /delete /y
net use K: \\file1\formswp
net use L: \\file1\dictation
net use M: \\server\users\%username%
net use N: \\file1\pins
net use O: \\file1\stips
net use P: \\file1\briefs
net use R: \\file1\indexes
net use U: \\file1\urlings
net use V: "\\file1\scanned documents" /PERSISTENT:yes
net use X: \\server\installs


exit

- Rebooted system while all of the drives are mapped and after login, all drives were mapped successfully EXCEPT for the dreaded V drive mapping.  I then manually ran the script and the V drive appeared.

- Disconnected all of the network drive mappings manually, rebooted system and only the \\server shared mapped, M & X, all of the \\file1 shares didn't map.  Manually ran the script and the \\file1 mappings all appeared.

Strange....  What you guys think?
0
 
LVL 26

Expert Comment

by:pony10us
Comment Utility
Sounds like it can't find \\file1 when it is trying to map the drives.

Start by REMing out the echo off so that you see each line execute with any associated error messages.
0
 

Author Comment

by:sXmont1j6
Comment Utility
But why is it successful when ran manually?
0
 
LVL 26

Expert Comment

by:pony10us
Comment Utility
Because you would run it manually at a later time than the login. This would permit it time to "see" the network.

On one of the machines that is not mapping try enabling Linked connections through a registry setting (REMEMBER USUAL CAUTION ABOUT WORKING IN REGISTRY)

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
 "EnableLinkedConnections"=dword:00000001
0
 
LVL 17

Expert Comment

by:Chris Millard
Comment Utility
since you are going to run this at each logon, I would remove the /persistent:yes option from the V: drive mapping.

Also, it *may* be the space in the "scanned documents" share name causing issue, so can you try changing the share name to "scanned_documents" and then change the script line to:-

net use V: \\file1\scanned_documents
0
 

Author Comment

by:sXmont1j6
Comment Utility
I understand the spacing, but I have a concern with changing the share.   It is due to the way our Case Management System was setup.  I believe it looks for that share...  (Note:  I did not set it up...lol)

But I am going to remove the persistent: yes and test.
0
 
LVL 17

Expert Comment

by:Chris Millard
Comment Utility
You can have more than one share name on a folder, so you can create an additional share called "scanned_documents" for the same folder...
0
 
LVL 26

Expert Comment

by:pony10us
Comment Utility
Good thought but it still comes down to the timing of the login script and the ability to see the server/shares based on your comment: "...all of the \\file1 shares didn't map.  Manually ran the script and the \\file1 mappings all appeared"
0
 
LVL 17

Expert Comment

by:Chris Millard
Comment Utility
can you comment out the ipconfig /flushdns line then to see if it is that causing issue?
0
 
LVL 17

Expert Comment

by:Chris Millard
Comment Utility
Alternatively, and although a bit crude you could add the following line to the top of the script (after the @echo off):-

ping >NUL: file1

that will ping file1 4 times which may be long enough for it to respond
0
 
LVL 17

Expert Comment

by:Chris Millard
Comment Utility
Oh and of course, you could always try mapping using the IP address of file1 instead i.e.

net use V: \\ip.ip.ip.ip\scanned_documents
0
 

Author Comment

by:sXmont1j6
Comment Utility
Ok, So I changed the script to the following:

echo off

ping file1

net use * /delete /y
net use K: \\file1\formswp
net use L: \\file1\dictation
net use M: \\pond-server\users\%username%
net use N: \\file1\pins
net use O: \\file1\stips
net use P: \\file1\briefs
net use R: \\file1\indexes
net use U: \\file1\urlings
net use V: "\\file1\scanned documents"
net use X: \\pond-server\installs

ipconfig /flushdns


end


I am testing it and it appears to be working just fine.  What would be an issue if the script just doesn't run for a specific user even though in AD I have the script associated with that user?
0
 
LVL 17

Expert Comment

by:Chris Millard
Comment Utility
Make sure that the user can access the script - try and run it from the command line for that user
0
 

Author Comment

by:sXmont1j6
Comment Utility
ok, I did that and it ran properly.
0
 

Author Comment

by:sXmont1j6
Comment Utility
Some users are even seeing the script run...  FRUSTRATING!!!!!! sorry for the caps, that was me losing it over something that normally is not this difficult.
0
 
LVL 17

Expert Comment

by:Chris Millard
Comment Utility
I'm not surprised at people seeing it run - I administer quite a few domains for various companies, and those with SBS running login scripts normally see them - after all, it's just running in a command window.
0
 

Author Comment

by:sXmont1j6
Comment Utility
IT doesn't look the command window is even showing for some users.
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:sXmont1j6
Comment Utility
I can't understand this a little bit, just changed the script to:
echo off

ping file1

net use * /delete /y
net use K: \\file1\formswp
net use L: \\file1\dictation
net use M: \\pond-server\users\%username%
net use N: \\file1\pins
net use O: \\file1\stips
net use P: \\file1\briefs
net use R: \\file1\indexes
net use U: \\file1\urlings
net use V: \\file1\scanned_documents
net use X: \\pond-server\installs

ipconfig /flushdns


end

And every drive appears except the V drive... But when run manually, it works.
0
 
LVL 26

Expert Comment

by:pony10us
Comment Utility
We have noticed that the login box usually doesn't show for Windows 7 workstations. When it does show it is usually due to very slow network connectivity (could be caused by congestion)

We always saw it in Windows XP
0
 

Author Comment

by:sXmont1j6
Comment Utility
I saw that as well, but why is it just this V drive that is not mapping...  I can't for the life of me understand why it maps manually...
0
 
LVL 26

Expert Comment

by:pony10us
Comment Utility
Try running this and look at the three sections in c:\drives.txt

echo off

ping file1

echo. Before drive unmap  >> c:\drives.txt
net use >> c:\drives.txt

net use * /delete /y 

echo. After drive unmap >> c:\drives.txt
net use >> c:\drives.txt

net use K: \\file1\formswp
net use L: \\file1\dictation
net use M: \\pond-server\users\%username%
net use N: \\file1\pins
net use O: \\file1\stips
net use P: \\file1\briefs
net use R: \\file1\indexes
net use U: \\file1\urlings
net use V: \\file1\scanned_documents
net use X: \\pond-server\installs

echo. After new map >> c:\drives.txt
net use >> c:\drives.txt
 
ipconfig /flushdns


end

Open in new window

0
 

Author Comment

by:sXmont1j6
Comment Utility
So, I logged in with my credentials to my RDS server and the script ran and mapped.  But it is not running and\or mapping on my local machine... HUH???  ??:
0
 

Author Comment

by:sXmont1j6
Comment Utility
OK, so I created a new script with your commands, and it worked properly.  Attached is the drives.txt.  

Why did this work and the script that I created not working?
0
 
LVL 26

Expert Comment

by:pony10us
Comment Utility
first - I think you forgot to attach the file.

Second - I have no idea.  All I did was add the commands to create the drives.txt file so you could see what actually happened at each step. I didn't change anything that you had. In fact, I copied your posted script to notepad and added my 6 lines and then posted it.
0
 
LVL 26

Expert Comment

by:pony10us
Comment Utility
The only thing that I can think is that there is still a timing issue because adding those lines would increase the run time by 1-5 mS each maybe.
0
 

Author Comment

by:sXmont1j6
Comment Utility
What would cause a "delay" in the time that I make an update to a login script and the have that user log in?
0
 

Author Comment

by:sXmont1j6
Comment Utility
Wow, that sounded awful.  I updated my script and tried to have a user login but the script didn't run the updated version, what would cause that?
0
 

Author Comment

by:sXmont1j6
Comment Utility
Why would a script work on a Terminal server for a user but on the users' workstation.
0
 

Author Comment

by:sXmont1j6
Comment Utility
but not on the users' workstation.  I feel like there is a network issue related here...
0
 
LVL 26

Expert Comment

by:pony10us
Comment Utility
On the computer (not the TS) click start and type:

\\%logonserver%\sysvol\HAYDEN.LOCAL\scripts

and see if you have access to the script from that location.
0
 

Author Comment

by:sXmont1j6
Comment Utility
Checked this previously.  It does.
0
 
LVL 26

Expert Comment

by:pony10us
Comment Utility
Let me list out what I think we have so far.

script at login:
1. Script runs on a TS
2. Script does not run on a workstation (the whole thing or just the one map?)
         (same user both locations)

Is it possible that there is a permission issue for the user on that workstation?  Have you had the same user try on a different workstation and a different user try on that workstation?
0
 
LVL 17

Expert Comment

by:Chris Millard
Comment Utility
OK - let's get a bit more information on the whole network setup.

file1 is a new Server 2012 (R2 ?)
what OS is pond-server?

Is pond-server the main domain controller?

Is file1 a member server or another domain controller on the same domain?

Are there other servers on the domain?

Has the script EVER worked properly, or has this started since adding file1 ?
0
 

Author Comment

by:sXmont1j6
Comment Utility
I am so sorry, that I did not reply to this...  but I am still having issues with ONLY one drive mapping... But to answer your questions...

file1 is a new Server 2012 (R2 ?) - Server 2012 DataCenter
what OS is pond-server? Server 2008 R2

Is pond-server the main domain controller? YES

Is file1 a member server or another domain controller on the same domain? member server

Are there other servers on the domain? yes

Has the script EVER worked properly, or has this started since adding file1 ? Script always worked when the shared were on pond-server and a different DC.  I consolidated and created one file server and for the most part, the only part of the script that is not working is "fully" is:
net use V: \\file1\scanned_documents.

I am at a loss, I am wondering if it is an issue with 2008\2012...  (BTW, I hate server 2012, just wanted to throw that out there...)
0
 

Author Comment

by:sXmont1j6
Comment Utility
Hmmm... I think I just found an issue... pinged domain.com from my workstation came up with pond-server's IP address.  Pinged domain.com from file1 and it came back with a different DC's IP address...
0
 
LVL 26

Expert Comment

by:pony10us
Comment Utility
That really shouldn't matter.  For example, I just pinged domain.com on a TS and it returned the IP of a non-DC.  Did the same from the workstation side (where I have the TS session running) and it returned the IP of the main DC.
0
 

Author Comment

by:sXmont1j6
Comment Utility
I am just really confused why my V drive is not mapping.  The issue is so inconsistent.  But effects about 18-10 users daily.  The only variable is that the V drive is a VERY large share folder.  But, that should not matter at all, correct?
0
 
LVL 26

Expert Comment

by:pony10us
Comment Utility
When you say VERY large I am going to step back and say that ours are probably no where near the size of yours.  We maintain right around 40GB on all our shares except one. That one is a SAMBA share that is used for passing data between Windows and AIX and doesn't really store any data.

It does sound like it may be related to the size of the share. Especially since it appears that the other mappings to the same server appear to be functional (at least most of the time?)

Can you try and map somewhere further down in the structure and see if the issue persists?
0
 

Accepted Solution

by:
sXmont1j6 earned 0 total points
Comment Utility
This problem has been resolved by re-creating the share.
0
 

Author Closing Comment

by:sXmont1j6
Comment Utility
None of the above answers assisted.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
Trying to figure out group policy inheritance and which settings apply where can be a chore.  Here's a very simple summary I've written which might help.  Keep in mind, this is just a high-level conceptual overview where I try to avoid getting bogge…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

771 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

11 Experts available now in Live!

Get 1:1 Help Now