How to Change the RDP Port for a Windows Server?

In this era, security is a big question for all the orgnization. By default the RDP port is 3389 and to secure the first thing that come to our mind that is there a way that we can modify the port for the RDP access to add an extra layer of security.

Port numbers in computer networking represent communication endpoints. Ports are unsigned 16-bit integers (0-65535) that identify a specific process or network service. IANA is responsible for internet protocol resources, including the registration of commonly used port numbers for well-known Internet services.

  1. Well Known Ports: 0 through 1023.
  2. Registered Ports: 1024 through 49151.
  3. Dynamic/Private : 49152 through 65535.

TCP ports use the Transmission Control Protocol, the most commonly used protocol on the Internet and any TCP/IP network. TCP enables two hosts to establish a connection and exchange streams of data. TCP guarantees delivery of data and that packets will be delivered in the same order in which they were sent. Guaranteed communication/delivery is the key difference between TCP and UDP.

UDP ports use the Datagram Protocol. Like TCP, UDP is used in combination with IP (the Internet Protocol) and facilitates the transmission of datagrams from one computer to applications on another computer, but unlike TCP, UDP is connectionless and does not guarantee reliable communication; it's up to the application that received the message to process any errors and verify correct delivery. UDP is often used with time-sensitive applications, such as audio/video streaming and realtime gaming, where dropping some packets is preferable to waiting for delayed data.

Changing the RDP from Registry first

Press “Windows + R” to open the Windows Run dialog. Type “regedit” in the Run box and press Enter to open Windows Registry Editor.

Once the wizard open navigate to the below location:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\PortNumber

Right click on PortNumber and Edit > Select Decimal Type > Create a new port number that you want, and then click OK.

Changing the RDP From Firewall

The newly set RDP port must be open in the firewall before it can be used. About how to open a port in Windows Firewall, please refer to

Changing the RDP from PowerShell

  1. Open PowerShell as an administrator
  2. Run this command Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -Name 'portnumber' -Value XYZ

Once all this is done, we need to restart the Remote Desktop Service to get that affective. And, now to access through RDP we need to make a bit change that is abc.india.com:portnumber

Enable advance scaling feature in windows server 2019.

We have many complaints about DPI settings that can no longer be set in Windows server 2019 as in 2008R2. Having this feature is best in the case of a large screen. It only occurs with the remote desktop session. Because the remote control session display settings feature cannot change.

Windows Server 2008 R2 has a feature to set up the solution after logging in to a remote desktop session. But, Windows Server 2019 does not have that feature. Also, it is a big problem for those who use the big screen in their work.

The RDP conform is in line with the local. Thus, by changing the local system configuration we may find it running on a remote server. So, here comes the preview rating system for Windows Server 2019 which has a rating scale from 100-500.

To make RDSH functioning with DPI for Windows server 2019 RDSH we need to add a registry code:

Registry Hive HKEY_LOCAL_MACHINE
Registry Path SYSTEM\ CurrentControlSet\ Control\ Terminal Server\ WinStations
Value Name IgnoreClientDesktopScaleFactor
Value Type REG_DWORD
Enabled Value 1
Disabled Value 0

After making the above changes, new sessions should have the ability to use DPI. To check it we need to sign out from the system and sign back in.

Please try and answer if you are able to deal with this problem using the above procedure.

Why and how to change the password of a computer?

As we all know that password is a part of security. We must change our password to ensure the security of the computer account. If we do not change the password on a regular basis, your familiarity with your password would eventually lead to its compromise. Hackers use automated tools to guess password.

In this modern era, we use computer, and server to carry a lot of our sensitive data, so keeping work data safe is major priority. Changing the password avoids a number of dangers – including some that are less obvious, such as what happens to the password you have saved on computer you no longer own.

Giving someone a computer with saved passwords is like giving them access to your accounts. Consistently changing your passwords will mean that even if someone has found an old password of yours, it will no longer be relevant or useful.

Process 1.

  1. To change your remote server password, press the ctrl-alt-end keys all at the same time on your computer keyboard.
    • To change your local computer password, press the ctrl-alt-del keys all at the same time on your computer keyboard.
  2. Choose the Change Password option that appears on the screen.
  3. The Change Password dialog box will appear. Enter your current password, along with your new password twice.
    • Please note that campus passwords for faculty and staff need to be at least 8 characters long, cannot closely resemble a previous password and must contain 3 out of 4 of the following items: lowercase, uppercase, number and symbol.
  4. Hit the Arrow button next to the last password box, and your password should be changed.
  5. Log Out/Sign Out of the computer and log back in, to verify that your password change has gone into effect.

