I was trying a PowerShell cmdlet the other day hoping to get a list of user info off Active Directory but only got “The term is not recognized as the name of a cmdlet” error message in return. And realized that I don’t have the Active Directory Module installed on my Windows 10 computer.
If you are in the same situation like mine, here is how you can get it installed.
The easiest way is to install Windows 10 RSAT (Remote Server Administration Tools) package since it comes with the Active Directory Module with plenty cmdlets for you to manage AD users and computers.
Head over to the Remote Server Administration Tools for Windows 10 page, download the RSAT package and get it installed on your Windows 10 computer. All tools are enabled by default so you don’t have to import or enable the module after the installation. Once you reboot your computer, you are ready to rock with all the cmdlets available in your hand.
For example, you can search and find all user accounts that have been inactive for past 120 days by simply running the following cmdlet Search-ADAccount.
Search-ADAccount -AccountInactive -TimeSpan 120 -UsersOnly
Or find the list of deactivated user with their name, email address, and last login date.
Search-ADAccount -AccountDisabled | Format-List -Property Name, LastLogonDate, UserPrinciplalName
The same trick applies to Windows 8 and Windows 8.1 computers as well. But the stories are much different for Windows 7, or Server platforms such as Windows Server 2008 R2, 2012, and 2012 R2. Follow this instruction by 4Sysops if you need to install and enable Active Directory Modules on these versions of Windows.