Script Library

Ready-to-Use PowerShell and Bash Scripts

Each script does one job. It has a description and is ready to copy. Run it on every device at once with Moftgate Scripts.

Script Library
Live data
28scripts
  • Windows18
  • macOS5
  • Linux5
By category
  • Network3
  • Disk and storage4
  • Inventory4
  • Security9
  • Updates4
  • Maintenance4
Last reviewed: November 6, 2026
LIBRARY

Find the script you need

Search by name, description or code.

28 scripts found

NetworkWindows · PowerShell

Clear the DNS Cache on Windows

Empties the DNS client cache. Use it when a site resolves to the wrong IP or a DNS record has just changed.

View script →
NetworkWindows · PowerShell

Reset the Windows Network Stack (Winsock and TCP/IP)

Resets the Winsock catalog and TCP/IP settings. Use it when the device cannot connect after a broken VPN or proxy install. A restart is required.

View script →
Disk and storageWindows · PowerShell

Windows Disk Space Report

Lists size, free space and free percent for all local disks. Flags disks below 10% free.

View script →
Disk and storageWindows · PowerShell

Clean Up Temporary Files on Windows

Deletes files older than 7 days in the Windows Temp folder and every user's Temp folder. Reports the space recovered.

View script →
Disk and storageWindows · PowerShell

Find the 20 Largest Files on Windows

Lists the 20 largest files under C:\Users with path and size. Use it to find why a disk is full.

View script →
InventoryWindows · PowerShell

List Installed Software on Windows

Lists installed programs with name, version and publisher from the 64-bit and 32-bit uninstall keys. It does not use Win32_Product, which can trigger MSI repairs.

View script →
InventoryWindows · PowerShell

Find Installed AI Apps on Windows

Searches machine and user uninstall keys for AI apps such as ChatGPT, Claude, Copilot, Cursor, Perplexity, Ollama and LM Studio. A first step for a Shadow AI inventory.

View script →
InventoryWindows · PowerShell

Windows System Information Summary

Returns computer name, manufacturer, model, serial number, OS version, CPU and RAM in one output.

View script →
MaintenanceWindows · PowerShell

Check Windows Uptime

Shows the last boot time and how many days the device has been on. Devices that do not restart for a long time do not finish patches.

View script →
UpdatesWindows · PowerShell

Check for a Pending Reboot on Windows

Checks Windows Update, Component Based Servicing (CBS) and pending file rename entries. Reports why a reboot is needed.

View script →
UpdatesWindows · PowerShell

List Recently Installed Windows Updates

Lists installed hotfixes with KB number and install date, newest first.

View script →
SecurityWindows · PowerShell

Check BitLocker Encryption Status

Shows BitLocker protection status, encryption percent and method for each volume. Exits with an error if the system drive is not encrypted.

View script →
SecurityWindows · PowerShell

Check Microsoft Defender Status

Shows whether real-time protection is on, the signature version and the signature age. Warns when signatures are older than 3 days.

View script →
SecurityWindows · PowerShell

Check Windows Firewall Profiles

Shows whether the Domain, Private and Public profiles are on, and the default inbound action.

View script →
SecurityWindows · PowerShell

List Local Administrators on Windows

Lists members of the local Administrators group. The group is found by its language-neutral SID (S-1-5-32-544), so it works on any Windows language.

View script →
SecurityWindows · PowerShell

Disable USB Storage on Windows

Disables the USBSTOR driver. Newly connected USB drives do not mount; keyboards and mice keep working. Set Start back to 3 to undo.

View script →
MaintenanceWindows · PowerShell

List Startup Programs on Windows

Lists programs that start at sign-in with their command and location. Use it to review slow boots and suspicious persistence.

View script →
MaintenanceWindows · PowerShell

Reset the Print Spooler

Stops the Spooler service, deletes stuck print jobs and starts the service again. Use it for jobs stuck in the queue.

View script →
NetworkmacOS · Bash

Flush the DNS Cache on macOS

Flushes the dscacheutil cache and reloads mDNSResponder. Requires root.

View script →
SecuritymacOS · Bash

Check FileVault Status on macOS

Checks whether FileVault disk encryption is on. Exits with an error if it is off.

View script →
SecuritymacOS · Bash

Check Gatekeeper and SIP on macOS

Shows whether Gatekeeper app assessment and System Integrity Protection (SIP) are on.

View script →
InventorymacOS · Bash

List Installed Applications on macOS with Versions

Lists apps under /Applications with their bundle version.

View script →
UpdatesmacOS · Bash

List Pending Software Updates on macOS

Lists pending macOS and security updates from Apple's update server. It does not install anything.

View script →
Disk and storageLinux · Bash

Linux Disk Usage Report

Shows usage of real file systems and lists those above 90% full separately.

View script →
UpdatesLinux · Bash

List Pending Package Updates on Linux

Detects apt or dnf and lists pending package updates. It does not install anything.

View script →
SecurityLinux · Bash

List Users with sudo Rights on Linux

Lists members of the sudo and wheel groups and extra rules under /etc/sudoers.d.

View script →
SecurityLinux · Bash

List Failed SSH Logins on Linux

Counts failed SSH password attempts in the last 24 hours by source IP. Use it to spot brute-force attacks.

View script →
MaintenanceLinux · Bash

Top CPU and Memory Processes on Linux

Lists the top 10 processes by CPU and by memory. The first output to read on a slow server.

View script →
HOW IT WORKS

Copy, test, roll out

  1. 01

    Copy

    Open the script and click Copy.

  2. 02

    Test

    Run it on one test device first and read the output.

  3. 03

    Roll out

    Send it to a group, profile or tag with Moftgate Scripts.

ENTERPRISE SECURITY & BUSINESS RESILIENCE

Run these scripts on every device in one click

Moftgate Scripts gives you target selection, a confirmation step, per-device output and an audit log. The first 200 endpoints are free for a year.