r/PowerShell • • Jul 03 '21

Misc /u/betterthangoku has passed away

925 Upvotes

My husband was an active member of this group. It is with great sadness to tell you that he died at the age of 44 of a heart attack on the 9th. Thank you everyone and God Bless


r/PowerShell • • Apr 28 '19

The only PowerShell Command you will ever need to find out who did what in Active Directory

802 Upvotes

Here's a small PowerShell command/module I've written. It contains the following reports.

Usage:

Find-Events -Report ADGroupMembershipChanges -DatesRange Last3days -Servers AD1, AD2 | Format-Table -AutoSize

ReportTypes:

  • Computer changes – Created / Changed – ADComputerCreatedChanged

  • Computer changes – Detailed – ADComputerChangesDetailed

  • Computer deleted – ADComputerDeleted

  • Group changes – ADGroupChanges

  • Group changes – Detailed – ADGroupChangesDetailed

  • Group changes – Created / Deleted – ADGroupCreateDelete

  • Group enumeration – ADGroupEnumeration

  • Group membership changes – ADGroupMembershipChanges

  • Group policy changes – ADGroupPolicyChanges

  • Logs Cleared Other – ADLogsClearedOther

  • Logs Cleared Security – ADLogsClearedSecurity

  • User changes – ADUserChanges

  • User changes detailed – ADUserChangesDetailed

  • User lockouts – ADUserLockouts

  • User logon – ADUserLogon

  • User logon Kerberos – ADUserLogonKerberos

  • User status changes – ADUserStatus

  • User unlocks – ADUserUnlocked

DatesRanges are also provided. Basically what that command does it scans DC's for event types you want it to scan. It does that in parallel, it overcomes limitations of Get-WinEvent and generally prettifies output.

The output of that command (wrapped in Dashimo to show the data): https://evotec.xyz/wp-content/uploads/2019/04/DashboardFromEvents.html

GitHub Sources: https://github.com/EvotecIT/PSWinReporting

Full article (usage/know-how): https://evotec.xyz/the-only-powershell-command-you-will-ever-need-to-find-out-who-did-what-in-active-directory/

Hope you like it :-)


r/PowerShell • • Jun 01 '19

Examples every time

Post image
782 Upvotes

r/PowerShell • • Jan 24 '21

Script Sharing The only command you will ever need to understand and fix your Group Policies (GPO)

669 Upvotes

In the last few months, I've limited my sharing to a minimum. Not by choice, but more like lack of time - being preoccupied with work and working on some cool PowerShell based projects. One of those projects which required a lot of effort and understanding of how Group Policies work is GPOZaurr. So today you get to meet it yourself - let me know what you think :-)

A blog post about it (to get more details):

Source codes:

GPOZaurr is a free PowerShell module that contains a lot of different small and large cmdlets. Today's focus, however, is all about one command, Invoke-GPOZaurr.

Invoke-GPOZaurr

Just by running one line of code (of course, you need the module installed first), you can access a few built-in reports. Some of them are more advanced, some of them are for review only. Here's the full list for today. Not everything is 100% finished. Some will require some updates soon as I get more time and feedback. Feel free to report issues/improve those reports with more information.

  • GPOBroken – this report can detect GPOs that are broken. By broken GPOs, I mean those which exist in AD but have no SYSVOL content or vice versa – have SYSVOL content, but there's no AD metadata. Additionally, it can detect GPO objects that are no longer GroupPolicy objects (how that happens, I'm not able to tell - replication issue, I guess). Then it provides an easy way to fix it using given step by step instructions.

  • GPOBrokenLink – this report can detect links that have no matching GPO. For example, if a GPO is deleted, sometimes links to that GPO are not properly removed. This command can detect that and propose a solution.

  • GPOOwners – this report focuses on GPO Owners. By design, if Domain Admin creates GPO, the owner of GPO is the domain admins group. This report detects GPOs that are not owned by Domain Admins (in both SYSVOL and AD) and provides a way to fix them.

  • GPOConsistency – this report detects inconsistent permissions between Active Directory and SYSVOL, verifying that files/folders inside each GPO match permissions as required. It then provides you an option to fix it.

  • GPODuplicates – this report detects GPOs that are CNF, otherwise known as duplicate AD Objects, and provides a way to remove them.

  • GPOList – this report summarizes all group policies focusing on detecting Empty, Unlinked, Disabled, No Apply Permissions GPOs. It also can detect GPOs that are not optimized or have potential problems (disabled section, but still settings in it)

  • GPOLinks – this report summarizes links showing where the GPO is linked, whether it's linked to any site, cross-domain, or the status of links.

  • GPOPassword – this report should detect passwords stored in GPOs.

  • GPOPermissions – this report provides full permissions overview for all GPOs. It detects GPOs missing readmissions for Authenticated Users, GPOs that miss Domain Admins, Enterprise Admins, or SYSTEM permissions. It also detects GPOs that have Unknown permissions available. Finally, it allows you to fix permissions for all those GPOs easily. It's basically a one-stop for all permission needs.

  • GPOPermissionsAdministrative – this report focuses only on detecting missing Domain Admins, Enterprise Admins permissions and allows you to fix those in no time.

  • GPOPermissionsRead – similar to an administrative report, but this one focuses on Authenticated Users missing their permissions.

  • GPOPermissionsRoot – this report shows all permissions assigned to the root of the group policy container. It allows you to verify who can manage all GPOs quickly.

  • GPOPermissionsUnknown – this report focuses on detecting unknown permissions (deleted users) and allows you to remove them painlessly.

  • GPOFiles – this report lists all files in the SYSVOL folder (including hidden ones) and tries to make a decent guess whether the file placement based on extension/type makes sense or requires additional verification. This was written to find potential malware or legacy files that can be safely deleted.

  • GPOBlockedInheritance – this report checks for all Organizational Units with blocked inheritance and verifies the number of users or computers affected.

  • GPOAnalysis – this report reads all content of group policies and puts them into 70+ categories. It can show things like GPOs that do Drive Mapping, Bitlocker, Laps, Printers, etc. It's handy to find dead settings, dead hosts, or settings that no longer make sense.

  • NetLogonOwners – this report focuses on detecting NetLogon Owners and a way to fix it to default, secure values. NetLogonPermissions – this report provides an overview and assessment of all permissions on the NetLogon share.

  • SysVolLegacyFiles – this report detects SYSVOL Legacy Files (.adm) files.

