r/PowerShell • • Mar 04 '20

New PowerShell Version - v7.0.0

Thumbnail
github.com
160 Upvotes

r/PowerShell • • Dec 01 '19

Script Sharing Enter-BSOD (PS-script to prank your friends into a fake 'Blue Screen of Death')

Thumbnail pastebin.com
160 Upvotes

r/PowerShell • • Oct 29 '17

Warn Office 365 users when an external sender has the same display name as an internal user in all customer tenants

Thumbnail
gcits.com
160 Upvotes

r/PowerShell • • Jan 01 '26

New Version KRBTGT Password Reset Script Released

159 Upvotes

FYI: the newest version of the KRBTGT Password Reset script has just been released!

Wanna try it out? Get it here: https://jorgequestforknowledge.wordpress.com/2026/01/01/powershell-script-to-reset-the-krbtgt-account-password-keys-for-both-rwdcs-and-rodcs-update-8/

Any feedback/comments? Please use https://github.com/zjorz/Public-AD-Scripts/issues


r/PowerShell • • Apr 13 '24

Microsoft Graph - Am I just an idiot?

159 Upvotes

I'll admit my PowerShell skills are mediocre at best, but the Microsoft Graph module is really making my head hurt. I'm trying to create a fairly basic script to to pull some logs from Entra. Before, this was quite straightforward using the AzureAD module, but the Graph cmdlets are constantly running into errors. The documentation is very hard to follow and the whole thing doesn't seem remotely intuitive. Is anyone else finding this or is it just me?


r/PowerShell • • Mar 21 '24

I Love PowerShell

159 Upvotes

Sometimes I forget that PowerShell is not all scripting. Sometimes a simple cmdlet gives you exactly what you need. Like joining a remote client to the domain. Desktop support has been waiting over a week to get access to a computer that someone forgot to AD join.

A simple "Add-Computer" and it's done. No local access required . No user interuption needed.


r/PowerShell • • Jul 28 '22

Question Adding a GUI for Powershell scripts - Preferred and Easiest method

159 Upvotes

I had been looking for a way to add a GUI to my powershell scripts in the past and could not find one that was simple enough for me to get started.
I am aware normally its built using .NET but I think the learning curve on that would be a bit intense just to learn how to add some GUI to my scripts? If someone know any specifc training I would appreciate.

I know how to use Tkinter on Python, and have tried some parse powershell commands to python but the results were kind of messy and not really friendly.

Does anyone know what is the best, and what is the easiest option to go around learning how to add my scripts to a GUI format?


r/PowerShell • • Oct 15 '21

Some powershell beep

158 Upvotes

I'm probably not very productive today... So may be someone will find these interesting :

White stripes : 7 nation army:

[System.Console]::Beep(196,1200);
[System.Console]::Beep(196,300);
[System.Console]::Beep(220,400);
[System.Console]::Beep(196,400);
[System.Console]::Beep(174,300);
[System.Console]::Beep(155,1000);
[System.Console]::Beep(146,1000);
[System.Console]::Beep(196,1000);
[System.Console]::Beep(196,300);
[System.Console]::Beep(220,400);
[System.Console]::Beep(196,400);
[System.Console]::Beep(174,300);
[System.Console]::Beep(155,400);
[System.Console]::Beep(174,300);
[System.Console]::Beep(155,400);
[System.Console]::Beep(146,1000);

Haloween:

