Login Script with Logic - Map Network Drives

Rammy Charles
Rammy Charles used Ask the Experts™
We are currently looking for a way to tie a standard login script to a user account with some logic built in. For example, depending on the host name of the machine that the account is logging into, we would like different network drives mapped. However, we would like to leverage one central log in script for this.

Any ideas as to how to accomplish this?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2015

Use GPO Preferencess.

You have the possibility setting up a lot of conditions, when and how the drive Will be mapped.

Sales Engineer
Thanks. Just to clarify, we would want to add conditional logic. For example:

IF hostname = DEV-XXX
Then map Drive A
IF hostname = Prod-XXX
Then map Drive B

I'm not sure how I can do this with GPO without having to create separate policies, which we would like to avoid.
Top Expert 2015
Are the computers in different OU?

You could run a powershell script to add computers with DEV-XXX to one group and Prod-XXX to another and then create 2 GPO Preferences (map network drive) targeting security group.
Rammy CharlesSales Engineer


This worked

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial