PowerShell has a function Get-FileHash to compute the hash value for a file by using a specified hash algorithm. For example, to calculate SHA1 hash code for a file: Get-FileHash -Path "D:\Software\test.ovf" -Algorithm SHA1 You can also check other algorithms like MD5, SHA256 etc. PS D:\Software> Get-Command Get-FileHash CommandType Name Version Source ----------- ---- ------- … Continue reading PowerShell checking file hash
Category: Windows
PowerShell — Get-Content slow?
In PowerShell, the cmdlet Get-Content is used to read a file. Usually you just give the path of a file name as below: Get-Content -Path "c:\temp\test.txt" When the file is small, you won't notice anything wrong. But when it's quite big with thousands of lines, you might notice it's extremely slow to display. This is … Continue reading PowerShell — Get-Content slow?
PowerShell on Linux
When working in a heterogeneous envrionment with different types of OS (Windows, Linux etc.), you probably want to manage systems from a central place. People usually have a RDP session of Windows, then using a multi connection manager like mRemoteNG to connect those systems. To automate your tasks with scripts, you want them fired from … Continue reading PowerShell on Linux
Retrieve password configured within mRemoteNG
mRemoteNG is a popular and handy tool for people managing connections to multiple servers with tabs no matter the connection types are ssh, or rdp, or http/https etc. Usually for a connection, you will configure username & password along with the host/IP information so that you don't need to enter a user name and its … Continue reading Retrieve password configured within mRemoteNG
Return IP from a specific NIC (Network Binding Order) for Windows Server 2016 and above
For some applications it is important to see and bind to a correct IP when there are multiple NICs (hence multiple IPs assigned) on a Windows server. For example, if a server has two NICs with two different IPs from 2 subnets, one for public traffic and another for the storage network. You may want … Continue reading Return IP from a specific NIC (Network Binding Order) for Windows Server 2016 and above
Windows turning off network discovery or file and printer sharing activate Public profile for the firewall
I have built a small lab with 2 Windows 2012 VMs from the same template. To simulate another environment, I've shared some folders out from VM1 so that both VMs can access them. However I noticed that VM2 cannot access them with the error code: 0x80070035 -- The network path was not found. As a … Continue reading Windows turning off network discovery or file and printer sharing activate Public profile for the firewall
Configure a Windows server as a NTP client
For years, I have been using the instructions similar to the Microsoft article to configure Windows 2012 servers as NTP client. Basically as a local Windows administrator, modify Windows registry settings. I put all settings into a plain text file as below and import the file. Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config] "MaxPosPhaseCorrection"=dword:0002a300 "AnnounceFlags"=dword:00000005 "MaxNegPhaseCorrection"=dword:0002a300 … Continue reading Configure a Windows server as a NTP client
SMB(CIFS) does not show all files when mounting a Windows share
I've been mounting Windows Shares on Linux servers for years and until recently I've noticed an issue with this -- Some files/directories are not listed from a Windows share. I've searching the internet and people are experiencing the same problem as well. It looks like a kernel bug for SMBv2+ according to the discussions below: … Continue reading SMB(CIFS) does not show all files when mounting a Windows share
Getting version information from Windows MSI installer
For a large orgnization, it's common to push a software to clients for auto installation and update. Usually the process needs to know the version information of a software installation package (on Windows it is likely a MSI file) to compare to what has been installed on client machines. Getting the version information is crucial … Continue reading Getting version information from Windows MSI installer
A side feature from 7zip — deleting file with long file path
7zip is a decent tool when dealing with zip files, small but powerful and green! I use it almost everyday when working on Windows system. Today I learned it can used to delete files with long file path if you can not delete such files from Windows File Explorer. Windows has a maximum file path … Continue reading A side feature from 7zip — deleting file with long file path