Greg Altman

IT Leader, Writer, Speaker

Menu
  • Home
  • Speaking
  • About Me
  • Reviews
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

Category: PowerShell

Categories

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

© 2025 Greg Altman | Powered by Minimalist Blog WordPress Theme
%d