Solved

PowerShell Script Help to Setup Domain Users Home Drives

Posted on 2014-10-27
2
223 Views
Last Modified: 2014-10-27
I have a simple PowerShell Script that does work but it only works for individual user names, was hoping to get assistance on setting it up for all Domain Users.

Set-ADUser -identity "UserName" -homeDrive h: -homeDir "\\ServerName\User$"

We currently have all Home Drive's being mapped via Logon Scripts but we are migrating over to DFS instead. In turn I need to add the new share locations once it is ready for all users in the domain.

There will be multiple share locations but I was thinking the easiest way would be to use share name itself once completed.

Thanks again for your help.
0
Comment
Question by:robertarenson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 29

Accepted Solution

by:
becraig earned 500 total points
ID: 40407101
You could just do a get-aduser and pipe it into your set-aduser

get-aduser -filter * | %  {$userdir = $_.samaccountname + "$"; Set-ADUser -identity $_.samaccountname -homeDrive h: -homeDir "\\ServerName\$userdir"}

Open in new window

0
 

Author Closing Comment

by:robertarenson
ID: 40407447
Thank you very much
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

"Migrate" an SMTP relay receive connector to a new server using info from an old server.
Synchronize a new Active Directory domain with an existing Office 365 tenant
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

730 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