r/usefulscripts • u/logicalmike • Jan 17 '19
r/usefulscripts • u/jayrizz • Dec 10 '18
[Request] Script to display who and when permissions were edited on a folder.
Somebody removed 4 users with full control permissions on a folder and I need to know who made the changes to prevent this in the future.
r/usefulscripts • u/signalwarrant • Aug 30 '18
[PowerShell] Quickly deploy LAB Virtual Machines with the AutomatedLab PowerShell Framework
A quick video walk-through of the AutomatedLab PowerShell Framework (I'm not affiliated to the AutomatedLab team, I just use it often).
r/usefulscripts • u/Harshmage • Dec 11 '15
[CSV File] FCC Telemarketer and RoboCall Blacklist for Google Contacts (12/07/2015) - Yes, I'm late
r/usefulscripts • u/Harshmage • Nov 09 '15
[CSV File] FCC Telemarketer and RoboCall Blacklist for Google Contacts (11/9/2015)
r/usefulscripts • u/MrMeme42 • Sep 17 '15
[Batch] Extract MSI from exe installer
r/usefulscripts • u/circa10a • Apr 19 '15
[PowerShell] Find what computer a user is logged into
Add-PSSnapin Quest.ActiveRoles.ADManagement -ErrorAction SilentlyContinue
$ErrorActionPreference = "SilentlyContinue"
Function Get-Username {
$Global:Username = Read-Host "Enter username you want to search for"
if ($Username -eq $null){
Write-Host "Username cannot be blank, please re-enter username!"
Get-Username}
$UserCheck = Get-QADUser -SamAccountName $Username
if ($UserCheck -eq $null){
Write-Host "Invalid username, please verify this is the logon id for the account"
Get-Username} }
get-username
$computers = Get-QADComputer | where {$_.accountisdisabled -eq $false}
foreach ($comp in $computers)
{$Computer = $comp.Name
$ping = new-object System.Net.NetworkInformation.Ping
$Reply = $null
$Reply = $ping.send($Computer)
if($Reply.status -like 'Success'){
$proc = gwmi win32_process -computer $Computer -Filter "Name = 'explorer.exe'"
ForEach ($p in $proc) {
$temp = ($p.GetOwner()).User
if ($temp -eq $Username){
write-host "$Username is logged onto $Computer"
}}}}
Edit: forgot to mention quest active roles will be needed for this. You can download here: http://tinyurl.com/oukq26q
r/usefulscripts • u/[deleted] • Feb 17 '23
GitHub - tg12/script-toolbox: This repository contains a collection of scripts and tools that I have written to solve various problems that I have come across.
r/usefulscripts • u/MadBoyEvo • Feb 14 '22
[PowerShell] Office 365 Health Service using PowerShell
Just wrote a short blog post on the updated PowerShell module called PSWinDocumentation.O365HealthService. It allows gathering Health data from Office 365 with Graph API.
Import-Module PSWinDocumentation.O365HealthService -Force
$ApplicationID = ''
$ApplicationKey = ''
$TenantDomain = 'evotec.pl' # CustomDomain (onmicrosoft.com won't work), alternatively you can use DirectoryID
$O365 = Get-Office365Health -ApplicationID $ApplicationID -ApplicationKey $ApplicationKey -TenantDomain $TenantDomain
$O365Blog post: https://evotec.xyz/office-365-health-service-using-powershell/
Sources: https://github.com/EvotecIT/PSWinDocumentation.O365HealthService
r/usefulscripts • u/Elorakrizel • Apr 16 '21
Script sharing: Export Office 365 groups a user is member of
The administrators require the Office 365 user membership report to manage and maintain the organization and business. So, I have created a PowerShell script to address various business situations. With this script, you can generate 10 different user membership reports based on your requirement.
Few of the use cases :
Lists all users with their groups
Gets group membership details for list of users (input through CSV)
Shows guest users and their membership
Shows disabled users with their group membership
Identify users who are not member of any groups
You can download the script from the github
r/usefulscripts • u/mindlessgrenade • Feb 25 '20
[TERRAFORM] Backup tagged EC2 instances as AMIs
r/usefulscripts • u/MadBoyEvo • Aug 11 '19
[PowerShell] Formatting and minifying resources (HTML, CSS, JavaScript)
So I was wondering on Friday if I can format my HTML produced by PSWriteHTML module. Turns out it's quite possible. After some busy Saturday/Sunday please welcome PSParseHTML module.
How to https://evotec.xyz/formatting-and-minifying-resources-html-css-javascript-with-powershell/
Github Sources: https://github.com/EvotecIT/PSParseHTML
I am not sure how useful it will be outside of a few specific cases but I needed it for my own curiosity, I may as well share this.
It has 7 functions:
Optimize-CSS
Optimize-HTML
Optimize-JavaScript
Format-CSS
Format-HTML
Format-JavaScript
Convert-HTMLToText
Generally speaking it can format CSS/HTML/JS or minify those. Also it can extract text from HTML code.
Enjoy ;-)
r/usefulscripts • u/MadBoyEvo • Jul 14 '19
[PowerShell] Using Lansweeper with PowerShell to your advantage
For those that have Lansweeper at work, I wrote this little PowerShell module that can get any Lansweeper report into PowerShell object so you can interact with Lansweeper data in PowerShell. It's a really small project (about 80 lines of code) but you can get lots of ready to go reports.
Here's how to: https://evotec.xyz/using-lansweeper-with-powershell-to-your-advantage/
Sources: https://github.com/EvotecIT/PSLansweeper (merely 80 lines or so)
Usage
Get-LansweeperReport -SqlInstance "LANSWEEPER.AD.EVOTEC.XYZ" -Report SoftwareLicenseKeyOverview | Format-Table -Autosize
Get-LansweeperReport -SqlInstance "LANSWEEPER.AD.EVOTEC.XYZ" -Report InstalledWindowsUpdates | Format-Table -AutosizeOr
$Test = Get-LansweeperReport -SqlInstance "LANSWEEPER.AD.EVOTEC.XYZ" -Report WindowsAutomaticUpdateSettingsAudit
$Test | Format-Table *
$Test = Get-LansweeperReport -SqlInstance "LANSWEEPER.AD.EVOTEC.XYZ" -Report WindowsAutomaticUpdateSettingsAudit,MicrosoftPatchTuesdayAuditJuly2019
$Test.WindowsAutomaticUpdateSettingsAudit | Format-Table -AutoSize
$Test.MicrosoftPatchTuesdayAuditJuly2019 | Format-Table -AutoSizeHere's couple of screenshots.


