Install Powershell module as normal user

368 Views Asked by At

I want to use the Get-ADUser module to retrieve data from the AD domain.

Non-Administrator permissions in the directory are sufficient to perform that action.

Locally, Administrator permissions are necessary to install to install the module as part of Windows Remote Server Administration Tools like so:

Get-WindowsCapability -Name RSAT.ActiveDirectory* -Online | Add-WindowsCapability -Online

Is there a way to make the Get-ADUser module available to my local user without local Administrator permissions?

1

There are 1 best solutions below

2
AdamL On

You have two options that worked for me:

  1. Find nuget (.nupkg) file for ActiveDirectory module (used to be available to download from PowershellGallery, but it's not there anymore) and extract it.
  2. Copy AD module install directory from a server when the module is installed. That's assuming you have rights on other servers, or somebody can copy it for you.

Then you can Import-Module from this extracted/copied folder.

You can even make the module work on Windows 10:

  1. Copy Microsoft.ActiveDirectory.Management.dll to module location. Normally it's installed with RSAT, you can get it from GAC on a server when AD module is installed.
  2. Open ActiveDirectory.psd1
  3. Change RequiredAssemblies="Microsoft.ActiveDirectory.Management to RequiredAssemblies='.\Microsoft.ActiveDirectory.Management.dll'