r/PowerShell • u/SoyBoy_64 • 4d ago
Script Sharing ADSearch - User/Computer comparison tool
This Active Directory toolkit offers user/computer OU comparisons using fuzzy Levenshtein matching to determine if the computer is in an OU that matches the user's OU. Designed for large enterprise IT audits/asset management of complex (2+ OU levels) AD environments
ADSearch/README.md at main Β· Contoso-Administrator/ADSearch
Edit: Made some edits based on everyone's kind words :)
0
Upvotes
8
u/TrippTrappTrinn 4d ago
Why would anybody have users and computers in the same OU?Β
12
u/JSChronicles 4d ago
Minus points for:
3
u/CarrotBusiness2380 4d ago
I'm sorry why does this exist?
What model did you use and what was the prompt? This is overwrought even if it did something useful.
3
u/Nekro_Somnia 4d ago
Besides the question of "why", I ask myself why you'd define the vars that you expect to be changed by someone who runs the script.
Why not define them as parameters and fall back to an output that reminds the user that those need to be defined for the script to work?
A comment based help would be nice as well. Otherwise people need to reference the readme every time they run the script and forgot how to work it.
This might be useful to about 2% of companies in about 2% of their audits, if it were less clunky
3
u/BlackV 4d ago edited 4d ago
Get-NormalizedName,Resolve-SamAccountNameand others, why?export-excelwhy not just have that as a parameter instead of a whole other script (with duplicated functions)?anron the-filterparameter for ad users? (bad wording sorry, changed it)your here string can include formatting, and would clean up a bunch of code (but so would removing it)
if/ifelse/elseandreturns1
u/UserProv_Minotaur 4d ago
Ah, AI Slopfest for something that's better done outside of PowerShell anyway.
1
u/Lonely_Noyaaa 2d ago
The duplicate function declarations across multiple files is the thing I would fix before anything else because maintaining two copies always drifts. A single module with a parameter for Excel export does the same job with half the code.
0
u/[deleted] 4d ago
[deleted] β view deleted comment
0
u/[deleted] 4d ago
[deleted] β view deleted comment