r/usefulscripts • u/MadBoyEvo • Mar 10 '19
[PowerShell] PSWinReporting 1.8 - Split of branches (Legacy vs. New Hope)
r/usefulscripts • u/MadBoyEvo • Oct 25 '18
[PowerShell] PSAutomator - Offboarding / Onboarding / BAU module in form of IFTTT / Microsoft Flow
This PowerShell Module is new approach to onboarding, offboarding and business as usual processes running in companies infrastructure. Usually each company has different rules, different approaches on how processes should look like. This module at this moment can do following things:
Add/Remove account to/from a specific group
Disable/Enable Account
Hide/Show account in GAL
Remove All Groups
Remove All Distribution or Security Groups
Remove All Local, Global or Universal Groups
Make snapshot/backup of account configuration
Add/Remove Text from Account Fields
Rename Account
Current version 0.0.3 and as such is very alpha. Comments are welcome.
Overview: https://evotec.xyz/hub/scripts/psautomator-powershell-module/
It's work in progress. New actions/ignores/conditions and services will be added. Currently only has AD but will support Exchange/O365 and if there will be need other things as well.



Sample looks like this:
Clear-Host
Import-Module PSAutomator -Force #-Verbose
Import-Module PSSharedGoods -Force
Service -Name 'Active Directory Offboarding' {
Trigger -Name 'OU Offboarded Users' -User OrganizationalUnit -Value 'OU=Users-Offboarded,OU=Production,DC=ad,DC=evotec,DC=xyz' |
Condition -Name 'No conditions' |
Ignore -Name 'Ignore Windows Email Address if Empty or null' -Ignore MatchingEmptyOrNull -Value EmailAddress |
Action -Name 'Make User Snapshot' -ActiveDirectory AccountSnapshot -Value 'C:\Users\pklys\Desktop\MyExport' -Whatif |
Action -Name 'Disable AD Account' -ActiveDirectory AccountDisable -WhatIf |
Action -Name 'Hide account in GAL' -ActiveDirectory AccountHideInGAL -WhatIf |
Action -Name 'Remove all security groups' -ActiveDirectory AccountRemoveGroupsSecurity -WhatIf |
Action -Name 'Rename Account' -ActiveDirectory AccountRename -Value @{ Action = 'AddText'; Where = 'After'; Fields = 'DisplayName', 'Name'; Text = ' (offboarded)'; } -WhatIf
}r/usefulscripts • u/Samrenfou • Jun 02 '18
[BASH]Twitch Script
Hey folks,
Any Twitch viewer here? Personnaly I like watching streams but I hate to open the browser and click on things to go on a ugly and unoptimized website with ads just to check if my favorites streamers are offline or not.
So I made a script to do that for me
Thoses scripts aren't perfect. I'm relatively new in bash scripting and I'm sure it's possible to improve these. If you have any comment/advice.
r/usefulscripts • u/jajabro1 • Oct 31 '17
[Request] Some AD management. Disable account, update description and move OU.
Normally I figure this sort of thing out on my own but haven't been able to get anywhere.
At the company we work for we have a pretty crazy OU structure. Every week or so we get a spreadsheet of terminated users that comes from a different database, then we go through that excel sheet to disable the account, update their description, and move them to the disabled users OU for our Country.
So I'd like to semi automate this for myself, if going through a CSV or something or maybe Powershell would be better please by all means any help would be great.
So again, we: 1. Disable the User Account 2. Update the description usually something like "Termed on 10/31/2017 - JB" 3. Move the account to a specified OU.
Edit:I should also mention that we do get the employee ID numbers, which we use in AD under EmployeeNumber, SAM_Account_Name and email address in the generated spreadsheet.
r/usefulscripts • u/signalwarrant • Jun 27 '16
[PowerShell] New AD Users in Bulk from CSV with Password verification
I wrote this script a couple weeks ago. It will create users from a CSV file without having to store the password for each user in the CSV or the script.
You can download it here.
It will prompt you to enter and confirm a password. If the password is blank or they do not match the scripts dies.
The one to do is to check the entered password against the domain password complexity rules before it executes. I'm guessing I could use some sort of Regex pattern to check this, I just haven't gotten around to figuring it out. As it is now, if you enter a simple password it creates the users disabled.
r/usefulscripts • u/[deleted] • May 22 '15
[POWERSHELL] Collect-ServerInfo.ps1, a Windows Server inventory script
r/usefulscripts • u/jump_ace • Aug 30 '23
Automatically Convert HEIC To PNG Files
Maybe someone else is tired of the headache of copying, converting and resizing .HEIC files from their iPhone like I am.
With the help of ImageMagick and ChatGPT, I created a couple scripts that, when you drag and drop your .HEIC files to your local C:\Images folder, they will be converted to png and resized (and the original files get deleted from C:\Images). You can also make a Scheduled Task to run one of the scripts upon logon that will monitor the C:\Images folder and kick off the convert and resize automagically. I hope someone finds it helpful:
https://github.com/Jump-Ace/HEIC2PNG
Jerome
r/usefulscripts • u/signalwarrant • Mar 08 '21
Secure HTTPS DSC Pull Server w/ SQL Backend using a Group Manager Service Account (gMSA)
I couldn't find a tutorial that included the gMSA piece, so I made one. It's a bit -verbose so I put timestamps in the video description. I'm interested to hear if anyone knows of a less hacky way to set the gMSA on the app pool as part of the DSC config.
r/usefulscripts • u/MadBoyEvo • Jan 03 '21
[PowerShell] Creating Office 365 Migration Diagram with PowerShell
Here's a short story on how to create an Office 365 diagram using just PowerShell and nothing else.
The following diagram can be generated with just 20 lines of code as soon as you install the PowerShell module called PSWriteHTML.
Sources as always on GitHub: https://github.com/EvotecIT/PSWriteHTML

r/usefulscripts • u/[deleted] • Dec 19 '17
A few Python scripts that you might find userful
r/usefulscripts • u/I_script_stuff • Mar 13 '17
[POWERSHELL] Jenkins, Powershell, AWS and Cloudflare Automated Deployment. (Part3 Cloudflare)
More updates on the Github. That contains the Jenkins template (the zip file). as well as the code for both scripts.
The blog lays out what you need to do and the options. Found here
This is the final in this series so I figured I'd post it in case anyone is watching it. I updated the code some more so if your using the version from the last post I changed it so you have an option to not overwrite the IP in cloudflare just because a new instance was created with the same name as the last.
Thanks.