Get users in OU with homedir mapped Tagged: Get users in OU with homedir mapped. This topic contains 4 replies, has 3 voices, and was last updated by Mark Prior 3 months, 4 weeks ago. Author Posts April 21, 2017 at 10:36 am #69148 Brian PetersenParticipant Hi, I have a OU, with 2500 users. By error, SOME of them have a mapped homedir! but i dont want to go through each user to find WHO has and WHO has not. I really need help with Building a script to export all users in the OU, together with thier homedrive. (if mapped or not) og similar solution. Just exported as a list.txt or similar. So i can get the users, which has a mapped homedrive on thier profile and reset these with a powershell script, i allready have. To save ALOT of time. Can someone help me with this fetch script? 😕 Thx April 21, 2017 at 11:20 am #69154 Mark PriorParticipant Should get you what your after #Select OU $OU = "OU=Users,OU=Newcastle,OU=United Kingdom,OU=Europe,DC=contoso,DC=microsoft,DC=com" #GetDetails Get-ADUser -filter * -SearchBase $ou -Properties homeDirectory, canonicalname, homedirectory | Select-Object name,homedirectory,canonicalname | Out-GridView April 24, 2017 at 7:34 am #69321 Brian PetersenParticipant Hi Mark, Perfect, it Works perfect 🙂 But could you output the AD user login name instead of realname? Then it would be so cool. April 24, 2017 at 8:19 am #69325 Aleksandras ArtemjevasParticipant Hey, Just change Select-Object name with Select-Object samaccountname April 24, 2017 at 10:18 am #69330 Mark PriorParticipant Yep as above just replace or even add after select #Select OU $OU = "OU=Users,OU=Newcastle,OU=United Kingdom,OU=Europe,DC=contoso,DC=microsoft,DC=com" #GetDetails Get-ADUser -filter * -SearchBase $ou -Properties homeDirectory, canonicalname, homedirectory | Select-Object samaccountname,homedirectory,canonicalname | Out-GridView Author Posts You must be logged in to reply to this topic.