I have the following code. When I run this code on my workstation it works that is because I have the RSAT tools installed. I read the following on the Net
By default one can not import Active Directory module in Powershell in Windows 7. You need to do either of the below:
Download "Active Directory Management Gateway Service" on 2003 or 2008 server [http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=2852]
Download "Remote Server Administration Tools" on Win 7 [KB958830: http://www.microsoft.com/download/en/details.aspx?id=7887]
So how do I run the following code without being able to import-module activedirectory ??
import-module activedirectory
$getU = Get-ADUser MyUser -Properties homedirectory
$HomeDrive = $getU.HomeDirectory
$HomeDrive