![]() You can use parameters like -ComputerName, -Credential, -Verbose, -ErrorAction etc. ![]() You will notice that you have just created a Windows PowerShell cmdlet that will feel and behave like other cmdlets. Now open Windows PowerShell console on your PC and type the following command: Get-Help Enable-RemoteDesktop -Full psm1 which will make it a PowerShell module. Save the code copied to notepad into Enable-RemoteDesktop folder with the name “Enable-RemoteDesktop.psm1” filename. Invoke-Command -ComputerName MyDC1 -ScriptBlock Ĭreate a folder named “ Windows PowerShell” in your Documents folder.Ĭreate another folder named “ Modules” inside Windows PowerShell folder.Ĭreate another folder named “Enable-RemoteDesktop” inside Modules folder. Type the following command in Windows PowerShell: We will also create and enable a rule in Windows Firewall to accept RDP connections. By using simple PowerShell commands we will connect to remote server using WS-Management protocol and set this value to 0. This key accepts boolean value (either 0 or 1) and it is 1 by default which means Remote Desktop connection is disabled. There is a DWORD value named “ fDenyTSConnections” inside ‘ HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server‘. ![]() Before starting, you should know the Registry value which controls the Remote Desktop aka Terminal Services connections in Microsoft Windows (Servers and Clients). In this guide I will tell you how to enable remote desktop when there is no console access to server. If you ever need to enable remote desktop feature on your newly deployed Windows Server 2012 R2 box but you don’t have console access, you can do so by using Windows PowerShell. Latest Windows Server products come with Windows Remote Management (WinRM) enabled by default, but traditional Remote Desktop (RDP) feature is disabled. Enable Remote Desktop on Windows Server 2012 R2 via PowerShell ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |