Tag: commands

Verify Connectivity to a Remote Computer

Verify Connectivity to a Remote Computer

Telnet from a Windows Machine

When providing accessible public services a requirement may arise to test the connectivity externally. This can be done using the built in command line Telnet subject to the Telnet Windows feature is installed. This is unlikely as in most scenarios, Telnet is only installed if required. Additionally, using Putty you can achieve the same result, however try downloading Putty through some Proxy’s and you wont have much luck. But using the built in Windows 10 PowerShell command Test-NetConnection, this is easily achiveable. If you need to test SMTP, HTTP, HTTPS, running  the below command can provide you with either “True” or “False”.

Test-NetConnection -Port 80 -ComputerName kamhussain.com | ft TcpTestSucceeded


Command Line Cheat Sheet

Command Line Cheat Sheet

Some useful command lines:

Find which Logon Server

Echo %logonserver%

Find all Domain Controllers

Nltest /dclist:[Domain Name]

Machine Up Time:

systeminfo | find /i "Boot Time"

Some common run commands: Click Start > Run (or Windows key + R):

Accessibility Options                   access.cpl
Add New Hardware                     sysdm.cpl
Add/Remove Programs              appwiz.cpl
Date/Time Properties                 timedate.cpl
Display Properties                       desk.cpl
FindFast                                        findfast.cpl
Internet Properties                     inetcpl.cpl
Keyboard Properties                   main.cpl
Microsoft Exchange                    mlcfg32.cpl
Network Properties                     netcpl.cpl
Password Properties                   password.cpl
Regional Settings                         intl.cpl
System Properties                       sysdm.cpl
Device Manager                           Devmgmt.msc
Disk Management                       Diskmgmt.msc
AD Users & Computers              Dsa.msc

FTP command

ftp://username:[email protected]

Recycle Bin

start shell:RecycleBinFolder

Find Hidden Devices in Device Manager

Set  devmgr_show_nonpresent_devices=1

Find Hardware Spec of a PC


Active Directory


Group Policy Update – no timeout

gpupdate /force /wait:-1

Boot to safe mode


Run as Admin

Runas /user:domain\Username cmd

Run any Command remotely

Winrs -r:PC1 ipconfig (or any command)

Disable Firewall remotely (this is deprecated in Server 2012)

Winrs -r:PC1 netsh firewall set opmode disable

Disable Firewall remotely Server 2012 +

Winrs -r:PC1 netsh advfirewall firewall set opmode disable

Get MAC address

Getmac -s

Disk Management

Diskpart.exe - disk management utility through CMD

Scan the integrity of all protected system files and replaces incorrect versions with correct Microsoft versions.

sfc /scannow

Replicate Domain Controllers

Repadmin /replicate
Remotely Get Installed Programs using WMI

Remotely Get Installed Programs using WMI

Find Windows programs installed on a remote machine using WMI

In order to retrieve installed programs from a remote machine using WMI run:

Get-WmiObject win32_product -ComputerName pc1| out-gridview