Add-ADTSInfo.ps1 adds TerminalServicesHomeDrive, TerminalServicesHomeDirectory, TerminalServicesProfilePath and AllowLogon as additional members returned by a query of Active Directory user objects. As you may know, when looking at a user’s properties in the Active Directory Users and Computers MMC there is a tab for these fields. However, if you look at the properties of a user object, these items simply aren’t there. There are a few articles and scripts addressing this problem, and you will find that the only way to get the data is by binding to each individual user object and using the a method like this: $ADSIUser.psbase.InvokeGet(‘TerminalServicesProfilePath’).
My script differs from others in that you can pipe an object containing user objects with any properties, and it will add the fields listed above to your results.
Get-ADUser -Filter * -server 'Contoso.com' | Add-ADTSInfo
The new object property names are sorted. This is an advanced function with comment based help.