A comprehensive collection of automation scripts for IT administration, desktop support, and system management tasks. This repository includes both Bash and PowerShell scripts designed to streamline common administrative workflows.
Project Board: https://github.com/users/E7H31234L/projects/4
IT-Admin-Tools/
βββ BASH - Shell Script/
β βββ Macintosh Docking Stations/
β β βββ multi-docking.sh # macOS network configuration based on docking
β βββ WIFI /
β βββ connect-wifi.sh # Interactive Wi-Fi connection manager
βββ Powershell/
β βββ Active Directory /
β β βββ create-ad-fileshare.ps1 # AD group and file share creation
β βββ Network Printers/
β β βββ Install-Printers.ps1 # Automated printer installation
β βββ config.ps1 # Configuration for AD scripts
β βββ printer-config.ps1 # Configuration for printer scripts
βββ .github/workflows/
β βββ quality-check.yml # CI/CD pipeline
βββ .pre-commit-config.yaml # Pre-commit hooks
- Bash 4.0+
- networksetup (macOS) or nmcli (Linux)
- sudo access for system configuration
- PowerShell 5.1+ or PowerShell Core 7+
- Active Directory module (for AD scripts)
- ImportExcel module (for printer scripts)
- Administrator privileges
-
Clone the repository:
git clone https://github.com/E7H31234L/IT-Admin-Tools.git cd IT-Admin-Tools -
Set up pre-commit hooks (optional but recommended):
pip install pre-commit pre-commit install
-
Configure PowerShell modules (Windows only):
Install-Module -Name ImportExcel -Force Install-Module -Name PSScriptAnalyzer -Force
Purpose: Automatically configures network settings based on connected docking station MAC address.
Features:
- Detects docking station by MAC address
- Switches to predefined network locations
- Configures IP, subnet, gateway, and DNS
- Falls back to Automatic location when no dock detected
Usage:
./"BASH - Shell Script/Macintosh Docking Stations/multi-docking.sh"Configuration: Edit the MAC addresses and network settings in the script header:
# Update these values for your environment
mac_address=("8c:ec:4b:12:91:41" "64:4b:f0:33:14:e0") # Add your MAC addresses
city1_ip="192.168.1.10" # Configure IP settingsPurpose: Interactive Wi-Fi network connection manager with validation.
Features:
- Lists available Wi-Fi networks
- Input validation for network selection
- Error handling and status feedback
- NetworkManager integration
Usage:
./"BASH - Shell Script/WIFI /connect-wifi.sh"Purpose: Creates Active Directory security groups and configures file share permissions.
Features:
- Creates read-only (-ro) and read-write (-rw) security groups
- Sets group ownership and descriptions
- Configures file system permissions
- Comprehensive error handling and logging
- Configuration file support
Usage:
.\Powershell\ "Active Directory /create-ad-fileshare.ps1"Configuration:
Edit Powershell/config.ps1 for your environment:
$ADDomain = "auth.your_domain.local"
$ADGroupsOU = "OU=Groups,OU=YOUR_DOMAIN,DC=auth,DC=your_domain,DC=local"
$DefaultFileServer = "fileserver.yourdomain.local"Purpose: Automated printer installation using Excel inventory and web scraping.
Features:
- Reads printer inventory from Excel workbook
- Discovers printer models via web scraping
- Installs appropriate drivers and creates printer objects
- SSL certificate handling for HTTPS printer admin pages
- Batch installation and uninstallation
Usage:
.\Powershell\ "Network Printers/Install-Printers.ps1"Requirements:
- Excel workbook with
RefPoolandPrintDriverMapworksheets - Network connectivity to printer admin interfaces
- Administrator privileges
All scripts support configuration through external files:
- Bash Scripts: Edit variables directly in script headers
- PowerShell Scripts: Use
.ps1configuration files - Security: Update hardcoded paths and credentials for your environment
- All scripts require appropriate privileges (sudo/administrator)
- Review and test in non-production environments first
- Store sensitive configuration securely
- Enable audit logging for production use
- Input validation and sanitization
- Error handling without information disclosure
- Secure temporary file handling
- Comprehensive logging and audit trails
- SSL/TLS certificate handling options
- Use principle of least privilege
- Implement multi-factor authentication for admin accounts
- Regularly review and rotate credentials
- Enable script execution policies appropriately
- Monitor script execution logs
# Bash script syntax check
bash -n "script name.sh"
# PowerShell script analysis
Invoke-ScriptAnalyzer -Path "script.ps1"The repository includes automated quality checks:
- ShellCheck analysis for Bash scripts
- PSScriptAnalyzer for PowerShell scripts
- Security vulnerability scanning
- Pre-commit hook validation
- Bash Scripts: Standard output and error streams
- PowerShell Scripts:
C:\Logs\IT-Admin-Tools\(configurable) - CI/CD: GitHub Actions logs
All logs include:
- Timestamp
- Script name and version
- User context
- Action performed
- Success/failure status
- Error details (if applicable)
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and quality checks
- Submit a pull request
- Follow existing script patterns
- Include comprehensive headers and documentation
- Add input validation and error handling
- Update configuration files as needed
- Test across target platforms
This project is licensed under the MIT License - see the LICENSE file for details.
- Check script execution logs
- Verify prerequisites are met
- Test with reduced privileges first
- Review configuration settings
- Check system permissions
- Permission Denied: Ensure script has execute permissions and user has necessary privileges
- Module Not Found: Install required PowerShell modules
- Network Timeout: Verify connectivity and firewall settings
- Invalid Configuration: Check environment-specific settings
- Major security improvements and input validation
- Configuration file support
- Enhanced error handling and logging
- CI/CD pipeline integration
- Comprehensive documentation
- Basic script functionality
- Manual configuration only
- Limited error handling
Note: Always test scripts in a non-production environment before deployment to production systems.