Shore Up

Windows

Automate DHCP Lease Reporting on Windows Server

This guide builds a read-only PowerShell script that enumerates your DHCP scopes, pulls the current IPv4 leases from each, writes them to a timestamped CSV, and (optionally) emails the file. It does not change any DHCP configuration — no scopes, reservations, options, or leases are created, modified, or deleted. The worst it can do is fill a disk with CSVs if you never prune them.

9 min read

When the Patch Wasn't the Patch: N-central's Auth Bypass Redux

If you run N-able N-central yourself, or an MSP runs it on your behalf, stop and read this one properly. CISA put CVE-2026-18577 into the Known Exploited Vulnerabilities catalog on 3 August, then followed up the next day by adding CVE-2026-18556 alongside two unrelated bugs. Two CISA advisories, one day apart, both pointing at the same product. That ordering is the whole story.

3 min read

Automate a Daily Failed-Logon (4625) Report with PowerShell

This guide builds a scheduled PowerShell job that reads Event ID 4625 (failed logon) from the Windows Security log for the last 24 hours and writes them to a dated HTML report. It is read-only — it queries the event log and creates a report file. It does not change auditing policy, delete events, or touch accounts.

9 min read

Automate a Network Share Permissions Audit with PowerShell

This guide builds a read-only report . The script enumerates the SMB shares on a Windows file server, then lists two things for each one: the share-level permissions (the "who can connect" layer) and the NTFS permissions on the folder behind it (the "who can touch the files" layer). It writes both to CSV so you can review access in a spreadsheet instead of clicking through the Security tab share by share.

9 min read

Schedule and Rotate IIS Log Cleanup with a Batch File

IIS writes a fresh W3C log file on a schedule, but it never deletes the old ones. On a busy site that quietly eats the system drive until something breaks. This is the boring, reliable fix: a batch file that deletes logs older than N days, run daily by Task Scheduler.

7 min read

Audit Local Administrators Across Many Windows Machines

This is a read-only audit. It pulls a list of computers from Active Directory, connects to each one over PowerShell Remoting (WinRM), reads the membership of the local Administrators group, and writes everything to a single CSV you can open in Excel. It creates nothing and changes nothing on the target machines, so there is no destructive step and nothing to roll back — the only thing produced is the report file on your own workstation.

9 min read

Automate a GPO Backup and Export with PowerShell

This guide sets up a PowerShell script that backs up every Group Policy Object in your domain to a dated folder and, optionally, exports a human-readable HTML report of each one. Backing up GPOs is a read-only operation — Backup-GPO does not change, delete, or unlink anything in Active Directory. It copies the policy settings, security filtering, and WMI filter links into files on disk. The risky part is not the backup; it's the restore , which I cover at the end and which you should treat with real care.

9 min read

Automate Print-Queue Cleanup and Clearing Stuck Jobs

Stuck print jobs are one of those recurring, low-glamour tickets: a queue jams, one document sits in "Error" or "Deleting" forever, and everything behind it stalls. This guide gives you two standard tools — a graceful per-job cleanup and the classic spooler reset — and shows how to run them safely on a schedule.

9 min read

Bulk-Update AD User Attributes from a CSV

This guide reads a CSV of users and writes two attributes back to Active Directory for each one: Title and Department . Nothing is created or deleted — existing user objects have those two fields overwritten with the values in your file. That overwrite is a real change: if the CSV has a wrong value in a row, that user's title or department is now wrong until you fix it. There is no built-in "undo," so the safety step below is to export the current values first so you can put them back.

9 min read

Monitor Free Disk Space and Email an Alert with PowerShell

This script reads the free space on the fixed local disks of the machine it runs on and emails you when any of them drops below a percentage you set. It is a lightweight stand-in for a monitoring platform — good for a handful of servers, not a replacement for one across a fleet.

8 min read

Automate a Nightly Robocopy Mirror to a NAS with Verification

This sets up a nightly one-way mirror of a local folder to a NAS SMB share using robocopy /MIR , followed by a second pass that lists any remaining differences as a verification step, all logged to a timestamped file and driven by a Scheduled Task.

9 min read

Automate Windows Firewall Rule Deployment with PowerShell and netsh

This guide builds and deploys Windows Defender Firewall rules from a table (a CSV), using the NetSecurity PowerShell module, with netsh advfirewall shown as the older equivalent. The goal is a repeatable, idempotent way to push the same rule set to one host or many, instead of clicking through wf.msc on each box.

