Skip to content

A comprehensive collection of PowerShell functions designed for Windows system administration, monitoring, and management tasks. This documentation covers 9 essential functions that provide IT professionals with powerful tools for managing Windows systems, network operations, security monitoring, and system maintenance.

License

Notifications You must be signed in to change notification settings

404RX/PowerShell-System-Administration-Functions

Repository files navigation

PowerShell System Administration Functions

PowerShell Windows License

A comprehensive collection of PowerShell modules designed for Windows system administration, monitoring, and management tasks. This collection provides IT professionals with powerful tools for managing Windows systems, network operations, security monitoring, and system maintenance.

Table of Contents

Module Overview

Module Description Functions Links
ActiveDirectoryManagement Active Directory user and group management operations 8+ .psm1
Common Shared utility functions and common operations used across modules 12+ .psm1
EventLogging Windows event log export, analysis, and monitoring capabilities 6+ .psm1
NetworkDiagnostics Network traffic analysis, connectivity testing, and diagnostics 8+ .psm1
NetworkManagement Network configuration and Wake-on-LAN functionality 5+ .psm1
ServiceManagement Windows service monitoring, control, and status reporting 7+ .psm1
SoftwareManagement Software update detection and management operations 6+ .psm1
SystemInformation System status, hardware details, and Windows Defender monitoring 10+ .psm1
SystemMaintenance System optimization, cleanup, and maintenance operations 9+ .psm1
SystemMonitoring Performance monitoring and system health tracking 8+ .psm1
UserSessionManagement User session monitoring and failed logon detection 6+ .psm1
WindowsUpdateManagement Windows Update history and status monitoring 4+ .psm1

Function Quick Reference

Function Purpose Module Syntax
Get-WindowsUpdateHistory Retrieve Windows update installation history WindowsUpdateManagement Get-WindowsUpdateHistory [-MaxResults <Int32>]
Get-FailedLogons Monitor failed logon attempts for security analysis UserSessionManagement Get-FailedLogons [-ComputerName <String>] [-Username <String>] [-Hours <Int32>]
Start-SystemOptimization Perform comprehensive system cleanup and optimization SystemMaintenance Start-SystemOptimization [-Categories <String[]>] [-Force] [-Detailed]
Get-SoftwareUpdates Check for available software updates SoftwareManagement Get-SoftwareUpdates [-Installable] [-Installed]
Get-DefenderStatus Check Windows Defender protection status SystemInformation Get-DefenderStatus
Get-ServiceList List Windows services with status and configuration ServiceManagement Get-ServiceList [-Filter <String>]
Export-EventLogs Export Windows event logs to various formats EventLogging Export-EventLogs -LogName <String> -OutputPath <String> [options]
Start-NetworkTrafficAnalysis Analyze network traffic patterns and bandwidth usage NetworkDiagnostics Start-NetworkTrafficAnalysis [-ComputerName <String>] [-Interface <String>] [-Duration <Int32>] [-Detailed]
Send-WakeOnLAN Send Wake-on-LAN packets to remote computers NetworkManagement Send-WakeOnLAN -MACAddress <String> [-Port <Int32>]

System Requirements

Component Requirement
PowerShell Version 5.1 or later
Operating System Windows 10 (1809+) / Windows Server 2016+
Execution Policy RemoteSigned or Unrestricted
Administrator Rights Required for most operations
Network Access Required for network-related functions

Installation

Prerequisites

  1. PowerShell 5.1 or later
  2. Administrator privileges (for most functions)
  3. Appropriate Windows version (Windows 10/Server 2016+)

Module Import

# Import individual modules as needed
Import-Module .\WindowsUpdateManagement\WindowsUpdateManagement.psm1
Import-Module .\SystemInformation\SystemInformation.psm1
Import-Module .\NetworkDiagnostics\NetworkDiagnostics.psm1

# Or import all modules
Get-ChildItem -Path . -Filter "*.psm1" -Recurse | ForEach-Object { Import-Module $_.FullName }

Execution Policy

# Set execution policy to allow module imports
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Quick Start

Basic System Health Check

# Import required modules
Import-Module .\SystemInformation\SystemInformation.psm1
Import-Module .\WindowsUpdateManagement\WindowsUpdateManagement.psm1

# Check Windows Defender status
$DefenderStatus = Get-DefenderStatus
Write-Host "Defender Protection: $($DefenderStatus.RealTimeProtectionEnabled)"

# Check recent Windows updates
$RecentUpdates = Get-WindowsUpdateHistory -MaxResults 10
Write-Host "Recent Updates: $($RecentUpdates.Count)"

# Check for available software updates
$AvailableUpdates = Get-SoftwareUpdates -Installable
Write-Host "Available Updates: $($AvailableUpdates.Count)"

For comprehensive examples and detailed usage instructions, see the individual module READMEs linked in the Module Overview section.

Error Handling

All functions implement comprehensive error handling including:

  • Parameter Validation: Input parameters are validated for type, range, and format
  • Permission Checks: Functions verify required permissions before execution
  • Service Availability: Checks for required Windows services and features
  • Network Connectivity: Validates network access for remote operations
  • Graceful Degradation: Provides fallback options when possible
  • Detailed Error Messages: Clear, actionable error information

Common Error Scenarios

  1. Access Denied: Run PowerShell as Administrator
  2. Service Unavailable: Ensure required Windows services are running
  3. Network Timeout: Check firewall settings and network connectivity
  4. Invalid Parameters: Verify parameter format and valid ranges
  5. Insufficient Disk Space: Ensure adequate space for operations

Contributing

Contributions are welcome! Please follow these guidelines:

  1. Code Standards: Follow PowerShell best practices and approved verbs
  2. Documentation: Include comprehensive help documentation
  3. Error Handling: Implement robust error handling and validation
  4. Testing: Test thoroughly on supported Windows versions
  5. Examples: Provide clear usage examples

License

This project is licensed under the MIT License. See the LICENSE file for details.


Note: These functions require appropriate permissions and are designed for Windows environments. Always test in a non-production environment before deploying to production systems.

For detailed documentation, comprehensive examples, and advanced usage scenarios, please refer to the individual module README files linked in the Module Overview section above.

About

A comprehensive collection of PowerShell functions designed for Windows system administration, monitoring, and management tasks. This documentation covers 9 essential functions that provide IT professionals with powerful tools for managing Windows systems, network operations, security monitoring, and system maintenance.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •