?
Solved

PowerShell Script Help to Setup Domain Users Home Drives

Posted on 2014-10-27
2
Medium Priority
?
231 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 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

765 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