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. I added sorting of the new resulting so that the property names are in order. This is an advanced function with comment based help.Script Text