Category: Scripting

Review of “PowerShell Automation and Scripting for Cybersecurity”

….is a comprehensive guide for security professionals, penetration testers, system administrators, and both red and blue teams. It focuses on providing the knowledge needed to leverage PowerShell effectively for security operations. The book is authored by Miriam C. Wiesner, a Senior Security Researcher at Microsoft. From her public bio she brings over 15 years of […]

Retrieve Hashicorp Vault Secrets and Key Names

The web interface that is supplied with Vault has a Search capability, but it is limited. Users are not able to search for nested secrets or Key names. The PowerShell function below can be used to export complete secret paths and the key names. It requires use of the vault command line and that the […]

Crafting an Advanced PowerShell Function with Bing Copilot

In this post, I create an Advanced PowerShell Function that retrieves running services from a specified computer, complete with error handling and network checks, using Bing CoPilot. I’ll include the complete transcript of the conversation Bing Copilot is one of a number of AI applications based on OpenAI’s Large Language Models (I think GTP 4). […]

Disable or Warn Inactive Users

SYNOPSIS:Disable-InactiveUsers.ps1 Disable or warn inactive users that their accounts will be disabled. This script requires the AD comandlets and the ImportExcel module. DESCRIPTION: Disables Inactive users if the -Remediate switch is used. Writes user accounts that would be disabled to file if the -Remediate switch is not used. Creates a folder structure if doesn’t exist. […]

­­­­Pode, an OpenSource PowerShell Framework

The fantastic project brought to the Community by Matthew Kelly. Matthew describes Pode as, Pode is a Cross-Platform framework for creating web servers to host REST APIs, Web Pages, and SMTP/TCP Servers. Pode also allows you to render dynamic files using .pode files, which are just embedded PowerShell, or other Third-Party template engines. Pluss many […]

Refactoring

Refactoring. What is it and how does it fit into the pragmatist approach to scripting?From Wikipedia:“In computer programming and software design, code refactoring is the process of restructuring existing computer code without changing its external behavior. Refactoring is intended to improve the design, structure, and/or implementation of the software (its non-functional attributes), while preserving its […]

Design A Simple and Reusable Word Document Template Using PScribo Part 1

In this post I describe creating a simplified PowerShell script for creating a customizable subject matter document template using the PScribo module from the PowerShell Gallery. Goals: Reduce the amount of typing required to produce the document outline, cover, common text, etc. Provide functionality over and above use of a static Word document or template. […]