Created
November 15, 2022 11:32
-
-
Save sheepla/3f0131a4f9e20a5cd7af8c5eceb0f57f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.DESCRIPTION | |
Get Remote Desktop Server configuration | |
#> | |
$reg = Get-Item 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\' | |
[pscustomobject] @{ | |
ListenPort = $reg.GetValue("PortNumber") | |
AvailableUsers = @( | |
(Get-LocalGroupMember "Administrators").Name, | |
(Get-LocalGroupMember "Remote Desktop Users").Name | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment