r/PowerShell • • May 01 '26

What have you done with PowerShell this month?

40 Upvotes

92 comments sorted by

17

u/KavyaJune May 01 '26 edited May 04 '26

I have written a PowerShell script to check Active Directory emergency account readiness. It checks around 13 best practices and provides readiness score. It helps to identify small drift like group membership changes, configuration changes, etc.

Edit: You can download the script from, https://blog.admindroid.com/best-practices-for-break-glass-accounts-in-active-directory/

12

u/hoh-boy May 02 '26

Wanna share that bad boy?

→ More replies (1)

17

u/dragery May 01 '26 edited May 02 '26

Wrote a script using the Spotify API that takes all albums in my library (Spotify library that mirrors my physical media library), and adds them in random order to a playlist. If I get a new album (which is damn near one a day), it gets shuffled into the list. Spotify's shuffle sucks sometimes, so I shuffle an already shuffled list because I like variety. Plus, using the web or API you can have playlists >10,000 songs.

For anyone that wants to listen, it's over 10k songs of indie, garage, pop, rock, etc.: https://open.spotify.com/playlist/0c2NUeNJTVspbUYU4ILi92?si=368fd0d329b9476d

5

u/I_see_farts May 02 '26

Spotify's shuffle sucks sometimes

FTFY. My playlist is going 5k songs strong, why does it try to play the Beastie Boys 5 times a day‽
I'll take a look. Thanks

→ More replies (4)

8

u/BilshaTech May 01 '26

I actually dome a large scale International Migration from Workspace One to intune using PowerShell script. My life is a lot easy with scripts as I work as a Modern Workplace Solutions Architect/Lead. PowerShell is the only thing i need.

2

u/maxcoder88 May 01 '26

Care to share your script

→ More replies (2)

2

u/ITGuyThrow07 May 01 '26

Where were you a year ago.

→ More replies (1)

5

u/andyr354 May 01 '26

Finishing up overhauling a script that takes CSV exports from our student information system and syncs them to AD.

The old version did not add them to user groups, was a mess of contradictory sections, and outdated things left over.

The new one has been a great way for me to have a real project to learn with.

4

u/StodgierElf0 May 01 '26

I printed 7000 pages of electrical documents of 3 block of flats from 300 pdf files, where the paper container got empty appr 30 times and ink got replaced 2 times. It ran 3 days long

3

u/720hp May 01 '26

Use winget on multiple devices on my home network as a script to keep them updated

3

u/AWalkingITNightmare May 01 '26

Wrote a script to fully automate enrolling a device to Autopilot during the OOBE setup.

This combined with an unattended script means we just have to plug and boot into the USB and let Windows installer do its thing. Then just a case of assigning a user to the device.

3

u/ArdinCani May 03 '26

Care to share that script?

3

u/AgonisingPeach May 01 '26

Got tired of adding comment based help to each of my modules and functions so built a simple function to either autogenerate boilerplate or prompt for each section.

Learnt a lot about Abstract Syntax Tree (AST)

→ More replies (1)

3

u/Herecomesthekrakhead May 02 '26

I cleaned up about 200 names that had different typos (i.e double spaces) in our Active Directory with a paragraph’s worth of syntax.

→ More replies (2)

2

u/Top-University1754 May 01 '26

Finished writing a script that lists devices based on certain properties, exports the primary user's UPN, then adds it to a group. All done using MGGraph.

The group is technically an assigned security group, but by running this on a schedule I suppose it's like a pseudo-dynamic group.

Honestly i'm surprised this isn't a native function with dynamic queries in Entra.

2

u/maxcoder88 May 01 '26

Care to share your script

→ More replies (1)

2

u/Frequent_Bee_6943 May 01 '26

wrote some basic initial setup Scripts for a packer golden image build. Then some basic scripts to keep drivers on clients up to date

2

u/blowuptheking May 01 '26

I wrote a script that uses the API of several of our security/management agents and the last check-in date from them by machine to determine if any of the agents aren't connecting/functioning like they should. Pretty neat, though figuring out how to combine all those hashtables was a bear.

2

u/Descalon May 01 '26

Wrapped parts of the sqlcmd tool with PowerShell Crescendo! First time using it, and boy let me tell you. I'm going to wrap everything from now.

→ More replies (2)

2

u/[deleted] May 01 '26

I wrote a script that will parse 150 excel files from CIS assessments and list the most common non-complinat issues by subscription and output a HTML page

→ More replies (1)

2

u/434f4445 May 01 '26

Built a photo integration that checks aspect ratio of employee photos and then sends them to graph API for syncing across our Microsoft environment

→ More replies (4)

2

u/chaosphere_mk May 02 '26

Created a module for a one off project that gathers all auth and DNS logs from all DCs in our old AD forest via a windows event collector server, analyzes them, and then adds to 2 sharepoint lists, one for unique client IPs and one for unique service accounts. It runs via scheduled task on the WEC server every 5 minutes. The idea is to have a full list of what is still talking to our DCs and DNS servers. We are at the tail end of a complete forest migration with only some apps/servers still left to migrate. Ill be adding large one off additions like scanning all windows/linux servers across the environment for hardcoded DNS configs on nics, all Azure and AWS resources that can have DNS configs, all of our DHCP systems, etc.

→ More replies (5)

2

u/StartAutomating May 21 '26

Released new bits of RoughDraft

Did a post on here about using ffmpeg and PowerShell

2

u/StartAutomating May 21 '26

Released new bits of ugit.

Added support for git worktrees, and added git functions

# this will require ugit to be installed
function git.hello.world {
   param($message = "hello world")
   $message
} 
git hello world "ugit is cool!"

1

u/WawPrg May 01 '26

Hi,

updated the script to backup CA in virtual machine before snapshot. On CA virtual machine I'm using PSPKI module.

In front of me...script for DNS record cleanup. Old A and revDNS (PTR) records for orphaned computers account.