Link to home
Start Free TrialLog in
Avatar of AlphaLolz
AlphaLolzFlag for United States of America

asked on

Problem running a PS that makes AD calls.

I'm having problems running a powershell script.  The script is short.  It asks for my AD credentials and then checks when my password will expire.

I've installed a new Windows 10 machine and it's not running despite having downloaded PS 5.1 and the RSAT for Windows 10.  I've done the usual enabling of script running, but despite having downloaded the RSAT (for 64-bit Windows) I get the error message:

"Get-ADUser : The term 'Get-ADUser' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again."

I recall seeing this before when I haven't downloaded the RSAT module, but I've tried now to do this combo also on some Windows 7 images I run in VMWare Workstation.  Is there perhaps something about the PS 5.1 that is causing issues?  Something in a path?  I don't recall having run into this before, but I only recall having downloaded PS 5.0 before.
Avatar of Muhammad Burhan
Muhammad Burhan
Flag of Pakistan image

run this in PS and share the result;
import-module activedirectory

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of footech
footech
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AlphaLolz

ASKER

It's actually my Windows 7 VMs that are struggling.  My windows 10 install is working okay now.

if I type import-module activedirectory I get the message "the specified module 'activedirectory' was not loaded because no valid module file was found in any module directory".

If I try to re-download though it says already installed for RSAT.
I didn't realize I needed to turn on any features in Windows 7.   I found a page showing which ones to enable.  Thanks.
I'm glad it's resolved for you!  Please remember to close the question.