Networking Forums

Networking Forums > Computer Networking > Windows Networking > SSH command to enable MS Remote Desktop

Reply
Thread Tools Display Modes

SSH command to enable MS Remote Desktop

 
 
Brett Evanson
Guest
Posts: n/a

 
      10-17-2005, 10:17 PM
Everyone-
I was wondering if there is a command to enable remote desktop on a remote
machine with some kind of ssh command. Obviously this might have some
security implications, but I just want to know if it can be done and how to
prevent it from happening.

Brett


 
Reply With Quote
 
 
 
 
Miha Pihler [MVP]
Guest
Posts: n/a

 
      10-18-2005, 06:34 AM
Hi Brett,

Here is VBS script that would enable Remote Desktop on remote PC.

********************
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colTSSettings =
objWMIService.InstancesOf("Win32_TerminalServiceSe tting")
For Each colTS in colTSSettings
colTS.SetAllowTSConnections(1)
Next
********************

Replace "." in strComputer with name of computer where you want to enable
RDP. If you do not, the script will try to enable RDP on local PC where the
script is run.

Note: if remote PC has personal firewall enabled, the script will not work.

I also posted it here http://freeweb.siol.net/mpihler/rdp.txt

--
Mike
Microsoft MVP - Windows Security

"Brett Evanson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Everyone-
> I was wondering if there is a command to enable remote desktop on a remote
> machine with some kind of ssh command. Obviously this might have some
> security implications, but I just want to know if it can be done and how
> to
> prevent it from happening.
>
> Brett
>
>



 
Reply With Quote
 
Brett Evanson
Guest
Posts: n/a

 
      10-18-2005, 03:56 PM
I tried using this script on various computers all wrapped inside a <script
language="VBScript"> tag. Is this how it should work, or am I missing
something? I would like to be able to use it to enable a local user or a
remote user, depending on what i need. thanks again for your expertise.

Brett


