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 […]
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 […]
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 […]
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
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 […]
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 […]
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
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 […]
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
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