Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 95
  • Last Modified:

Map drive to different targets depending on localhost name

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
Dirk Mare
Asked:
Dirk Mare
2 Solutions
 
Michael PfisterCommented:
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
 
Senior IT System EngineerIT ProfessionalCommented:
How about using Group Policy Preference and then set the WMI filter ?
1
 
masnrockCommented:
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
 
Dirk MareSystems Engineer (Acting IT Manager)Author Commented:
thank you both for your input.

DirkMare
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now