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.
Gene KlamerusTechnical ArchitectAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Muhammad BurhanManager I.T.Commented:
run this in PS and share the result;
import-module activedirectory

Open in new window

With Win7 you had to turn the specific RSAT features on after installing RSAT, but that's not the case with Win10.  After installing the RSAT package all the tools should be enabled by default.

I assume you're running the most recent release (not Insider's build) of Win10.  Did you install the RSAT package WindowsTH-RSAT_WS2016-x64.msu (meant for Win10 version 1607 and newer)?
If you navigate to Turn Windows features on and off, and then go to the RSAT tools, are they all (or just the ones you want, like for AD) checked?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Gene KlamerusTechnical ArchitectAuthor Commented:
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.
Gene KlamerusTechnical ArchitectAuthor Commented:
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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.