Of course, GPOZaurr is not only one cmdlet - but those reports are now exposed and easy to use. This time I've not only focused on cmdlets you can use in PowerShell, but something that you can learn from and get the documentation at the same time.

To get yourself up and running you're just one command away:

Install-Module GPOZaurr -Force

Here are some screenshots to show you what the command does. Most of the reports have a description, a chart, data, and a solution to fix your issue.

Enjoy. If you like my work, I would be grateful for a star or two on Github. Thank you.


r/PowerShell • • May 31 '19

Thought of this during a training class

Post image
665 Upvotes

r/PowerShell • • Feb 08 '25

Question Is there a PowerShell tip or trick you wish you knew when you first started?

619 Upvotes

Thought it would be pretty cool to see some things you learned later on that you wish you knew earlier.


r/PowerShell • • Nov 26 '19

Misc So say we all!

Post image
568 Upvotes

r/PowerShell • • Nov 24 '16

News Free Online PowerShell GUI Designer

Thumbnail
poshgui.com
543 Upvotes

r/PowerShell • • Aug 03 '19

My husband is teaching me to code for the first time ever in PowerShell. I added my own personal touch.

Post image
534 Upvotes

r/PowerShell • • Sep 12 '19

PowerShell All the Things

Post image
505 Upvotes

r/PowerShell • • Apr 09 '18

Congrats /u/Lee_Dailey, you are a 2018 PowerShell Hero!

Thumbnail
imgur.com
491 Upvotes

r/PowerShell • • Nov 09 '20

I turned my election stress into stuff

Thumbnail
gallery
488 Upvotes

r/PowerShell • • Oct 26 '19

Misc Get-Bugs

Post image
463 Upvotes

r/PowerShell • • Apr 29 '19

A Glorious Day

Post image
462 Upvotes

r/PowerShell • • May 12 '20

Misc Mr. /u/Lee_Dailey (Thanks for what you do)

Post image
445 Upvotes

r/PowerShell • • Jan 01 '19

Script Sharing Eat better in 2018, a script to generate a weekly meal plan

443 Upvotes

Happy new year /r/PowerShell !

I started a script before Christmas and thought i would share it with you, someone might find another use for it.

So my wife and I got sick of eating the same set of meals week in week out, so we put together a spreadsheet of the recipes we use on a regular basis and built a little set of Excel functions to automatically generate a menu for 4 weeks.

After a month or so we found our shopping bills had cut down by 40-50% as there was little to no waste due to things that seemed like a good idea when shopping or we just didn't have time to make.

This had some issues; we would get duplicates, we couldn't tell which would make enough for leftovers for lunch the day after and most importantly we had to check the recipes for that week and work out a shopping list.

This script addresses those issues and generates a (poorly written) HTML page for the menu and one for the shopping list which can then be printed or whatever you need to do with it.

A copy of the script can be found here on Github: https://github.com/n3rden/Random-Powershell-Scripts/tree/master/New-WeeklyMenu

Update the RecipesList.xlsx with your own.

It doesn't do Mondays and Fridays as we don't need these but if you don't go to my mum's house for tea on a Monday or Friday then you can fix this by commenting out lines 172 and 173.


r/PowerShell • • Dec 20 '24

"it’s hard to learn and not useful"

434 Upvotes

Yesterday, during an open school day, a father and his son walked into the IT classroom and asked some questions about the curriculum. As a teacher, I explained that it included PowerShell. The father almost jumped scared and said he works as a system administrator in Office365 at an IT company where PowerShell wasn’t considered useful enough. He added that he preferred point-and-click tasks and found PowerShell too hard to learn. So I could have explained the benefits of PowerShell and what you can achieve with it, but he had already made up his mind "it’s hard to learn and not useful". How would you have responded to this?


