Create a list of the home directories, the home drive and the profile path of all AD users

Should you ever face the problem that you have a complete list  or evaluation of all

  • Usernames
  • Home directories
  • Home drive letter
  • Profile directories

You need your Active Directory user accounts , so you should read this guide briefly. Microsoft delivers with that

dsquery

a command with which you can carry out such an AD evaluation and log the result in a text file . Call to get such a list of home information is.

dsquery user -name “*” -limit 0 | dsget user -samid -hmdir -hmdrv -profile> c: temp home.txt

We have shown you this process once below.

dsquery user name

About the parameters

  • -samid (username)
  • -hmdir (home directory)
  • -hmdrv (home drive)
  • -profile (profile path)

you can determine which information should be included in the output. In our example we have listed all 4 possible values and have the output redirected to a text file called ” home.txt ” in the Temp folder ” C: Temp “.

Depending on the size of the Active Directory , the evaluation can take a few seconds. Then the result looks like this, we simply provided some test data here .

List of AD users with username, home directory, home drive and profile path

As you can see, all necessary information about the user , the home directory , the home drive and also the profile path are contained in the text file. Fields that do not contain any entries in the AD are simply left ” empty “.

The end of the evaluation is then ended with the expression ” dsget was successful “. You can then import this file into Microsoft Excel for further processing or evaluation .

If you are interested in other useful evaluation options of the Active Directory , we recommend the following posts here on Windows FAQ.

– Find outdated computers or users in Active Directory
– Export AD groups to text files using a command
– Which Active Directory (AD) groups a user has (DSGET)
– Count the number of AD (Active Directory) objects using PowerShell
– LastLogon (last login) Determine a user in AD using Get-ADUser
– List AD user accounts that have entered a profile path
– Deactivate user account under Windows 10
– Find out which AD user has never logged on
– Create a list of all XP PCs in AD (Active Directory)

administrator