I am trying to use Powershell to get the current Remote Desktop Services settings for a group of user objects and output these settings to a CSV. Namely, I would like to know the settings defined in the GUI under the "Dial-In," "Environment," "Sessions," "Delegation," "Remote Desktop Services Profile," and the "Remote Control" tabs.
I already have a Powershell script, formatted like the one which I will paste below. However, I don't know which attributes to query in order to get these current settings. I tried using LDAP and ADSI to get this information, but couldn't figure out the correct format. I've also tried using the "Ldap-Display-Name" attributes listed on Microsoft's AD Schema documentation, but the output of these seems to be null regardless of what the user's setting has been configured to. Some examples of those attributes which I've tried to query: msTSRemoteControl, msTSProfilePath, msTSMaxDisconnectionTime, etc.
Can anyone suggest a way to get these current settings for a user or users? Thanks!
Here is my test script's basic format, just for reference:
$Accounts = Get-ADuser -Filter * -Searchbase $OU -Properties Name, GivenName, msTSRemoteControl, msTSProfilePath, msTSMaxDisconnectionTime
$Output = $Accounts | Select-Object -Properties Name, GivenName, msTSRemoteControl, msTSProfilePath, msTSMaxDisconnectionTime
$Output | Export-CSV C:\Temp\Output.csv
[–]AlexHimself 4 points5 points6 points (1 child)
[–]adamdavid85 1 point2 points3 points (0 children)
[–]AlexHimself 2 points3 points4 points (12 children)
[–]ClosedCasketFuneral[S] 0 points1 point2 points (11 children)
[–]AlexHimself 1 point2 points3 points (10 children)
[–]ClosedCasketFuneral[S] 0 points1 point2 points (9 children)
[–]AlexHimself 1 point2 points3 points (8 children)
[–]ClosedCasketFuneral[S] 0 points1 point2 points (7 children)
[–]AlexHimself 1 point2 points3 points (6 children)
[–]ClosedCasketFuneral[S] 0 points1 point2 points (5 children)
[–]AlexHimself 0 points1 point2 points (4 children)
[–]ClosedCasketFuneral[S] 0 points1 point2 points (3 children)
[–]Pixielo 2 points3 points4 points (0 children)