[System.Console]::Beep(1109,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(1109,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(1109,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(1175,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(1109,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(1109,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(1109,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(1175,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(1109,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(1109,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(1109,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(1175,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(1109,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(1109,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(1109,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(1175,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(1109,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(1109,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(1109,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(1175,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(1109,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(1109,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(1109,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(1175,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(1109,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(1109,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(1109,200);
[System.Console]::Beep(740,200);
[System.Console]::Beep(1175,200);
[System.Console]::Beep(740,200);

Enjoy the beep :)

( Edit 1&2 : formating )


r/PowerShell • • Sep 10 '21

Just to share a Microsoft Virtual Academy super enjoyable Powershell course for new users

157 Upvotes

I found this Powershell course dictated by the inventor of Powershell, doing a walktrhough on all the coolest features, ideal for newbies! Don't be scared by the 6-hour duration, it is super easy to see and follow, an I am currently on the fourth hour, watching it little by little for about three days, and I love it!

You can see the wole though and effort they put to be easy to use!

EDIT:mistype


r/PowerShell • • Mar 24 '21

PoshGUI is no longer free

157 Upvotes

r/PowerShell • • Dec 01 '20

Want to practice your skills? Advent of Code 2020 went live today!

157 Upvotes

Howdy folks,

Friendly reminder that Advent of Code started today! Time to save Santa. Or maybe the elves. Or maybe Rudolph or something. I dunno, but it's a great way to learn/practice coding.

If you are not familiar with Advent of Code it's a yearly game with coding problems that span from Dec. 1st to Dec. 25th. I can honestly say that I learn at least few new techniques every year whilst solving the puzzles.

Happy Holidays :-)

edit: This really blew up! Perhaps we should start our own daily thread for each day? There is the /r/adventofcode sub, but I've found very few Posh submissions there. Anyways, I'm so glad others are having fun with this. And they have past years to test your skills. :-)


r/PowerShell • • Jul 22 '20

News Windows Terminal Preview 1.2 Release | Windows Command Line

Thumbnail
devblogs.microsoft.com
157 Upvotes

r/PowerShell • • Feb 19 '20

Script Sharing Finding GPOs missing permissions that may prevent GPOs from working correctly

157 Upvotes

Hi guys,

Recently I had another domain (pretty big one actually - 4000 GPOs) that had about 50-100 GPO's broken because of missing permissions.

This blog post talks about it and shows how to fix: https://evotec.xyz/finding-gpos-missing-permissions-that-may-prevent-gpos-from-working-correctly/

It all comes down to running:

Install-Module ADEssentials -Force
$MissingPermissions = Get-WinADGPOMissingPermissions -Mode Either
$MissingPermissions | Format-Table -AutoSize

Here's the output:

This scans the whole forest and all GPO's and searches for Authenticated users or Domain Computers permission missing from GPO's. It only does the scan, I didn't want to fix it. Not today at least.

It requires RSAT (AD+GPO).

Enjoy


r/PowerShell • • Nov 28 '22

PSMSI: Create MSIs with PowerShell

Thumbnail
github.com
156 Upvotes

r/PowerShell • • Mar 28 '22

Script Sharing Here are 15 PowerShell functions for your day-to-day Intune needs

156 Upvotes

Hi all,

First, I would like to thank everyone for their feedback on the initial release of my Azure Administrator app. I've heard the feedback, and will soon be releasing an update that includes many of your day-to-day Intune needs.

That's actually why I'm writing this, I just finished all the primary functions that I'll be utilizing for the Intune module, and wanted to share the PowerShell source code for folks who want to adopt the functions into their environment without the GUI application. Here are 15 Intune-based functions, all with functionality descriptions. As with my AAD functions, you'll need to set up a registered app in AAD and configure graph permissions accordingly: Get access on behalf of a user - Microsoft Graph | Microsoft Docs

Required app Graph API permissions:

  • Assign-IntuneApp: DeviceManagementApps.ReadWrite.All

  • Assign-IntuneCompliancePolicy: DeviceManagementConfiguration.ReadWrite.All

  • Assign-IntuneDeviceConfiguration: DeviceManagementConfiguration.ReadWrite.All

  • Get-IntuneApp: DeviceManagementApps.Read.All or DeviceManagementApps.ReadWrite.All

  • Get-IntuneCompliancePolicy: DeviceManagementConfiguration.Read.All or DeviceManagementConfiguration.ReadWrite.All

  • Get-IntuneDevice: DeviceManagementManagedDevices.Read.All or DeviceManagementManagedDevices.ReadWrite.All

  • Get-IntuneDeviceConfiguration: DeviceManagementConfiguration.Read.All or DeviceManagementConfiguration.ReadWrite.All

  • Get-IntuneDeviceLastSync: DeviceManagementManagedDevices.Read.All or DeviceManagementManagedDevices.ReadWrite.All

  • Get-IntuneDeviceLastUser: DeviceManagementManagedDevices.Read.All or DeviceManagementManagedDevices.ReadWrite.All

  • Get-IntuneDevicePrimaryUser: DeviceManagementManagedDevices.Read.All or DeviceManagementManagedDevices.ReadWrite.All

  • Reboot-IntuneDevice: DeviceManagementManagedDevices.PriviligedOperation.All

  • Reset-IntuneDevice: DeviceManagementManagedDevices.ReadWrite.All or DeviceManagementManagedDevices.PriviligedOperation.All

  • Set-IntuneDevicePrimaryUser: DeviceManagementManagedDevices.Read.All or DeviceManagementManagedDevices.ReadWrite.All

  • Sync-IntuneDevice: DeviceManagementManagedDevices.PriviligedOperation.All

For those who are interested in the GUI app, stay tuned! I hope to have the update published this week.


r/PowerShell • • Jan 30 '19

Listing Office365 Outages

156 Upvotes

I was asked for this in another sub, but will post here for the delight and ridicule of the PS community.
in light of the recent (and ever-increasing) Office365 outages, I mangled up some code to list the outages O365 has endured so far this year.
Many people lovingly refer to O365 with an ever-decreasing number after each outage, O364, O356 etc, so I also managed to come up with code that would output an accurate name for the current state of the service. Anyway, here goes...

function Get-O365Outages {
param(
[Parameter(Mandatory=$false)]
[Microsoft.PowerShell.Commands.HtmlWebResponseObject]$WebRequest,
[Parameter(Mandatory=$false)]
[int]$TableNumber=0
)

## Connect to the ITSD O365 Outage page if no Request is passed through - also auto-determine the security protocol to use
[Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls"
if (!$WebRequest) { $WebRequest=(iwr "https://istheservicedown.co.uk/status/office-365/history") }

## Extract the tables out of the web request
$tables=@($WebRequest.ParsedHtml.getElementsByTagName("TABLE"))
$table=$tables[$TableNumber]
$titles=@()
$rows=@($table.Rows)
## Go through all of the rows in the table

foreach($row in $rows){
	$cells = @($row.Cells)
	## If we've found a table header, remember its titles
	if($cells[0].tagName -eq "TH"){
		$titles = @($cells | % { ("" + $_.InnerText).Trim() })
		continue
    }

    ## If we haven't found any table headers, make up names "P1", "P2", etc.
    if(-not $titles){ $titles = @(1..($cells.Count + 2) | % { "P$_" }) }

    ## Now go through the cells in the the row. For each, try to find the
    ## title that represents that column and create a hashtable mapping those
    ## titles to content
    $resultObject = [Ordered] @{}

    for($counter = 0; $counter -lt $cells.Count; $counter++){
        $title = $titles[$counter]
        if(-not $title) { continue }
        $resultObject[$title] = ("" + $cells[$counter].InnerText).Trim()
    }

    ## And finally cast that hashtable to a PSCustomObject
    [PSCustomObject] $resultObject
}
}

Output looks like this...

C:\»Get-O365Outages

Date             Started Ended Duration
----             ------- ----- --------
January 29 2019  15:05   15:07 00:02:17
January 25 2019  21:35   22:37 01:02:28
January 25 2019  21:00   21:01 00:01:17
January 25 2019  12:05   14:28 02:23:38
January 25 2019  09:00   12:00 02:59:40
January 24 2019  22:20   08:48 10:28:29
January 24 2019  09:40   22:06 12:26:25
January 17 2019  15:00   15:02 00:02:41
November 28 2018 15:40   15:43 00:03:10
November 27 2018 17:20   17:33 00:13:13
November 27 2018 15:00   16:10 01:10:01
November 27 2018 14:20   14:38 00:18:24
November 27 2018 11:20   11:39 00:19:05
November 26 2018 17:00   17:18 00:18:19
November 26 2018 12:35   14:26 01:50:55
November 19 2018 21:01   02:03 05:02:25
November 19 2018 10:05   20:54 10:49:13
November 19 2018 08:35   09:27 00:52:00
November 13 2018 18:30   19:19 00:49:02
November 06 2018 12:20   12:21 00:01:03
October 12 2018  09:00   09:11 00:11:02
October 11 2018  16:55   21:38 04:43:20
October 05 2018  17:00   17:00 00:00:01

And that joke-name command:

C:\»write-host "Todays Office365 is currently known as Office$(365-(Get-O365Outages | ? { $_.date -match (Get-Date).Year} | select -unique date).count)"
Todays Office365 is currently known as Office361

r/PowerShell • • Jan 19 '17

Learn Powershell in 5 Painless Steps - Storage

Thumbnail
blog.beyondimpactllc.com
156 Upvotes

r/PowerShell • • Apr 12 '26

Solved Is it worth learning PowerShell?

155 Upvotes

I’ve previously used Linux, where things felt very straightforward. Due to various reasons, I’m planning to stay on Windows for now. Since I’m here, I’d like to automate different tasks and deepen my understanding of Windows.

Because of my Linux background, I used the terminal a lot and really enjoyed it. Windows, on the other hand, feels much more GUI-oriented, with less emphasis on the command line. I’ve also briefly looked into PowerShell, and honestly, it feels a bit strange to me.

At this point, I’m not sure whether it’s worth investing time into learning it. The command structure, constant interaction with system services (and sometimes the internet), and the overall behavior of the terminal feel unusual.

Compared to Linux, it seems quite weird (to put it mildly). I assume that if I spend more time with it, I’ll understand its design and decisions better—but I’m still unsure.

So I wanted to ask: is it actually worth it?

EDITED:

I’m definitely going to start learning PowerShell. As I understand it, over the next few years, it will definitely pay for itself.

There were also comments about Azure, servers, and cloud services. I don’t plan on becoming a sysadmin and, for now, I only use my personal computer and maybe a laptop. The Microsoft ecosystem seems strange, but I’m getting more and more used to it, despite my dislike of big corporations (which is ironic).

Also, thank you for the quick feedback. That was incredibly kind of you. I’m just starting to get involved in the Windows community, and specifically in PowerShell, so this warmth really surprised and delighted me. Maybe I spend too much time in the toxic parts of the internet.


r/PowerShell • • May 15 '22

I got tired of looking up group membership details for people that don't have access to ADUC. I used Powershell to make a GUI tool that anyone can use.

Thumbnail
techbloggingfool.com
155 Upvotes

r/PowerShell • • Jul 20 '20

Free virtual PowerShell Conference with keynote speaker Jeffery Snover

Thumbnail
chicagopowershell.com
155 Upvotes

r/PowerShell • • Feb 16 '20

Script Sharing Can we start a PowerShell project of the day?

155 Upvotes

Kind of like on r/dailyprogrammer

It would be really nice honestly and a way for all of us to get better at this craft. :)

I am also really curious to see how others would tackle things. So, for example if the project of the day (potd) was "Create a simple script that pulls inventory info then sends them via email in a csv file"

I don't know, hopefully the mods approve.


r/PowerShell • • Jun 20 '19

News dbatools 1.0 has arrived

Thumbnail
dbatools.io
154 Upvotes

r/PowerShell • • Sep 06 '18

Help your users help the helpdesk. Introducing Show-Systeminfo.

Thumbnail
github.com
154 Upvotes

r/PowerShell • • Apr 10 '18

Create a Real Time Interactive Dashboard for Office 365 Using PowerShell Universal Dashboard

Thumbnail
thelazyadministrator.com
154 Upvotes