I am working on a program for my company that requires an check function on the user's username, which requires the AD module to be installed ONLY when the program is opened. It works fine on my PC, but I am an admin and I run Windows 10. The rest of my environment is Windows 7.
My code:
Import-Module "\\FileServer\common\IT\Powershell\Modules\ActiveDirectory"
The error:
Import-Module: Could not load file or assembly 'file://\\bmh01-fs03\common\IT\Powershell\Modules\ActiveDirectory\Microsoft.ActiveDirectory.Management' or one of its dependencies. The ststem cannot find the file specified.
Is it something within the AD module? And why does it work on my PC and not a users?
The
ActiveDirectory
module is a non redistributable module. It comes as part of the Remote Server Administration Tools (RSAT), which you have to install on the client.If you want to avoid such dependencies, you can query Active Directory with the
[ADSI]
provider.