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
LVL 16
Dirk MareSystems Engineer (Acting IT Manager)Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Michael PfisterConnect With a Mentor Commented:
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 EngineerConnect With a Mentor IT 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
All Courses

From novice to tech pro — start learning today.