How to map a users home directory and remove unwanted drive mappings.

I'm having some problems mapping a user's Home Folder (via the profile tab under user properties), and also running a login script which deletes unwanted drive mappings and maps new drives.  I need to run a login script to remove old drive mappings, but I'd like to be able to specify the users Home Folder under the profile tab.

Our login script contains (net use * /d /y) which we want to disconnect all current drives.  Then the script begins reconnecting several mapped drives per user.  The script appears to work well, however when we use it in conjunction with specifing a Home Folder (user profile), the home folder will not map.

Alternatively, if we choose to omit the login script, the Home Folder mapping works perfectly.

Is there a way to use the two together?  We would like to know how or what sequence we need to use in order to map the Home Folder, and then delete current drives and remap new ones.

Thanks!
esckeyrwmAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NJComputerNetworksCommented:
typically, you wouldn't delete all workstation mappings as users may require some locally mapped drives...  Maybe do something like this:

net use f: /d /y
net use g: /d /y

net use i: /d /y
net use j: /d /y
net use k: /d /y
net use l: /d /y
net use m: /d /y
net use n: /d /y


In this example, I am assuming that you are using H: drive letter in your profile settings.  Notice H: was not targeted for deletion.
TheCleanerCommented:
Just like NJ said...

I believe the Home Folder mapping takes place BEFORE the login script runs, so you are essentially deleting it with your current script.

so do like NJ said, then at the end of that script map back the drives that are needed...
esckeyrwmAuthor Commented:
Well, the problem is that a large number of users who have mapped drives and we don't know what all of the drive mappings are (and they are not consistant between each other).  So if it is true that the Home Folder mapping takes place before the login script runs, how can we switch it so that the Home Folder maps AFTER the login script?
The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

TheCleanerCommented:
I see...

I *think* you can do it if you put your login script that kills all drive mappings in the "computer configuration" startup login script.

I honestly don't know if that will work or not, but it's worth a shot.  My theory is that it will remove any existing drive mappings on the computer before the user authenticates to the domain.  However, my anti-theory is that the computer login script won't matter because drive mappings are user based.

heh...worth a shot I guess.  Throw it up in a test world and see what happens.
NJComputerNetworksCommented:
"anti-theory..."   lol
NJComputerNetworksCommented:
"So if it is true that the Home Folder mapping takes place before the login script runs, how can we switch it so that the Home Folder maps AFTER the login script?"  You can't....


In your situation, you can not use the

net use * /d /y

Do all of your users get connected to the home folder using the same network drive?  Like H:?  If so, do this in your logon script:

net use f: /d /y
net use g: /d /y

net use i: /d /y
net use j: /d /y
net use k: /d /y
net use l: /d /y
net use m: /d /y
net use n: /d /y
net use o: /d /y
net use p: /d /y
net use q: /d /y
net use r: /d /y
net use s: /d /y
net use t: /d /y
net use u: /d /y
net use v: /d /y
net use w: /d /y
net use x: /d /y
net use y: /d /y
net use z: /d /y

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TheCleanerCommented:
:)  like that word huh?

NJ, what he's saying is that some people have already mapped H: to something else persistently...so the user profile doesn't map the drive...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2003

From novice to tech pro — start learning today.