Using PowerShell to Test a Remote Connection

Test-NetConnection www.google.com ComputerName : www.google.com RemoteAddress : 216.58.204.228 InterfaceAlias : Ethernet 3 SourceAddress : 192.168.0.13 PingSucceeded : True PingReplyDetails (RTT) : 17 ms   Test-NetConnection www.google.com -Port 80 ComputerName : www.google.com RemoteAddress : 216.58.204.228 RemotePort : 80 InterfaceAlias : Ethernet 3 SourceAddress : 192.168.0.13 TcpTestSucceeded : True   Test-NetConnection www.google.com -TraceRoute ComputerName : www.google.com RemoteAddress […]

Posted in KB-Powershell/CMD, KB-Windows, Knowledge Base | Comments Off on Using PowerShell to Test a Remote Connection

Clear DNS Windows MacOS Linux

Windows CMD as admin ipconfig /flushdns   MacOS Applications> Utilities > Terminal 10.7, 10.8, and 10.9 10.10.4 and above – sudo killall -HUP mDNSResponder 10.10.1, 10.10.2, and 10.10.3 – sudo discoveryutil mdnsflushcache 10.5 and 10.6 – sudo dscacheutil -flushcache Enter mac login password (requires admin)   Linux Check if service is running – sudo systemctl […]

Posted in KB-Powershell/CMD, Knowledge Base | Comments Off on Clear DNS Windows MacOS Linux

Bulk update VHD Location on Hyper-V Host

used for is you have already moved the files, for instance I updated from using the computer name \\storage\ to the FQDN   get Excel file get-VMHardDiskDrive -VMName * | select VMName,ControllerType,ControllerNumber,ControllerLocation,Path | Export-Csv -Delimiter “;” -Path “c:\temp\vmvhdloc.csv” In excel file update path to what you want it to be (note this does not move […]

Posted in KB - Windows Server, KB-HyperV, KB-Powershell/CMD, KB-Windows, Knowledge Base | Comments Off on Bulk update VHD Location on Hyper-V Host

Storage space does not mount after reinstalling Server OS

Reason server is not configured to use the old storage space setup Server Manager->File and Storage Services->Volumes->Storage Pools Right-click storage pool and choose “Set Read-Write access” and OK on the prompt Set drive to automatically mount update alls virtual drives to automount Get-VirtualDisk | Set-VirtualDisk -IsManualAttach $False

Posted in KB - Windows Server, KB-Powershell/CMD, KB-Windows, Knowledge Base | Comments Off on Storage space does not mount after reinstalling Server OS

Delete folder via CMD on Windows

run command prompt as admin cd to the location of folder DEL /F/Q/S *.* > NUL    (this deletes all files all the folder structure) used cd.. to navigate to parent folder RMDIR /Q/S foldername (this deletes the folder and all subfolders) DEL /F/Q/S *.* > NUL /F — forces the deletion of read-only files. /Q — enables quiet […]

Posted in KB-Powershell/CMD, KB-Windows, Knowledge Base | Comments Off on Delete folder via CMD on Windows

Export windows drivers on windows 10

open powershell as admin Export-WindowsDriver -Online -Destination C:\temp\driverexport You can then copy the drivers to another location to have a copy of them.   I have previously used this when reinstalling windows, where I export drivers to a USB, so when going to installed windows and then using device manager I browse to the Drivers […]

Posted in KB-Powershell/CMD, KB-Windows, Knowledge Base | Comments Off on Export windows drivers on windows 10

Assign/remove drive letter with CMD

Run command prompt as admin type diskpart list volume select volume (number of the one you want) To Assign assign letter=H to Remove remove letter=H

Posted in KB-Powershell/CMD, KB-Windows, Knowledge Base | Comments Off on Assign/remove drive letter with CMD

Failover Cluster manager – get list of Vm’s and if a VM has a DVD (iso file)

Powershell Get-ClusterGroup -Cluster 19-hv | ? {$_.GroupType –eq ‘VirtualMachine’ } | Get-VM | Get-VMDvdDrive   19-hv is the cluster name I have created VMName ControllerType ControllerNumber ControllerLocation DvdMediaType Path —— ————– —————- —————— ———— —- 19-RDSH SCSI 0 1 None 2016DC-1 SCSI 0 1 None 2019 SCSI 0 1 None Android IDE 1 0 ISO […]

Posted in KB - Server, KB - Windows Server, KB-HyperV, KB-Powershell/CMD, KB-Software, KB-Windows, Knowledge Base | Comments Off on Failover Cluster manager – get list of Vm’s and if a VM has a DVD (iso file)

Change the certificate used for remote desktop connection

wmic /namespace:\\root\CIMV2\TerminalServices PATH Win32_TSGeneralSetting Set SSLCertificateSHA1Hash=”CertificateSHA1Hash” You can get the Certificate SHA1 Hash by using openssl

Posted in KB - Windows Server, KB-Powershell/CMD, KB-Remote Desktop, Knowledge Base | Comments Off on Change the certificate used for remote desktop connection

force a network type in Windows using PowerShell

Let’s first get a look at the profile used by your network adapters: Get-NetConnectionProfile Find the InterfaceIndex number of the adapter you wish to change then use command: Set-NetConnectionProfile -InterfaceIndex <index number> -NetworkCategory Private

Posted in KB-Powershell/CMD, Knowledge Base | Comments Off on force a network type in Windows using PowerShell