A set of scripts to make life easier for SysAdmins in large environments.
- On Windows, some scripts require Active Directory Domain Services, Remote Server Administration Tools (RSAT) and/or at least PowerShell 5.1.
Just choose a script and run it! Some may work locally, others remotely if there is an Active Directory domain.
-
Close-UserSession.bat: Logs off an user locally or remotely
Close-UserSession username [computer]
-
Set-InitialKeyboardIndicators.bat: Sets the initial keyboard indicators for the current user or all users
Set-InitialKeyboardIndicators value [all] # value: some integer (0 to disable Numlock, 2 to enable it; supports any other integer value) # all: applies to all user profiles, including standard and system profiles; otherwise only the current user # Example to disable NumLock according to the computer model SYSTEMINFO | FIND /I "computer-model" && Set-InitialKeyboardIndicators 0 all
-
Uninstall-AnyDesk.bat: Detects and silently uninstalls AnyDesk
-
Uninstall-TeamViewer.bat: Detects and silently uninstalls TeamViewer
-
Convert-AdSidToHex.ps1: Converts an AD SID to hexadecimal format
.\Convert-AdSidToHex "S-1-5-21-3623811015-3361044348-30300820-1013"
-
Set-BgImages.ps1: Change the desktop and lock screen background image on any edition of Windows 10 and 11
.\Set-BgImages [-LockScreenImage <"network-path-to-the-image">] [-DesktopImage <"network-path-to-the-image">] [-LogPath "log-folder-network-path"] # Example .\Set-BgImages -LockScreenImage "\\srvfs01\folder\LockScreen.png" -DesktopImage "\\srvfs01\folder\Desktop.png" -LogPath "\\srvfs01\folder"
- If you notice changes or increments that could be beneficial for some use case, start a discussion or submit a pull request!
- For some scripts, you must first enable and configure PSRemoting, WinRM, Firewall, etc.
- Remember: unlike Batchfiles, PowerShell scripts require the ".\" prefix to run!
This repository is based on and inspired by - but not limited to - Keep a Changelog, Semantic Versioning and the ezGTR template. Therefore, any changes made, expected or intended will be documented in the Roadmap and Changelog file.
Developed by Ezequiel Lage, Sponsored by Lageteck and Published under the MIT License.
Credits to Raymond Chen for the explanation1 that made the Convert-AdSidToHex.ps1 script possible. Credits also to Juan Granados for the original version of Set-BgImages.ps1, formely Set-Screen.ps12 or Set-LockScreen.ps13.
All suggestions, criticisms and contributions are welcome!
BTC: 1Nw2fzDgtXM5X219Q9VtJ7WaSTDPua3oe8
ERC20*: 0x089499f57ee20fd2c19f57612d9af69d645dff0d
* Any ERC20 token supported by Binance (ETH, USDC, USDT, etc)