You can follow the steps mentioned below to change the windows 2008 rdp port from command line. The windows “reg” command is used for this purpose.
1) Start command prompt by typing “cmd” in Run .
2) To get the current RDP port number.
REG QUERY "HKLM\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v PortNumber
The above command will display RDP port in hexadecimal format. To convert from hexadecimal to decimal use the python interpreter or some other tools you like,
u1@h1:~$ python -c "print int(0xd3d)" 3389 u1@h1:~$
3) If you want to change the port number to 10000, convert it to hexadecimal format as follows,
u1@h1:~$ python -c "print hex(10000)" 0x2710 u1@h1:~$
Overwrite the data section of key value PortNumber with the new port number(0x2710 = 10000 ).
REG ADD "HKLM\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v PortNumber /t REG_DWORD /d 0x2710 /f
4) Now restart terminal services. If you are logged in using rdp, then
better restart terminal services from “services.msc”
NOTE: Before restarting terminal services make sure that new rdp port is opened in firewall.
net stop TermService /y net start TermService /y
Now verify that its running using “netstat”
netstat -ano|findstr /i "10000"
While using rdesktop to access a windows machine from linux we can specify device redirection(with -r command line option) for a local folder in linux machine. This makes a folder in linux client to be mounted as a share in windows machine, which can be viewed from windows “My Computer”.
The following example demonstrates the procedure to map a directory named “/home/u1” in linux machine to a share named “test” in windows.
The mounted share as viewed from inside the windows machine is shown in the image below,
This option could be used for easily transferring files between linux and windows machine.
In order to change the plesk password of a windows server to “1LOvePl3sk!”(without quotes) from command line, please follow the below steps:
Recently I encountered the following situation while trying to install php in IIS. After downloading and extracting the php files to “C:\Program Files(x86)\PHP”, I saw that all the files and folders inside that directory was blocked due to some inherent group policy settings.
In order to solve this issue I downloaded the “streams” utility from sysinternals website and copied the “streams” binary to “C:\Windows“. You can copy the binary to any other directory which is included in the PATH environment variable(it can be viewed using “echo %PATH%“).
“streams” binary provides two switches “-s” (for recursive action) and “-d” (for deleting streams). The details is provided below. After changing directory to “C:\Program Files(x86)\PHP” I ran “streams -d -s *” to remove the block from all files and folders inside the PHP directory.
The reason for this blocking issue is that the “Do not preserve zone information in file attachments” setting was disabled. Details of this feature as collected from windows help is pasted below,
To solve this issue for future downloads follow the steps mentioned below,
From now onwards the newly downloaded files won’t be blocked by default. Hope this might help someone:)
In order to block remote access to a particular service(say mssql, port 1433) from an ip 184.108.40.206 , use the following from command line.