9 min read

Export Installed Software Inventory From Many PCs With PowerShell

This guide builds a script that connects to a list of remote Windows machines over PowerShell remoting (WinRM), reads the "installed programs" data out of each machine's registry, and writes one combined CSV inventory. It is read-only : it queries registry keys and creates a CSV on your admin workstation. It does not install, uninstall, or change anything on the target machines.

8 min read

Batch-Rename Files by Pattern with a Windows Batch Script

This is a cmd.exe batch file that renames files in one folder by find-and-replace: it takes every file matching a mask (say *.txt ), swaps a substring in the filename (say draft → final ), and renames it. Its purpose is bulk cleanup of filenames — removing a stray word, fixing a prefix, changing a spelling — without you clicking through Explorer.

7 min read

Automate DNS Record Audits on Windows DNS with PowerShell

This guide builds a read-only audit of a Microsoft DNS server: it enumerates the zones, exports every resource record to CSV, and produces a short report of records that look stale (dynamic records whose aging timestamp is older than a threshold you set). The audit script itself creates nothing and deletes nothing — its worst case is a CSV file on disk.

9 min read

Generate a Disk-Space Report Across Servers with PowerShell Remoting

This guide builds a read-only disk-space report. It uses PowerShell remoting ( Invoke-Command over WinRM) to query each server's local fixed disks and returns size, free space, and percent free as one combined table you can export to CSV or HTML. It does not write to, resize, or clean up any disk — it only reads WMI/CIM data.

10 min read

Automate User Offboarding in Active Directory with PowerShell

This script offboards one leaving user in a single pass: it disables their AD account, records and removes their group memberships (except the primary group), and moves the account into a disabled-users OU. A separate, clearly marked step sets mail forwarding on their mailbox. The point is a consistent, logged procedure so nothing gets missed and you can reconstruct exactly what changed.

9 min read

Automate New-User Onboarding in Active Directory

This guide builds a PowerShell script that onboards one new employee in four steps: it creates an Active Directory user account , adds them to security groups , provisions an on-premises Exchange mailbox , and creates their home folder on a file server and sets NTFS permissions . The purpose is to replace the error-prone click-through in Active Directory Users and Computers with one repeatable, reviewable run.

10 min read

Clean Up Stale Computer Accounts in Active Directory with PowerShell

This guide finds Active Directory computer accounts that haven't logged in for a long time and retires them in three deliberate stages: report , disable and move to a holding OU , then delete . The purpose is to keep AD tidy and reduce the attack surface of forgotten machine accounts without accidentally killing a computer that's simply been powered off for a while.

8 min read

Automate Certificate Expiry Checks on Windows with PowerShell

An expired TLS certificate is the kind of outage that is entirely preventable and still catches everyone. This guide builds a small PowerShell script that reads the certificates in a server's own store, flags any that expire soon, and then schedules it to run daily so you hear about it weeks in advance instead of from a monitoring alert at 2 a.m.

9 min read

Automate a Ping and Port Sweep of a Subnet with PowerShell

This guide builds a small PowerShell script that walks every address in a /24 subnet, sends one ICMP echo (a ping) to each, and — for the hosts that answer — tests a short list of TCP ports and does a reverse-DNS lookup. The output is a CSV inventory: IP, up/down, resolved name, and which ports were open. It is read-only. It does not log into, change, or write anything on the machines it probes.

8 min read

Rotate Local Admin Passwords Across Machines with PowerShell

This guide gives you a PowerShell script that connects to a list of Windows machines over WinRM and sets a brand-new random password on the built-in local Administrator account of each one , then writes the results to a CSV so you have the new credentials. Its purpose is to kill shared, static, "same password everywhere" local admin accounts.

9 min read

Automate Mapped-Drive Setup with a Logon Batch Script

This guide sets up a .bat logon script that runs net use to attach network shares to fixed drive letters (for example S: and H: ) every time a user signs in on a domain-joined Windows machine. Its purpose is consistent, hands-off drive mapping so users don't set them up manually.

7 min read

Monitor a Windows Service and Auto-Restart It with PowerShell

This guide builds a small watchdog: a PowerShell script that checks one named Windows service, and if it is not running, tries to start it and writes the outcome to a log file and the Windows event log. You then schedule it with Task Scheduler so it runs every few minutes. The script starts a stopped service — that is its whole point — so run it only against a service you actually want kept running. It does not delete or reconfigure anything, and starting a service is reversible (you can stop it again), so there is no destructive, one-way step here.

