80 likes | 195 Vues
This presentation addresses the prevalent issue of bloated Active Directory (AD) environments in corporate IT settings, where numerous unorganized or expired accounts accumulate over time. We propose a PowerShell script that effectively manages AD by organizing or removing computers based on corporate policies. The script uses commandlets to search through AD, moving computers to appropriate Organizational Units (OUs) based on parameters like last logon time. Customization options make it adaptable for varied corporate needs. Safety disclaimers emphasize the importance of rigorous testing on non-production systems.
E N D
AD Maintenance via PowerShell Developed By: Mario Eirea Advisor : Dr. S. Masoud SadjadiSchool of Computing and Information SciencesFlorida International University meire001@fiu.edu http://www.cs.fiu.edu/~sadjadi/
Agenda • Problem and Motivation • Solution • Behind the Scene • Customizing the Solution • Disclaimer • Progress Report
Problem and Motivation: • A common problem faced in corporate IT environments that house Active Directory (AD) domains is that many computers are added and removed to the domain. Over time, this can lead to a bloated AD that contains hundreds or thousands of unorganized/expired accounts.
Solution • Using a PowerShell script, one can crawl through the AD and check parameters such as last logon time and computer name to sort and move computers. The computers can be organized or removed according to corporate policies.
Behind the Scene • The PowerShell script will search though the AD using commandlets: • Get-ADOrganizationalUnit • Get-AdComputer • Then move computers into the appropriate OUs with Move-ADObject. • Primary logic will revolve around the properties “Name” and “lastLogonTimestamp”. • The first 4 characters of the computers name will match to an OU code. When the match is detected it will move the computer to the “Computers” OU inside the matching parent OU. • “lastLogonTimestamp” will be used as a basis for computer activity. When this value exceedes 246 days, it will be moved to an OU named “Offline” and the account deactivated. Once the computer is offline for more than 365 it will be removed from the domain.
Customizing the Solution • The source for this script will be freely available, this allows customization over all aspects of operation. Changing the variables that control computer name matching or logon time, the script can be changed for varying corporate requirements.
Disclaimer • This PS script is very dependent on ridged AD design specifications. • Using any script the manipulates mass quantities of data can be dangerous and destructive, please make sure the script is tested thoroughly on non production environments before deploying into production.
Progress Report • Initial script is completed. Testing functionality. • Need to complete training video and documentation