You sometimes need to list and get all MAC addresses of all Hyper-V virtual machines in your network. Either for your Hyper-V administration or provisioning if you don’t set an unique MAC address automatically. Here is how to get all those MAC addresses easily with PowerShell.
PowerShell blacklist check script: find an IP address’ blacklist status & reputation
Here’s a blacklist check script written in PowerShell. You can use this to lookup an IP address in various blacklists (DNSBL, RBL). Such a check is a great indicator for an IP address’ reputation. Basically this PowerShell blacklist checker is a port of my Bash script to check an IP address blacklist status in Linux.
AppCmd introduction and examples
The AppCmd
command is your one-stop-shop for administering Windows Server IIS web servers. In combination with WinRM it’s your Swiss Army knife for your daily routine. This post introduces appcmd and provides you with a lot of helpful appcmd examples.
Get current number of FTP client connections (NonAnonymous) with PowerShell and Get-Counter
Ever wanted to know the current number of active FTP client connections on your Windows Server IIS FTP Service? You can get this statistic using PowerShell, the Get-Counter
cmdlet and the Microsoft FTP Service Current NonAnonymous Users performance counter.
Simple PowerShell introduction for Windows Server administration, automation and scripting
Windows PowerShell is an important tool in Windows Server for administrators. You can use PowerShell for Windows Server administration, software installation, automation, and shell/command-line scripting. Here is a small and simple introduction to Windows PowerShell.
Always_populate_raw_post_data setting in PHP 5.6 & Magento 2.0
Does Magento 2 throw an error about always_populate_raw_post_data
being set to 0
? And are you having problems installing or updating Magento with PHP 5.6 and PHP 7? Then read on, because here is how to fix upgrades to Magento 2.0 in PHP 5.6 and higher: PHP 7+.
PowerShell return value, exit code, or ErrorLevel equivalent
Here is how you can verify whether an external command in PowerShell was executed successfully or not by its errorlevel. Simply by verifying the PowerShell exit code.
Get Hyper-V guest serial number with PowerShell
Learn how to retrieve the Hyper-V virtual machine’s serial number with PowerShell. Sometimes you need to have the serial number of a Hyper-V virtual machine (VM, or guest). We, for instance, use this serial number in our automatic, unattended deployment of the guest operating system. But then you need to know how to find this serial number…
Monitor Windows services with PowerShell
As a Windows Server and IIS administrator, you want your Windows services to run at all times. One can monitor Windows services in many, many, ways. Some of our customers websites may depend on certain services, which may be hard to monitor externally. For those Windows services that need local monitoring, I like to schedule a PowerShell script. Here is one…
PowerShell Get-FsrmQuota and Set-FsrmQuota
To get and set File Server Resource Manager NTFS quota, you now have to use PowerShell‘s FileServerResourceManager cmdlets. In the past, I used to get and set NTFS directory quota with the dirquota
command, which is deprecated. A behavioral change for me (and you?) I can live with: it’s pretty easy to get directory information with Get-FsrmQuota
and change dirquota using Set-FsrmQuota
.
Set IIS Application Pool recycle defaults to Specific Times, not Regular Time Interval
By default, an IIS application pool (or “AppPool”) recycles on a regular time interval of 1740 minutes, or 29 hours. One reason for this time interval is that application pools don’t recycle at the same moment every day (every day at 07.00 for example). However, sometimes you want to change this regular time interval to a specific time schedule. And when you try to configure this in IIS Manager, it gives you an error. Luckily, AppCmd and PowerShell come to the rescue!
Convert PHP ext/mysql to MySQLi
This post will show you how to convert PHP mysql extension functions to PHP MySQLi extension. Migrating away from ext/mysql to MySQLi (or PHP Data Object (PDO)) is important, because the ext/mysql functions are deprecated as of PHP 5.5.0. If you do not update your PHP code, your website will fail soon!
PowerShell: find all files owned by a particular user
In Windows, you sometimes need to find all files owned by a specific user. Recursively on your Windows Server NTFS file system. PowerShell has some nice cmdlets and features to automate this task for you. Here you’ll find example PowerShell scripts to find and list files owned by a specific user…
WMI/netsh to add DNS servers on network adapters
How to add DNS servers -or resolvers- to a Windows Server network adapter, or interface using WMI and the netsh
command annd PowerShell. This one is quite old but may come in handy sometimes. In this example we use Google’s Public DNS server addresses and localhost to add as DNS Servers on our server’s interfaces.
How to set a good PHP realpath_cache_size
The PHP directive realpath_cache_size
sets the size of the realpath cache to be used by PHP. Increasing realpath_cache_size
might greatly improve PHP performance, as PHP states: “This value should be increased on systems where PHP opens many files.”. Therefore, setting a correct value for PHP realpath_cache_size can greatly improve PHP performance and optimize WordPress – and other CMS’s – websites.