Table of Contents
SysAd.ps1 is a collection of PowerShell functions served under a terminal interface aimed at System Administrators or Support Engineers to quickly connect via terminal, either Pa/Psexec.exe (CMD) or Powershell, to assist in remote fixes or automating common tasks.
The script is built around the task of quickly getting onto machines via. the command line which is done here using PaExec.exe and PSRemoting. As these sessions are silent, they're especially useful for non-intrusive work on user's machines as well as common server tasks.
Out of the box features:
- Create a silent terminal session with target (CMD) for interactive work
- Create an interactive Powershell session
- Shutdown logs for target - when, by who, from where and using what (handy for servers)
- List all installed programs on target
- Find the largest files on the machine and report back
- DHCP search of all scopes by hostname or IP
- Temporarily remove SCCM/MECM Remote Control user permission and revert
- Temporarily remove printer driver UAC associated with PrintNightmare and revert.
- Run a McAffee EPO scan, update and start a SNOW inventory.
As well as some Active Directory tools (still adding)
- Search AD users, select and display key information with option to reset password and unlock user.
- Find all locked users in AD in particular OU
- Change employee AD (hidden attribute)
- Copy all members of a group to another
- Add all members to an AD group from .txt file
- Export group membership to CSV
- Find machines and enable/disable
The terminal interface's simplicity means adapting the script for your own bespoke functions is as simple as defining the function, adding its name to function Show-Home and then corresponding the corresponding keypress under Show-Home.
./SysAd.ps1
Script landing page to enter your target's hostname or IP address:
Although Windows Terminal is not a prerequiste, I highly recommend it for frequent terminal use (like this repo is targeted at), to install open Powershell and run:
Add-AppxPackage Microsoft.WindowsTerminal_<versionNumber>.msixbundle
For alternative installation methods, see the link above to the Windows Terminal repo.
If you have GIT installed on your Windows machine, simply open Powershell at your target location:
git clone https://github.com/jameswylde/SysAd.git
If you do not have GIT, open 'Code' at the top of this repo, 'Download ZIP', download and extract at your target location.
Simple open Powershell or Windows Terminal as admin, cd into the SysAd folder and run:
./SysAd.ps1
Distributed under the MIT License. See LICENSE.txt
for more information.
James W - @jamescw44