"Miha Pihler [MVP]" <mihap-(E-Mail Removed)> wrote in message
news:uN2d%(E-Mail Removed)...
> Hi Brett,
>
> Here is VBS script that would enable Remote Desktop on remote PC.
>
> ********************
> strComputer = "."
> Set objWMIService = GetObject("winmgmts:" _
> & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
> Set colTSSettings =
> objWMIService.InstancesOf("Win32_TerminalServiceSe tting")
> For Each colTS in colTSSettings
> colTS.SetAllowTSConnections(1)
> Next
> ********************
>
> Replace "." in strComputer with name of computer where you want to enable
> RDP. If you do not, the script will try to enable RDP on local PC where
> the
> script is run.
>
> Note: if remote PC has personal firewall enabled, the script will not
> work.
>
> I also posted it here http://freeweb.siol.net/mpihler/rdp.txt
>
> --
> Mike
> Microsoft MVP - Windows Security
>
> "Brett Evanson" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Everyone-
>> I was wondering if there is a command to enable remote desktop on a
>> remote
>> machine with some kind of ssh command. Obviously this might have some
>> security implications, but I just want to know if it can be done and how
>> to
>> prevent it from happening.
>>
>> Brett
>>
>>

>
>



 
Reply With Quote
 
Miha Pihler [MVP]
Guest
Posts: n/a

 
      10-18-2005, 04:37 PM
Hi,

All you need to do is copy the script from the website (recommended) and
paste it into e.g. notepad. Save the file as e.g. rdp.vbs and double click
on it. No need to edit the script unless you want to enable RDP on remote
C -- in which case you only need to edit the script to tell it which PC it
should enable RDP.

--
Mike
Microsoft MVP - Windows Security

"Brett Evanson" <(E-Mail Removed)> wrote in message
news:%23nLGMy$(E-Mail Removed)...
>I tried using this script on various computers all wrapped inside a <script
> language="VBScript"> tag. Is this how it should work, or am I missing
> something? I would like to be able to use it to enable a local user or a
> remote user, depending on what i need. thanks again for your expertise.
>
> Brett
>
>
> "Miha Pihler [MVP]" <mihap-(E-Mail Removed)> wrote in message
> news:uN2d%(E-Mail Removed)...
>> Hi Brett,
>>
>> Here is VBS script that would enable Remote Desktop on remote PC.
>>
>> ********************
>> strComputer = "."
>> Set objWMIService = GetObject("winmgmts:" _
>> & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
>> Set colTSSettings =
>> objWMIService.InstancesOf("Win32_TerminalServiceSe tting")
>> For Each colTS in colTSSettings
>> colTS.SetAllowTSConnections(1)
>> Next
>> ********************
>>
>> Replace "." in strComputer with name of computer where you want to enable
>> RDP. If you do not, the script will try to enable RDP on local PC where
>> the
>> script is run.
>>
>> Note: if remote PC has personal firewall enabled, the script will not
>> work.
>>
>> I also posted it here http://freeweb.siol.net/mpihler/rdp.txt
>>
>> --
>> Mike
>> Microsoft MVP - Windows Security
>>
>> "Brett Evanson" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> Everyone-
>>> I was wondering if there is a command to enable remote desktop on a
>>> remote
>>> machine with some kind of ssh command. Obviously this might have some
>>> security implications, but I just want to know if it can be done and how
>>> to
>>> prevent it from happening.
>>>
>>> Brett
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Brett Evanson
Guest
Posts: n/a

 
      10-18-2005, 04:49 PM
That worked! Thanks a million.

Brett

"Miha Pihler [MVP]" <mihap-(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> All you need to do is copy the script from the website (recommended) and
> paste it into e.g. notepad. Save the file as e.g. rdp.vbs and double click
> on it. No need to edit the script unless you want to enable RDP on remote
> C -- in which case you only need to edit the script to tell it which PC
> it
> should enable RDP.
>
> --
> Mike
> Microsoft MVP - Windows Security
>
> "Brett Evanson" <(E-Mail Removed)> wrote in message
> news:%23nLGMy$(E-Mail Removed)...
>>I tried using this script on various computers all wrapped inside a
>><script
>> language="VBScript"> tag. Is this how it should work, or am I missing
>> something? I would like to be able to use it to enable a local user or a
>> remote user, depending on what i need. thanks again for your expertise.
>>
>> Brett
>>
>>
>> "Miha Pihler [MVP]" <mihap-(E-Mail Removed)> wrote in message
>> news:uN2d%(E-Mail Removed)...
>>> Hi Brett,
>>>
>>> Here is VBS script that would enable Remote Desktop on remote PC.
>>>
>>> ********************
>>> strComputer = "."
>>> Set objWMIService = GetObject("winmgmts:" _
>>> & "{impersonationLevel=impersonate}!\\" & strComputer &
>>> "\root\cimv2")
>>> Set colTSSettings =
>>> objWMIService.InstancesOf("Win32_TerminalServiceSe tting")
>>> For Each colTS in colTSSettings
>>> colTS.SetAllowTSConnections(1)
>>> Next
>>> ********************
>>>
>>> Replace "." in strComputer with name of computer where you want to
>>> enable
>>> RDP. If you do not, the script will try to enable RDP on local PC where
>>> the
>>> script is run.
>>>
>>> Note: if remote PC has personal firewall enabled, the script will not
>>> work.
>>>
>>> I also posted it here http://freeweb.siol.net/mpihler/rdp.txt
>>>
>>> --
>>> Mike
>>> Microsoft MVP - Windows Security
>>>
>>> "Brett Evanson" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> Everyone-
>>>> I was wondering if there is a command to enable remote desktop on a
>>>> remote
>>>> machine with some kind of ssh command. Obviously this might have some
>>>> security implications, but I just want to know if it can be done and
>>>> how
>>>> to
>>>> prevent it from happening.
>>>>
>>>> Brett
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Client for Microsoft Networks - Enable/Disable From Command-Line Rob Lowe Windows Networking 1 02-26-2009 08:51 PM
a script to enable remote desktop at registery!!! Ahmad Sabry Windows Networking 1 06-26-2007 09:14 PM
possible to disable/enable wireless network adapter via command? Arno Wireless Networks 1 04-26-2005 12:39 PM
How to enable/disable network adpaters with command prompt steve Broadband Hardware 0 09-23-2004 05:55 PM
How to Disable/Enable Ethernet adapter under command line Cliff Wang Windows Networking 0 05-21-2004 03:50 PM



1 2 3 4 5 6 7 8 9 10 11