Skip to content

Greg Altman

Solutions, Learnings, PowerShell, and random thoughts.

Menu
  • Home
  • Tech Reviews
  • Github Repos
  • About Me
Menu

Powershell Tuesday Quick Tip #4

Posted on March 27, 2018 by Greg Altman

I know, I know- stop using RDP to manage devices. The fact is some tech support issues are solved faster and easier if you just remote into the user’s PC. This is particularly true in a small business where perhaps GoToAssist and other such tools are not in the budget.

But what if the pc doesn’t have RDP enabled? Today’s tip fixes that on domain joined machines.
First let’s check…

[code lang=’powershell’]
$PC = “mycomputer.domain.com”
#Determine if Remote Desktop is enabled – 1= enabled 0= Disabled
Get-WmiObject -Namespace ‘root\cimv2\TerminalServices’ -Class Win32_TerminalServiceSetting -ComputerName $PC -Property allowtsconnections|
Format-List AllowTsConnections
[/code]

Ok so it came back with a 0, let’s correct that.

[code lang=’powershell’]
$PC = “mycomputer.domain.com”
(Get-WmiObject -Namespace ‘root\cimv2\TerminalServices’ -Class Win32_TerminalServiceSetting -ComputerName $PC).setallowtsconnections(1)
[/code]
And done!

Once you’ve finished, if you want, reverse the process with a value of (0) for setallowedtsconnections

Of course – if you CAN, it’s even faster an easier to fix things with Powershell remoting. Sadly, not every application is PSAware 🙁

See you next week!

Share this:

  • Click to share on Bluesky (Opens in new window) Bluesky
  • Click to email a link to a friend (Opens in new window) Email

Like this:

Like Loading...

Related

Disclaimer: The thoughts, ideas and code on this blog are my own and do not represent any employer, past or present. All code is for demonstration and educational purposes only. Use at your own risk

Categories

  • Ad-hoc and Random
  • Blog
  • Career
  • Cloud
  • Events
  • PowerShell
  • Reviews
  • Security
  • Server Stuff
  • Troubleshooting
  • Uncategorized

Overall Rating
0.0
© 2026 Greg Altman | Powered by Minimalist Blog WordPress Theme
%d