Solved

Map drive to different targets depending on localhost name

Posted on 2016-10-03
4
45 Views
Last Modified: 2016-10-18
Hi Experts,

Looking for a script of sorts to map a network drive to site specific storage.

Information:
1 AD domain
3x Sites
2-3 Windows Server per site
1 admin account used to logon to all servers
3x External storage devices per site

What needs to happen in script;
When the admin account logs on to a server that is located in site two the logon script needs to map drive letter H: to that specific site storage.
Same for the rest of the sites.

Was thinking of using a text file with host names but not sure how to link the specific sites.
efspdc = site 2 = edf-syn
hostname = site = storage

Thank You in advance.

DirkMare
0
Comment
Question by:Dirk Mare
4 Comments
 
LVL 28

Accepted Solution

by:
Michael Pfister earned 250 total points
Comment Utility
I'd use a batch script i.e.

If %COMPUTERNAME% == Site1 net use H: /del /y & net use H: \\SERVER1\Share
If %COMPUTERNAME% == Site2 net use H: /del /y & net use H: \\SERVER2\Share
If %COMPUTERNAME% == Site3 net use H: /del /y & net use H: \\SERVER3\Share

Open in new window

1
 
LVL 7

Assisted Solution

by:Senior IT System Engineer
Senior IT System Engineer earned 250 total points
Comment Utility
How about using Group Policy Preference and then set the WMI filter ?
1
 
LVL 20

Expert Comment

by:masnrock
Comment Utility
Either method provided should work, it's just a matter of whether you prefer Group Policy or batch files. Batch files are simpler and generally more predictable.
0
 
LVL 16

Author Comment

by:Dirk Mare
Comment Utility
thank you both for your input.

DirkMare
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
OfficeMate Freezes on login or does not load after login credentials are input.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
This tutorial will walk an individual through the process of installing of Data Protection Manager on a server running Windows Server 2012 R2, including the prerequisites. Microsoft .Net 3.5 is required. To install this feature, go to Server Manager…

772 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

10 Experts available now in Live!

Get 1:1 Help Now