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.
LVL 1
Gene KlamerusTechnical ArchitectAsked:
Who is Participating?
 
footechCommented:
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?
2
 
Muhammad BurhanManager I.T.Commented:
run this in PS and share the result;
import-module activedirectory

Open in new window

1
 
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.
0
 
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.
0
 
footechCommented:
I'm glad it's resolved for you!  Please remember to close the question.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.