Changing Company Wide AD mapped Home Drives
Posted December 7th, 2008 by Matt ShadboltThis is a quick and easy way to change all of your users mapped home drives without manually editing every user. This is really helpful if your migrating to a new file server.
dsquery user “OU=XYZStaff,OU=XYZOU2,OU=XYZOU1,dc=XYZCorp,dc=local” | dsmod user -hmdrv Z -hmdir \\XYZ-FileServer\Staff\$USERNAME$
Simply, the dsquery grabs all of the user accounts in theĀ XYZStaff OU then pipes the results to the dsmod. The dsmod uses the -hmdrv to apply the mapped drive letter and the -hmdir sets the file server location for the users home drive. Remember, the %username% parameter won’t work in this batch – you need to use the $username$ instead.
Of course you can fine tune your user group by adding parameters to the dsquery user command to ensure you only affect the required user objects.
Tags: DSMOD, DSQUERY, User Home Drives
4 Responses



4 Responses to “Changing Company Wide AD mapped Home Drives”
December 9th, 2008 at 8:58 am
[...] Vote Changing Company Wide AD mapped Home Drives [...]
December 9th, 2008 at 10:17 am
[...] Vote Changing Company Wide AD mapped Home Drives [...]
December 9th, 2008 at 10:44 am
[...] Vote Changing Company Wide AD mapped Home Drives [...]
December 9th, 2008 at 11:17 am
[...] Vote Changing Company Wide AD mapped Home Drives [...]
Leave a Reply