PowerShell
PowerCLI: Offline install PowerShell v3 and v4
· ☕ 1 min read · ✍️ Brett Johnson
Today I came across the need to use PowerCLI on a computer without internet access. Thankfully I found this blog post detailing the steps that I needed to perform, however not all was rainbows and unicorns. I quickly ran aground when attempting to import the modules. After a bit of research, I learnt that Microsoft had changed the module directory structure in PowerShell v5. This new structure is not compatible with previous versions.

PowerShell: Logging in JSON format
· ☕ 4 min read · ✍️ Brett Johnson
When writing scripts for clients, it’;s important to generate good logs. It’;s a common position where a script works perfectly in test. But in production something is askew. Being able to look back at the process and step through after the fact is essential. Usually my logs are written in CSV format. CSV is great for parsing. But, it’;s awful to run in a text file. Due to this, I decided to modify my log function.

Discover and Clear Admin Count Attribute with PowerShell
Discover and Clear Admin Count Attribute with PowerShell
· ☕ 3 min read · ✍️ Brett Johnson
What is Admin Count? Before we discuss Admin Count, a little background is needed. AD contains an object called AdminSDHolder. Its purpose is to protect objects. Specifically, objects which are members of administrative groups. AD objects have an attribute called “Admin Count”. The default value is for most objects. Changing the value to “1”, flags the account as protected by AdminSDHolder. By adding a user to an administrative AD group. You change the value to “1”.

PowerShell Script for Data Migration
· ☕ 4 min read · ✍️ Brett Johnson
I recently needed to create a script for the purpose of migrating data. Due to complexity, a number of scripts were used. This post covers the script I created to remove illegal characters from directory names. Also adjusting for new directory paths. Migration Overview The migration had some quirks. Due to this, a simple A to B move wasn’;t an option. There was some restructuring and many folders were not to coming across.