r/PowerShell • • Jan 19 '20

Four commands to help you track down insecure LDAP Bindings before March 2020

427 Upvotes

So in march 2020, Microsoft is supposed to block insecure LDAP bindings. I've updated my 3 Powershell modules to help you track down machines/accounts doing that.

Blog post with know-how and images: https://evotec.xyz/four-commands-to-help-you-track-down-insecure-ldap-bindings-before-march-2020/

Instead of spending time manually scrolling thru logs or enabling LDAP diagnostics... you do it in 8 lines of code

To find out about events:

$Events = Find-Events -Report LdapBindingsDetails,LdapBindingsSummary -DatesRange Last7days -DetectDC
$Events
$EVents.LdapBindingsSummary | Out-htmlView -ScrollX
$Events.LdapBindingsDetails | Out-HtmlView -ScrollX

To enable/disable diagnostics on whole forest/domain with the ability to exclude/include

Get-WinADDiagnostics
Set-WinADDiagnostics -Diagnostics 'LDAP Interface Events' -Level Basic -SkipRoDC

To scan DC's and see if they are affected.

invoke-testimo -Sources DCLDAPInsecureBindings -showreport

More information is in the blog post. Enjoy


r/PowerShell • • Aug 28 '20

News IT Admin Toolkit - A Customizable and Expandable Destination For Centralizing Day-To-Day Job Functions

Thumbnail
nkasco.com
423 Upvotes

r/PowerShell • • May 12 '20

Script Sharing I wrote a script and converted it to an exe file that we are able to put on our user's desktops that allows them to double click and run this. It allows them to see a list of our printers by floor and under each list is a map of that floor and where each printer is! Makes it easier for everyone :)

Post image
405 Upvotes

r/PowerShell • • Jul 09 '19

Misc My r/Powershell thought of the day

Post image
405 Upvotes

r/PowerShell • • Jul 29 '19

Automation 🙂

Post image
401 Upvotes

r/PowerShell • • Apr 12 '26

Misc So I ported Doom to Powershell.......

399 Upvotes

I guess I'm close enough to let the cat out of the bag...

At some point for the hell of it I wondered what I could make powershell do.
I made a window and drew pixels with ogl using sdl2 I believe, registering inputs on the window.
My immediate thought was, has anyone ported Doom to Powershell ?
No, all I could find was dismissive comments, so I was thinking....

"I got only 2 things left to do."
Play music and play sound effects and not halting the loop, and that was easy and all the reasons it couldn't atleast technically run was out the window.
Doom is ported nearly everywhere, so I saw it as my duty and off I went!

it runs excessively slow.
Especially with Windows due to Anti Malware Scan Interface.
Linux runs a lot faster.

I lean on the shoulders of the Managed Doom Project.
https://github.com/sinshu/managed-doom

What doesn't work ?
Framecap, splash screen and level completion summary will run at likely vsync.

amd64 Windows,macos (arm) and amd64 Linux Powershell 7.5.4 and 7.6 have been tested.
An earlier build with macos has been tested but need to validate if I've done some hard coding.

as for libraries, I use the same libraries as Managed-Doom Project.
4 small parts had to be written in c# either cause I'm too dense to find a way around or just cause it's impossible in Powershell using the libraries.

The libraries were a hard lock to not rely on other libraries as I wanted as clean of a port from Managed-Doom for a functional version.
This serves as a comparison between C# and Powershell, one can reference the C# project and find almost always the same structure, methods and calls in powershell and if you don't - It's cause of Powershell.

I have tested some runspace things that has worked flawlessly to being a minefield of dependencies to improve things.
Fetching input async in a runspace is one that works and is easily done and a huge uplift to experience for menu navigation..

Screenshot is done with

Windows performance 9800x3d with 5070 TI:
Doom running in powershell

Edit:

Video updated to linux version playable github release.

https://www.youtube.com/watch?v=yJiiTx4C87o

Github - Runnable version published.
https://github.com/oleyska/ManagedDoomPowershell


r/PowerShell • • Jun 09 '23

Misc Should r/PowerShell go dark June 12-14 in protest of the API changes?

384 Upvotes

If you’ve been around Reddit the past few days, you might have seen posts in some subreddits about planning to go Private on June 12th through the 14th.

This is to protest the changes Reddit is planning to API access, primarily of which is planning to charge for it.

Reddit has depended on third party tools and developers for a long time. Back before there were 1st party mobile apps, others came in to fill the gap. There’s developers filling needs that Reddit has not communicated plans to, like accessibility features for the visually impaired. Most bots, RES and mod tools also use the API.

But as this is a community, we don’t feel it is our place to make the decision for you. Vote in the poll below, we will take your wishes into account.

1515 votes, Jun 11 '23
1291 Set-Response -Response $true
224 Set-Response -Response $false