PowerShell code snippets, examples and info for Windows Server administrators. Maybe some AppCmd and DISM as well.
This might be specific to my Windows Server environment and PoSH scripting, but using
-SeachBase with PowerShell’s
Get-ADComputer gives me faster results. You can use this for your own advantage, here is a little example to speed up AD DS queries.
You can install Servicing Stack Updates (SSU) for Windows Server 2016 and Windows Server 2019 using PowerShell, without downtime. Because they must be installed prior to your normal Windows Server security updates, you can install them anytime you want to during the day. Here’s a small PowerShell example to do so.Read more
Ever wondered why Windows Server Update Services (WSUS) offers Flash updates for Windows Server? Adobe Flash Player is installed on Windows Server 2016 / 2019 if you have the Remote Desktop Session Host (RDSH) role installed. Yikes! I can imagine you want to delete Adobe Flash Player without deleting the RDSH role, and here is how.Read more
Just a quicky: Start all stopped application pools in IIS that have the autostart property set to true. Easily with appcmd or the IISAppPool cmdlet that’s available in the IISAdministration PowerShell module. And here is how.Read more
How to use the Windows PowerShell cmdlet Get-ItemProperty to work with file attributes.
Working with PowerShell’s
Get-ItemProperty to get file attributes may boost your work productivity. It’s often easier to getting things done if you have a more generic way of doing something. Here is how to use
Get-ItemProperty in PowerShell to perform and streamline day to day tasks like installing or updating software based on file versions.
Unzipping a file on your PowerShell command line may come in handy sometimes, even on your Windows 10 workstation. Use Expand-Archive for this, and all that is required is PowerShell 5.0+, or the .NET 4.5+ Framework to use
Detect the ethernet network speed using PowerShell or WMI is perfect for Windows Server Core. If you ever need to lookup the speed of your ethernet network card in Windows, on the command-line, use one of the following WMIC commands on your PowerShell prompt:Read more
This post explains how to restrict automatic NS resource record registration in Windows Server DNS using
Dnscmd. This prevents Windows Server DNS to automatically create NS records for zones that it hosts on the server.
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.Read more
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.Read more
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.
Ever wanted to know the current number of active FTP client connections on your Windows Server FTP Service? You can get this statistic using PowerShell, the
Get-Counter cmdlet and the Microsoft FTP Service Current NonAnonymous Users performance counter.
Windows PowerShell (“PS” for short) 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.Read more
Here is how you can verify whether an external command in PowerShell was executed successfully or not by its errorlevel. Simply by verifying PowerShell’s return value, or exit code…Read more
25 Most Popular Tags
Proudly hosted by
Email: email@example.com (remove no-spam)
15 Most popular entry posts you might like
- List all SPNs used in your Active Directory
- Remove IIS Server version HTTP Response Header
- PowerShell return value, exit code, or ErrorLevel equivalent
- Explicit Congestion Notification (ECN) slows down outbound connections
- 5 Extra ways to clean up disk space in Windows Server
- Disk Cleanup in Windows Server
- Tunnel RDP through SSH & PuTTY
- WsusPool keeps crashing: stops again and again
- HTTP to HTTPS redirect using IIS web.config
- Fatal error: Uncaught Error:  operator not supported for strings – PHP 7.1
- MySQL InnoDB performance improvement: InnoDB buffer pool instances – Updated!
- "The length of the URL for this request exceeds the configured maxUrlLength value"
- Fix "Could not establish trust relationship for the SSL/TLS secure channel" error
- How to install IIS URL Rewrite Module on Windows Server 2016 & IIS 10
- Set IIS Application Pool recycle defaults to Specific Times, not Regular Time Interval