Solved

Delete Mapped Network Drive & Connect to new Nework Share on same drive letter - Net Use Logon batch file

Posted on 2011-09-12
15
612 Views
Last Modified: 2012-05-12
I have a logon batch file to map a newtork share.  The file share was moved to a new server.  I need to change the logon batch file to delete the old mapped drive and connect to the new file share on the same drive letter.  

net use z: /delete
net use z: "\\server\share name" /persistent:yes

When I run this it doesn't do anything.  
I can manually enter the commands in a command prompt window and it works fine.  

It's just an old batch file and I need to get it fixed ASAP.  
0
Comment
Question by:ehess
[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
  • 6
15 Comments
 
LVL 1

Author Comment

by:ehess
ID: 36526546
I had been testing on my Windows 7 workstation and just tried it on an XP box.  It worked, must be a privilege level.  If anyone has any better ways to do this with a logon script, please post it.  
0
 
LVL 23

Expert Comment

by:yo_bee
ID: 36526553
What does this work on XP or W7?
0
 
LVL 23

Expert Comment

by:yo_bee
ID: 36526569
Do you have a Domain with GPO's in place?
Add RSAT to your W7 machine and use GPP Drive Mappings
http://blogs.technet.com/b/askds/archive/2009/01/07/using-group-policy-preferences-to-map-drives-based-on-group-membership.aspx
You can all use a standard batch
Net use * /d /y

Rem Remap
Net Use n: "\\unc"
and so on.
0
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
LVL 1

Author Comment

by:ehess
ID: 36526628
it works on xp.  i do have a domain with gpos in place.
0
 
LVL 23

Accepted Solution

by:
yo_bee earned 450 total points
ID: 36526648
download RSAT for Windows 7  and create a GPP for Drive mapping.  This will give you much more flexibility for controlling and managing your domain machines.


For this to work on XP you will need to install Group Policy Client side Extension.

What error are you getting when you using the Bat logon script for your W7 machines?
0
 
LVL 1

Author Comment

by:ehess
ID: 36526670
I've placed the policy on the Server 2008 GPO for the affected group.  I'll find out tomorrow if it is working for the users.  
0
 
LVL 23

Expert Comment

by:yo_bee
ID: 36526679
should work as long as your GPO applies to the proper OU.
0
 
LVL 23

Assisted Solution

by:yo_bee
yo_bee earned 450 total points
ID: 36526964
0
 
LVL 9

Assisted Solution

by:djpazza
djpazza earned 50 total points
ID: 36528288
Its probably a permission problem / user account control.  When you type the commands manually and it works are you running the cmd as administrator?.
0
 
LVL 1

Author Comment

by:ehess
ID: 36530677
I have setup the Map Drive in the GPO, but it still isn't showing the new server share.  I have verified the GPO is applying for the user and already ran the gpupdate /force.
0
 
LVL 1

Author Closing Comment

by:ehess
ID: 36530906
On the GPO setting I did check the Run in logged-on user's security context on the Common tab.  

The drive still wasn't mapping so I went back to the old batch file to run as the logon script.  The logon script also has a time source setting which requires admin priv. so that explains why it gets an error on W7.  

I'll create a test GPO and get that working for the drive map, but for now the end users have the correct server share when they logon.
0
 
LVL 23

Expert Comment

by:yo_bee
ID: 36531001
can you post some screenshots of the GPO as well as the OU structure?
0
 
LVL 23

Expert Comment

by:yo_bee
ID: 36531004
I did not see that this was accepted.
Please ignore my last post.
0
 
LVL 1

Author Comment

by:ehess
ID: 36550907
I am pleased to report that the GPO drive mapping works properly.  
0
 
LVL 23

Expert Comment

by:yo_bee
ID: 36550979
That is  wonderful.
GPP is a real help.  It took the place of custom scripting, which is not to know, but if it can be completed easier more power.

0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
Uncontrolled local administrators groups within any organization pose a huge security risk. Because these groups are locally managed it becomes difficult to audit and maintain them.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

688 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