Scripts: Powershell

« All scripts

Powershell345 lines

PowerShell: Bulk Add Users to Microsoft Entra Groups

This script adds lists of users to one or more Microsoft Entra ID groups in bulk, using the Microsoft Graph PowerShell SDK. It’s built for license-group provisioning scenarios where you need to drop a batch of UPNs into specific groups and get a clear record of what happened. You’d run this when onboarding a wave of users, rolling out a licensed feature, or cleaning up group membership after an org change.

Read »
Powershell130 lines

PowerShell Login Script: Drive Mapping and Greeting Popup

This script is a modern PowerShell replacement for the classic VBScript logon script. It maps network drives for all users, maps additional drives based on AD group membership, and shows a time-of-day greeting popup at login. Deploy it via GPO under User Configuration > Policies > Windows Settings > Scripts (Logon), PowerShell Scripts tab.

Read »
Text

Managing AD Groups with PowerShell

As a Windows system administrator, managing Active Directory (AD) groups is probably something you do every day. While you could use the Active Directory Users and Computers (ADUC) MMC snap-in, what happens when you need to manage groups across multiple domains or automate group management tasks? That’s where PowerShell comes in handy.

Read »
Powershell71 lines

Add a User to Multiple AD Groups at Once

This script takes a list of email addresses and adds those users to a defined set of AD groups, skipping anyone already a member. You’d run this when onboarding someone who needs access to several groups at once and you don’t want to click through ADUC five times.

Read »
Powershell23 lines

Generate Random Passphrase Passwords with PowerShell

This script builds a random passphrase by pulling words, numbers, and special characters from CSV wordlists and concatenating them until the result hits a minimum length of 15 characters. It’s useful when you need a human-readable but policy-compliant password without reaching for a third-party tool.

Read »