How to Find and Remove Stale Computer Objects in Active Directory with PowerShell?

If you manage Active Directory, you’ve probably noticed that computer accounts tend to pile up over time. Machines get replaced, users switch laptops, or systems are decommissioned — but those old computer objects? They often stick around in AD. These stale computer accounts aren’t just clutter. They can create security vulnerabilities (imagine an attacker reactivating … Read more

How to Find Public Folder Paths in PowerShell?

While working with Exchange public folders, I was required to find public folder paths. Most Exchange PowerShell cmdlets require the complete folder path in the -Identity parameter. In this tutorial, I will show several efficient ways to find public folder paths quickly using PowerShell. I will also explain how to search for folders by name … Read more

PowerShell For Loop 1 to 10 [With Examples]

PowerShell For Loop 1 to 10

I will explain a fundamental topic today, PowerShell for loop 1 to 10. The simple “loop from 1 to 10” is the perfect starting point because it teaches you the fundamental pattern you’ll use to automate countless repetitive tasks. Once you understand this basic structure, you’ll be able to adapt it to loop through anything: … Read more

How to Break Out of ForEach Loops in PowerShell?

Break Out of ForEach Loops in PowerShell

Suppose, you’re looping through thousands of files, user accounts, or log entries, searching for one specific item. Once you find it, why keep looping through the rest? That’s where breaking out of a foreach loop becomes very useful. It saves processing time, makes your scripts more efficient, and prevents unnecessary work. In this tutorial, I … Read more

How to Find Strings in PowerShell Hash Tables?

Find Strings in PowerShell Hash Tables

If you’ve ever built a PowerShell hash table to store configuration data, user information, or server details, you’ve probably run into this scenario: you need to find something, but you’re not sure which key it’s under—or maybe you need to search through all the values to see what matches. Hash tables are fantastic for quick … Read more

How to Find Passwords in Files with PowerShell?

Let’s be honest: people still store passwords in plain text files. I’ve seen it countless times — a “passwords.txt” sitting on someone’s desktop, a Word doc named “Important Logins.docx,” or configuration files with hardcoded credentials. It’s a security nightmare waiting to happen. But you can use PowerShell to scan directories quickly and identify potential security … Read more

How to Find Unquoted Service Paths with PowerShell?

If you manage Windows systems—whether you’re a sysadmin, security analyst, or just someone who wants to keep their environment secure—there’s a surprisingly common vulnerability hiding in plain sight: unquoted service paths. In this tutorial, I will explain how to find unquoted service paths with PowerShell using different methods. But let us first understand why it … Read more

Why Does Windows PowerShell Keep Popping Up?

Why Does Windows PowerShell Keep Popping Up

If you’ve ever been working peacefully on your Windows PC only to have a blue PowerShell window suddenly flash on your screen—sometimes repeatedly—you know how frustrating it can be. Not only is it annoying, but it can also make you worry: “Is my computer infected? Did I break something?” The good news? We can fix … Read more

Find First Match in Array and Return Value in PowerShell

PowerShell Find First Match in Array and Return Value

One of our development team members was struggling to find the first match value in a PowerShell array. I suggested different methods, so I thought I would share those examples. In this tutorial, I will explain how to find the first match in an array and return the value in PowerShell using several methods with … Read more

PowerShell Convert Byte Array to Hex String

PowerShell Convert Byte Array to Hex String

As a PowerShell expert, I’ve encountered many scenarios involving converting byte arrays to hexadecimal strings. In this complete tutorial, I’ll walk you through multiple methods to convert byte arrays to hex strings in PowerShell with practical examples. Let me first explain about byte arrays and hexadecimal representations. A byte array is a collection of bytes … Read more

100 PowerShell cmdlets download free

100 POWERSHELL CMDLETS E-BOOK

FREE Download an eBook that contains 100 PowerShell cmdlets with complete script and examples.