Forum Discussion
keeganjjk
Oct 09, 2024Copper Contributor
Getting messageUnable to find type [Microsoft.ActiveDirectory.Management.ADUser].
I am running a script that was posted online at theposhwolf.com that gets information regarding account lockouts in AD. This has been great for gaining insight about the nature of our account lockou...
LainRobertson
Oct 10, 2024Silver Contributor
Hi, John.
Microsoft ships a module called ActiveDirectory as either part of the RSAT tools for Windows clients, or as part of Windows Server via the feature named "RSAT-AD-PowerShell".
If that ActiveDirectory module is installed (which it almost certainly will be by default on a domain controller, but may not be on anything that's not a domain controller) then you simply need to import the ActiveDirectory module prior to calling any of the functions you're defining.
Import-Module -Name ActiveDirectory;
Example
There are other ways but this is the most practical (without diverging into why).
Cheers,
Lain