Personal collection of powershell scripts used at home and a few work scripts. These were designed to run on Powershell for Windows.
A Powershell script that will adjust the reboot task permissions in update orchestrator to prevent windows from automatically rebooting. The script will perminently disable auto reboot until the next feature update. This is due to how windows wipes the windows directory during updates.
Changes have been made for 1809.
These use a config hash that needs to be modified to match local enviroment. These were designed for my work center.
Used for account closure in a hyprid office 365 enviroment. No files, accounts, or mailboxes are deleted, instead they are moved to archive locations. Archive-UserFiles.ps1 and ShareOnlineEmailAccount.ps1 are included as part of the script
Searches multiple network locations for user files and then moves via robocopy.
Set a mailbox to be shared to another via office 365.
Sets default wallpaper for computer but allows users to change.
This is run during MDT image process. You will need the make the required resolutions and place in a 4k folder. See here for details on resolutions
Common Microsoft "bloat" is checked for and removed.
It is recommended to run this during the image process such as an MDT task sequence.
Script used to backup user folders to google drive.
Simple script that exports a copy of all VMs to a backup directory as well as compresses for archive with 7zip if installed.
Filehistory on windows 8-10 is known for randomly failing to run. I enjoy the feature of FileHistory tracking of files so I created a script that will email you if it has not ran in the specified time range.
Checks for stuck print jobs on print server. It will first attempt to remove the errored job gracefully. If that fails it will stop the print service and remove job from files.
Both scripts are needed if you want the process to be hidden from the user except for prompts.
If you want to launch silently with the vbs script, both scripts need to be placed in $env:APPDATA\AdminScripts\
.
Create a group policy to create a scheduled task to run Get-PendingRestartSilent.vbs
throughout the day. Run vbs script as user not system.
Compress specified folders using NTFS compression. Very useful for saving space in areas that don't have high IO. I was unable to find any negative performance impact.
Update plex if you are running it as a service.
Quickly create firewall rules on windows using text file of IP ranges. Useful for geo blocking.
This script takes a text file of IPs or IP subnets and converts it to be used with UFW config files. Useful for IP Geo firewall rules. You can copy paste output into config file to add rules.
This script is used to automatically compact all of your dynamic virtual disks on all of your VMs. It will shut down VM if running, compact, and then boot VM if it was running before.
Recusive NTFS uncompression for a directory or more.
Find console session and RDP shadow another user.
I use this script to get remote CPU load with top processes of remote machines. Can also be used local.
Audit RDP and SMB logins. Login auditing will need to be enabled in local policy.
Automate windows updates and restarts on remote hosts. Installs and uses PSWindowsUpdate module. Script uses Register-ScheduledTask instead of Invoke-WUInstall because of issues/bugs on non domain computers.
A simple script for toggleing a service (start/stop). Remote ComputerName supported.