Solved

Map drive to different targets depending on localhost name

Posted on 2016-10-03
4
69 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
ID: 41827539
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
ID: 41827554
How about using Group Policy Preference and then set the WMI filter ?
1
 
LVL 27

Expert Comment

by:masnrock
ID: 41830651
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
ID: 41848942
thank you both for your input.

DirkMare
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to decline Windows updates with SCCM? 2 60
Setup new Win2012 DC, remove SBS 2011 5 23
Bandwidth Hugers how to find them 9 50
Remote Desktop not working 22 63
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
An article on effective troubleshooting
In this Micro Tutorial viewers will learn how to use Windows Server Backup to create full image of their system. Tutorial shows how to install Windows Server Backup Feature on Windows 2012R2 and how to configure scheduled Bare Metal Recovery backup.…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…

697 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