Process 2.

  1. Open notepad
  2. Paste this VBScript
  3. Set objShell = CreateObject("Shell.Application")

    objShell.WindowsSecurity()

  4. Click on File
  5. Save As
  6. Browse your Desktop
  7. Name its Password Change.vbs
  8. Save
  9. Close the text file and go to your desktop and double click on it
  10. The Change Password dialog box will appear. Enter your current password, along with your new password twice.
    • Please note that campus passwords for faculty and staff need to be at least 8 characters long, cannot closely resemble a previous password and must contain 3 out of 4 of the following items: lowercase, uppercase, number and symbol.
  11. Hit the Arrow button next to the last password box, and your password should be changed.
  12. Log Out/Sign Out of the computer and log back in, to verify that your password change has gone into effect.

Process 3.

    To change a local account password, use these steps:

  1. Open Settings
  2. Click on Accounts
  3. Click on Sign-in options
  4. Under the "Manage how you sign in to your device" section, select the Password option
  5. Click the Change button
  6. If you are on local computer

    If you are on a remote computer
  7. Confirm your current password
  8. Click the Next button
  9. Create a new password
  10. Specify a password hint that won't make it easier for others to guess your secret phrase
  11. Click the Next button
  12. Click the Finish button
  13. After you complete the steps, the password will change in your local account

Process 4.

  1. Open command Prompt as an administrator
  2. Type net user and hit enter to find the username of which you want to change the password for
  3. net user username create-a-new-password
    • If username is in two part like AJ Tiwari, you need to user inverted comma and then the user name will be like "AJ Tiwari"
  4. net user "AJ Tiwari" Admin@123
    • If username is Administrator (In one word only), no need to use inverted comma.
  5. net user Administrator Admin@123

How to restrict users to shut down or restart the workstation or server?

It is a security policy that is being used by the cloud hosting companies to restrict the user to have a limited permission in order to perfrom a task related to restart of the system.

You can set the permissions to restart or shutdown Windows using the Shut down the system parameter in the Group Policy editor.

  1. Open Group Policy Editor
  2. Computer Configuration
  3. Windows Settings
  4. Security Settings
  5. Local Policies
  6. User Rights Assignment

From the right pane double click on "Shut down the system".

From this box we can add or remove the users and group that we need it to. Once it is done need to sign out from the system and login back so that the changes got applicable.😁

Auto Mouse Mover: Utility to Move Mouse Automatically

Auto Mouse Mover: Utility to Move Mouse Automatically

Auto Mouse Mover: Utility to Move Mouse Automatically

Auto Mouse Mover Software Utility allows you to move the mouse automatically which prevents your computer from logging off. Auto Mouse Software works with all Windows Operating Systems including Windows 10, Windows 8.1, Windows 2000, Windows 7 and other Windows versions. Auto Mouse mover software allows you to move your mouse after a fixed time that will keep your screen active all the time without logging off the computer.

There are lot more softwares in the market to make it working, but today here I will provide you a script that will allow to move your cursor automatically.

Add-Type -AssemblyName System.Windows.Forms

while ($true)
{
$Pos = [System.Windows.Forms.Cursor]::Position
$x = ($pos.X % 500) + 10
$y = ($pos.Y % 500) + 10
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point($x, $y)
Start-Sleep -Seconds 10
}

We can change the value as per the need like axis (Mathematical language) or direction and also the start-sleep second. As per the need cursor move dimention can be modified.

$x = ($pos.X % 500) + 15

$y = ($pos.Y % 500) + 15

Clipboard setting in Workstation and Server

Clipboard setting in Workstation and Server.

This policy setting determines whether history of Clipboard contents can be stored in memory.

Clipboard history first appeared in Windows 10’s October 2018 Update (Version 1809). Currently, Clipboard history supports text, HTML, and images less than 4 MB in size. Larger items won’t be stored in the history.

Clipboard history stores a maximum of 25 entries, with the oldest items disappearing as new ones appear. Also, unless an item is pinned to the Clipboard, the Clipboard history list will reset every time you restart your computer or device.

The clipboard can save multiple items (text and images) that were copied and sync them across devices. This may inevitably cause your sensitive data appear in the clipboard history. In this tutorial we’ll show you multiple easy ways to disable clipboard history for Windows 10 and Windows server 2012 and on.

Process 1

By using the system setting we can diable the feature of copy and Paste. Open Setting (Windows Key+I) > System > Clipboard > Uncheck the "Clipboard history"

Process 2

By using the system registry this policy can be restricted for a Windows user.