10 min read

Reset and Unlock AD User Accounts in Bulk with PowerShell

This guide resets the passwords of a list of Active Directory user accounts, clears any lockout on them, and flags each account to require a new password at the next sign-in. The usual reason is a batch of expired or compromised accounts, or a group of seasonal staff coming back online.

8 min read

Automate Temp and Log Cleanup with a Batch File

This guide builds a Windows batch file that deletes old log files from a folder you name and temporary files from a temp folder, based on how many days ago each file was last modified. Its purpose is to reclaim disk space on a schedule without you having to remember to do it.

9 min read

Email a Daily Windows Event Log Error Summary with PowerShell

This guide builds a small PowerShell script that reads the last 24 hours of Critical and Error events from the System and Application logs, writes them to an HTML file, and emails that file to you. It's a read-only report: it does not clear, modify, or delete any event log. The only things it creates on the system are the HTML report files in a folder you choose and — in the last section — a scheduled task.

10 min read

Bulk-Disable and Archive Inactive AD Accounts with PowerShell

This procedure finds enabled user accounts that have not logged on for a set number of days , disables them, stamps a note in the account's description, and moves them into a dedicated "archive" OU so they are out of your working OUs but not deleted. Its purpose is routine account hygiene: a disabled, quarantined account can't be used for a logon, which shrinks your attack surface, but nothing is destroyed and everything is reversible.

9 min read

Find and Report AD Accounts That Have Never Logged In

This guide gives you a PowerShell script that reads Active Directory and produces a report (on screen and as a CSV) of user accounts that have never authenticated against any domain controller. It changes nothing — it does not disable, delete, or edit a single account. Its purpose is to hand you a clean list of candidates for review before you decide what to do with them.

9 min read

Unlock a Locked-Out Active Directory Account with PowerShell

This guide uses the Unlock-ADAccount cmdlet to clear the locked-out state on an Active Directory user account — the state a user lands in after too many bad password attempts trip your domain lockout policy. Unlocking lets them log in again immediately; it does not change or reset their password.

7 min read

Batch-Create Active Directory Users from CSV with PowerShell

This guide gives you a PowerShell script that reads a CSV file of new employees and creates one Active Directory user account per row, with a per-row try/catch so that one bad line doesn't halt the whole batch. Its purpose is bulk onboarding — creating dozens or hundreds of accounts without clicking through the console each time.

8 min read

Add and Remove an AD User from Groups with PowerShell

These commands add a user account to an Active Directory security or distribution group, or remove it from one, using the ActiveDirectory PowerShell module. Group membership is how most access is granted in AD, so getting it right matters: adding a user to the wrong group can hand out access it should not have, and removing a user from a group can cut off access to file shares, mailboxes, or applications immediately at their next logon or token refresh.

7 min read

Reset an Active Directory User Password with PowerShell

This guide resets the password on one Active Directory user account, and optionally unlocks the account and forces the user to change the password at next logon. That is the entire scope: a targeted, single-user reset — the kind of thing you do a dozen times a week at a help desk.

8 min read

Whitelist or Blacklist per IP on Zimbra Server – Batch File

Are you getting many spam requests from IP addresses? Do you want to block or allow IPs instantly? It’s been one hectic task for Email Administrators when they need to manage IP based whitelist and blacklist. Well here is the hassle free solution…!!! Check out my other Zimbra Batch files: Zimbra User Management Zimbra Group / Distribution Lists Management You will have to apply and modify some of the changes to get this work for you on your Zimbra Open Source Collaboration Server. Here is the guide that you need to follow first before going further below. Click HERE I believe you have changed your…

7 min read

Zimbra User Management – Batch File

Everybody loves Zimbra. The best in class Zimbra Collaboration Open Source Email server with contacts, tasks and calendar management on your finger tips. I indeed love it and recommend it to small and medium businesses when they ask me how can we achieve best in-house Email server. Even many big data enterprises are also using this feature rich daemon. Find our more information about Zimbra here – Zimbra Collaboration Open Source Edition System / email administrators manages users from Zimbra Admin Panel where they can create / modify and delete users and do many things. However I find it quite lazy myself when administering users using Zimbra Admin Panel. Believe me, login on to Zimbra Admin panel, issuing…

12 min read