If an ActiveDirectory module is present, add
import-module activedirectory
in front of your code.
To check if an attempt exists:
get-module -listavailable
ActiveDirectory is present by default in Windows Server 2008 R2, install it as follows:
Import-Module ServerManager Add-WindowsFeature RSAT-AD-PowerShell
For it to work, you need at least one DC in the domain, like Windows 2008 R2, and it has Active Directory Web Services (ADWS) installed.
In Windows Server 2008, read here how to install it.
CB. Jul 9 '13 at 12:50 2013-07-09 12:50
source share