Check NTP server working or not, Check NTP server Date and Time – Windows, Linux

Windows

1 Use Win + R to open run Window

Microsoft Windows - Run window
Microsoft Windows – Run window

2 Type cmd, then hit Enter key

Microsoft Windows - Run window - cmd.exe
Microsoft Windows – Run window – cmd.exe

The command we use is in following format:

w32tm /stripchart /computer:domainnameORipaddress /dataonly /samples:5

3 Enter following command to test “time.windows.com”

w32tm /stripchart /computer:time.windows.com /dataonly /samples:5
Microsoft Windows - CMD -   w32tm /stripchart /computer:time.windows.com /dataonly /samples:5 output
Microsoft Windows – CMD – w32tm /stripchart /computer:time.windows.com /dataonly /samples:5 output

Bonus: Other commands

1 Show the current time zone settings:

w32tm /tz

2 List external NTP servers (peers)

w32tm /query /peers
Microsoft Windows - CMD -  w32tm /query /peers output
Microsoft Windows – CMD – w32tm /query /peers output

Note! If you have encountered this error: “The following error occurred: The service has not been started. (0x80070426)”, you need to start the “Windows Time” service, you can start a elevated cmd or PowerShell by using Win + X key combination then select “Command Prompt (Admin)” or “Windows PowerShell (Admin)” then type “sc start W32Time” to start the Windows Time service or using Run window and type “services.msc” then find “Windows Time” service and start it.

3 Restore Windows Time service settings to default

C:\>net stop w32time
C:\>w32tm /unregister
C:\>w32tm /register
C:\>net start w32time

4 Re-sync Time

Resynchronize the clock as soon as possible, disregarding all accumulated error statistics. If no computer is specified, the local computer will resynchronize. The command will wait for resynchronization unless the /nowait switch is used.

w32tm /resync

5 Redirect the network configuration and Re-sync time

Force redetection of network resource before resynchronization.

w32tm /resync /rediscover
Microsoft Windows - PowerShell - w32tm /resync /rediscover output
Microsoft Windows – PowerShell – w32tm /resync /rediscover output

6 Check current NTP configuration

Show Information:

w32tm /query /status
Microsoft Windows - PowerShell -  w32tm /query /status  output
Microsoft Windows – PowerShell – w32tm /query /status output

Show Configuration:

w32tm /query /configuration
Microsoft Windows - PowerShell -  w32tm /query /configuration  output
Microsoft Windows – PowerShell – w32tm /query /configuration output

Linux

1 ntpdate -q domainnameORipaddress

ntpdate -q time.windows.com
Linux - Terminal - ntpdate -q time.windows.com output
Linux – Terminal – ntpdate -q time.windows.com output

2 ntpq -p domainnameORipaddress

ntpq -p 192.168.1.1

Windows Server, Windows 10 missing disk performance counter in Task Manager

To fix missing disk performance counter in Task Manager:

Windows Task Manager missing disk performance counter
Windows Task Manager missing disk performance counter
Windows Task Manager with disk performance counter
Windows Task Manager with disk performance counter

Fix

1 Use Win + X key combination to open menu, click on Windows PowerShell (Admin) to open elevated PowerShell window.

2 Close Task Manager if you have it open

3 Type following command and hit Enter Key

diskperf -y
Windows PowerShell - diskperf -y
Windows PowerShell – diskperf -y

4 Now open Windows Task Manager again, the disk performance counter should appear.

Note: To diesable it again, just repeat these steps but replace diskperf -y with diskperf -n

How to fix Microsoft Hyper-V Error: The application encountered an error while attempting to change the state of ‘New Virtual Machine’.

The Error:

The application encountered an error while attempting to change the state of ‘New Virtual Machine’.

‘New Virtual Machine’ failed to start.

Synthetic SCSI Controller (Instance ID xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx): Failed to Power on with Error ‘General access denied error’.

Hyper-V Virtual Machine Management service Account does not have permission to open attachment ‘D:\vm.vhdx’. Error ‘General access denied error’.

Hyper-V Error: Virtual Machine Connection - 'New Virtual Machine' failed to start
Hyper-V Error: Virtual Machine Connection – ‘New Virtual Machine’ failed to start

Note: Other similar errors which is related to virtual hard drive (vhd, vhdx) permission issue when starting the Hyper-V virtual might also be fix by using following method.

The Fix:

Method 1:

Remove the virtual hard drive from virtual machine via Hyper-V Manager then reattach the hard drive

Method 2:

1 We need to get the SID of the virtual machine, usually it will be displayed in the error dialogue. If you have the SID continue with step 2, If not, follow the steps below:

1.1 Open the Run window by using Win + R key combination.

Microsoft Windows - Run window
Microsoft Windows – Run window

1.2 Type virtmgmt.msc and hit “OK” button

1.3 Write down the name of the virtual machine which is having perimssion issue.

1.4 Use key combination Win + X, click on Windows PowerShell (Admin) to open PowerShell window. Type following command and hit Enter key (Replace Name of Virtual Machine to your virtual machine’s name)

Get-VM 'Name of Virtual Machine' | Select-Object VMID
Windows PowerShell -  Get-VM 'Name of Virtual Machine' | Select-Object VMID
Windows PowerShell – Get-VM ‘Name of Virtual Machine’ | Select-Object VMID

2 Enter following command in PowerShell to grant permission for this virtual machine to attach the virtual herd drive. ()

icacls "<Path of .vhd or .avhd file>" /grant "NT VIRTUAL MACHINE\<Virtual Machine ID from step 1>":F

or

icacls "<Path of .vhd or .avhd file>" /grant "<Virtual Machine ID from step 1>":F

Tip: By default Hyper-V store virtual machine configuration files in “C:\ProgramData\Microsoft\Windows\Hyper-V”, hard drives in “C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks”

Computer can only access Google, YouTube, microsoft.com etc. or Nothing at all

Keywords: Internet connection, Limited internet access, netsh, winsock, ipconfig, Microsoft Windows, WiFi, WiFi Router, Modem

Sometimes, you will find that your computer can only access Google, or microsoft.com etc.

For Mirosoft Windows there are many tricks you can try:

1 Win + R

2 Type cmd and hit Enter key.

Try each of these and hit enter at the end of each line

(If use netsh int ip reset, ignore netsh int ipv4 reset and netsh int ipv6 reset)

netsh winsock reset
netsh int ip reset
netsh int ipv4 reset
netsh int ipv6 reset

3 Restart your computer

4 Follow step 1-3 and type following commands, hit enter at the end of each line

ipconfig /release
ipconfig /renew

5 Wait 3 minutes

If you still can not get online.

Try to power cycle/restart your WiFi/Router/Modem. (Normally the box at home or small office you use to access WiFi and internet.)

How to redirect printer, Transfer printer queue to another printer

If you have a long print queue, but the current default printer is not working, use this trick to redirect the current and future print queue to another working printer.

1 Use key combination Win + R to open run window

2 Enter control printers, press enter

3 Devices and Printers window will show up

4 Right click on the dead printer -> Printer properties -> Ports -> Select another printer which works -> Click on OK button

From now on, the old print queue and future print queue will be processed form the selected new printer, if in a domain setup, it can save you from changing all default printers for all affected users by doing this from the server side.