We are here to help!

Find new ways to use Atera, Ask us anything.


PowerShell Scripts Repository for Active Directory

This article gathers together some useful active directory PowerShell scripts for you to use in your daily work.

To make it easy to find the script you need the list is divided into categories.

Note: This script list was compiled based on the scripts recommended by most MSP users and the kind help of Dor Amit (MCT, MCSE SECURITY,CITP BI,Comptia Security+,MCITP SHAREPOINT).

This list is for information purposes only. Atera does not endorse, guarantee or make any warranty regarding the scripts listed below or provide any support for them. You are responsible for deciding which scripts to use, whether a script is appropriate to achieve your intended results, and for using scripts correctly. We recommend testing all scripts and configurations on a test lab system before trying it in production.

In order to seamlessly run these scripts whenever you need them you should brush up on your PowerShell skills.

PowerShell is also very useful for troubleshooting so it is worth investing the time needed to learn this powerful scripting tool.

Click here to learn how to run PowerShell scripts using the Atera agent.

Active Directory Powershell Scripts

  1. Get Inactive Computer in Domain based on Last Logon Time Stamp
  2. How to send account lockout email notification
  3. Create Active Directory Reports in Excel using PowerShell
  4. Powershell Script to export Active Directory users to CSV
  5. Password Expiry Email Notification
  6. Reset password for all specified users
  7. Get Inactive User in Domain based on Last Logon Time Stamp
  8. List Membership In Privileged Groups
  9. Active Directory Installation on Windows Server 2012
  10. Active Directory OU Permissions Report
  11. Get nested group membership - function
  12. Active Directory Audit Report
  13. Active Directory Users attribute Administration
  14. List Group Members in Active Directory
  15. Test-Credential
  16. Merge User and Contact Object
  17. Dump AD OU Structure Script
  18. Clean Startup Folder
  19. Sync-OUsAndGroups
  20. Disable or Enable Global Catalog on DC based on entered name


  1. Retrieve SQL Server Information (HTML Report)
  2. Export of all SSRS reports data sources and resources
  3. Get-SQLInstance
  4. Create Inventory of SQL Server in Network as Html


  1. Get Exchange 2010 Mailbox size for all Mailboxes, output to CSV
  2. Office 365 Licensing Report
  3. Removing Duplicate Items from a Mailbox
  4. Generate Reports for Exchange ActiveSync Device Statistics
  5. Generate Mailbox Size and Information Reports
  6. Generate Health Report for an Exchange Server 2016/2013/2010 Environment
  7. ActiveSyncReport script
  8. Export all distribution Group and All members using PS Script-Exchange 2007&2010
  9. ConvertFrom-LdapFilter
  10. Troubleshoot Exchange 2010 Mailbox Servers
  11. Generate Antivirus Exclusions for Exchange 2013 and 2016 Servers
  12. Export Exchange Message Tracking Logs to Excel


  1. Get Server Inventory: CPU, Memory, and OS information. Export to CSV
  2. Get Dell Server Hardware Health with Powershell
  3. Capture HP ILO information
  4. View BIOS Settings on Lenovo devices
  5. Determine UEFI or Legacy BIOS
  6. Get-FailingDrive
  7. Out-of-Band Hardware Management Module
  8. Get-HardwareProfile
  9. Dell Service Tag
  10. List Memory Slot Information for a remote computer

 Local Account Management

  1. Remove-LocalProfile
  2. Get-LocalGroupMembership
  3. Set user password on remote or local machines
  4. Reset Local Administrator password
  5. Retrieve all local user accounts information on remote computers
  6. Add AD User/Group to Local Administrator Group
  7. Local Account Management Module 2.1

 Log and Monitoring

  1. Website Availability Monitoring / URL Monitoring


  1. Get Network Information of Local and Remote Computer

 Office 365

  1. List all Distribution Groups and their Membership in Office 365
  2. OneDriveMapper automatically maps your OneDrive for Business upon login
  3. Export Office 365 User Last Logon Date to CSV File

 Operating System

  1. Get-RemoteProgram Get list of installed programs on remote or local computer
  2. Determine if a computer is virtual
  3. Script to migrate scheduled tasks from Windows XP/Server 2003 to 7/Server 2008
  4. Excel and HTML Asset Reports With Powershell
  5. Cryptowall active alerter / scanner
  6. Windows System Inventory Script with PowerShell
  7. Get scheduled tasks from remote computer
  8. How to create home folder and grant the appropriate permission to users
  9. Get product keys of local and remote systems
  10. Check for hung or stopped services


  1. Printers Inventory
  2. Print Server Management
  3. PowerShell Print Logger
  4. Check if the network printer is connected
  5. Migration of Printers From Old Print Server to New Print Server
  6. Add Printer Permission
  7. Add printers to a PC/computer based on computer group membership in AD
  8. Remove All Network Printers

 Remote Desktop Services

  1. Connect-MSTSC- Open RDP Session with credentials


  1. Just Enough Administration (JEA) Infrastructure: An Introduction


  1. Download and Install SharePoint 2013 Prerequisites on Windows Server 2012
  2. Copy all SharePoint Files and Folders Using PowerShell

 Using the internet

  1. Switch IE Proxy
  2. Get Network NTP Time
  3. Open Internet Explorer, Login to a Website, and then Launch an executable

 Windows Azure

  1. Scheduled Virtual Machine Shutdown/Startup
  2. Connect to an Azure Virtual Machine






Was this article helpful?
13 out of 13 found this helpful
Have more questions? Submit a request