Registry Hive HKEY_LOCAL_MACHINE
Registry Path SOFTWARE\Policies\Microsoft\Windows\System
Value Name AllowClipboardHistory
Value Type REG_DWORD
Enabled Value 1
Disabled Value 0

Process 3

For Windows User

  1. Local Group Policy Editor
  2. Computer Configuration
  3. Administrative Templates
  4. System
  5. OS Policies
  6. Allow Clipboard History

As per the need change the setting. And, do reboot of the system to take the effect.

For Windows Server User

  1. Local Group Policy Editor
  2. Computer Configuration
  3. Administrative Templates
  4. Windows Components
  5. Remote Desktop Services
  6. Remote Desktop Session Host
  7. Device and Resource Redirection
  8. Do not Allow Clipboard History

As per the need change the setting. And, do reboot of the system to take the effect.

Process 4

This is the most important process that you can use for a particular user to make that feature enable or disable. First of all, need to identify the security identifier number (SID) and then proceed accordingly.

Get SID number: - HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\ProfileList

Registry Hive HKEY_LOCAL_MACHINE
Registry Path Software\Microsoft\Windows NT\CurrentVersion\ProfileList

Under profile list you will see the so many other keys. You only need to select the key to whom that SSID relates. Once you select the SSID check the right pane the value of Profile image path, and that will help you to understand the SSID number for the user you are looking for.

Once you have the SID number, need to login with the user you want to disable the feature of Clipboard. After logging to that account follow the steps given below to make this working.

Registry Hive HKEY_Users
Registry Path SID Number\SOFTWARE\Policies\Microsoft\Windows\System
Value Name AllowClipboardHistory
Value Type REG_DWORD
Enabled Value 1
Disabled Value 0

Hope, this help you a lot and let me knowi if you have any suggesstion.

Transferring Files From Local Computer to Connected Remote Desktop Session

Transfer data from Remote computer to Local computer and Local computer to Remote Computer without any aditional software.

It’s quite easy to transfer files between computers on the network, all you have to do is map your local drive where your folder is available for keep the transferred data files.

Windows Remote Desktop actually has a feature built in that allows you to share any of the local drives on the host computer with the remote computer without having to manually share specific folders or drives.

For the security reasons most of the users keep this function disabled for their environement. It can be disable and enable with system settings.

1. You can start the Remote Desktop Connection from Start > All Programs > Accessories > Remote Desktop Connection or run Mstsc.exe from the Run dialog or Search box. The window will show the current connection in the computer box or you can select a previous session from the drop down.

2. Click the Show options button at the bottom left.

3. This will display the connection preferences, click on the Local Resources tab. Look near the bottom in the section “Local devices and resources” and click the More button.

4. An entry called Drives will be in the list, if you tick that all drives will be mapped to the Remote Desktop and shared. If you only want to share specific drives which is safer, click the + to the left and expand the drives list, then you can specifically tick which drives that need to be shared, including ROM drives and USB flash drives the haven’t been inserted yet (Drives that I plug in later). Click OK when you’re done.

5. Upon trying to connect you will be asked if you trust the remote connection and clicking Show Details will show that it’s trying to share your drives. If you’re happy then tick the box to not be asked again and press Connect.

After a successful connection go to Computer or This PC on the remote computer and under Other you should see the shared drives. Now you can start transferring files to and from your remote computer.

After all these stuff there is a native coomand line script that we use for this process.


Remote computer to Local computer:

IF EXIST "Location 1" Xcopy /D "Location 1" "\\tsclient\Location 2"

Location 1: - Data folder location on Remote Computer. The location where the data file is stored on remote computer. 

Location 2: - Data folder location on Local Computer. Where the data will move. Please make sure the location should be like this: E\Data not E:\Data.

Example: - IF EXIST "C:\Users\Username\Desktop\data" Xcopy /D "C:\Users\Username\Desktop\data" "\\tsclient\E\Data"


Local computer to Remote Computer:

IF EXIST "\\tsclient\Location 2" Xcopy /D "\\tsclient\Location 2" "Location 1"

Location 1: - Data folder location on Remote Computer. The location where the data file is stored on remote computer. 

Location 2: - Data folder location on Local Computer. Where the data will move. Please make sure the location should be like this: E\Data not E:\Data.

Example: - IF EXIST "\\tsclient\E\Data" Xcopy /D "\\tsclient\E\Data" "C:\Users\Username\Desktop\data"


There is another process that we can follow-up with to move the data file within these two environement. If the Clipboard function is on from the RDP then this feature (Copy and Paste) will work for sure. Youc an see the attched image for more clarification.