Skip to content

Latest commit

Β 

History

History
98 lines (69 loc) Β· 3.2 KB

File metadata and controls

98 lines (69 loc) Β· 3.2 KB

PowerShell Scripts Collection

PowerShell Script Validation

A collection of PowerShell scripts for Windows system administration, Active Directory management, and IT automation tasks.

πŸ“ Repository Structure

Scripts/
β”œβ”€β”€ ActiveDirectory/    # Active Directory user and object management
β”œβ”€β”€ FileSystem/         # File system permissions and auditing
β”œβ”€β”€ NetworkShares/      # SMB shares and DFS namespace management
β”œβ”€β”€ Registry/           # Windows Registry configuration and optimization
β”œβ”€β”€ System/             # System-level configuration and debugging
β”œβ”€β”€ TaskScheduler/      # Scheduled task deployment and management
└── UserProfiles/       # Windows user profile cleanup and maintenance

πŸš€ Scripts Overview

Active Directory

  • Get-DeletedUsers.ps1 - Exports deleted AD users within a specified date range
  • Get-UserLastLogon.ps1 - Reports user last logon times and group memberships
  • Send-PasswordExpiryNotification.ps1 - Password expiration notification for AD users

File System

  • Get-FolderPermissions.ps1 - Audits folder permissions across multiple servers

Network Shares

  • New-ShareAndDFS.ps1 - Creates SMB shares and corresponding DFS namespaces

Registry

  • Disable-LanmanCache.ps1 - Disables LanmanWorkstation cache for network performance

System

  • Enable-FullDump.ps1 - Configures Windows Error Reporting for full memory dumps
  • Invoke-WindowsUpdateMaintenance.ps1 - Manages Windows Updates across servers during maintenance windows

Task Scheduler

  • Deploy-ScheduledTasks.ps1 - Deploys scheduled tasks to multiple servers

User Profiles

  • Remove-OrphanedProfiles.ps1 - Removes Windows user profiles without folders

πŸ”§ Prerequisites

  • PowerShell 5.1 or later
  • Windows Server environment
  • Active Directory PowerShell module (for AD scripts)
  • DFS Management module (for DFS scripts)
  • Appropriate administrative permissions

πŸ“‹ Usage

Each script includes:

  • Parameter definitions with validation
  • Help documentation
  • Error handling
  • Logging capabilities
  • Progress indicators

To get help for any script:

Get-Help .\ScriptName.ps1 -Full

⚠️ Important Notes

  • Always test scripts in a non-production environment first
  • Review and modify variables/parameters before execution
  • Ensure you have appropriate permissions for the target operations
  • Some scripts require domain administrator privileges

πŸ“ Configuration

Most scripts include a configuration section at the top with customizable variables:

  • Server lists
  • Domain settings
  • Output paths
  • Debug options

🀝 Contributing

Feel free to submit issues and enhancement requests!

πŸ“„ License

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

πŸ‘¨β€πŸ’» Author

Leonardo Klein Rezende
IT Professional specializing in Windows Server and Active Directory administration


These scripts are provided as-is and should be thoroughly tested before use in production environments.