Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Active Directory / Deploy PowerShell Active Directory Module without Installing RSAT

April 15, 2020 Active DirectoryPowerShellWindows 10

Deploy PowerShell Active Directory Module without Installing RSAT

In one of the previous articles we showed how to use the Set-ADComputer cmdlet in a GPO logon script to save  the current logged in user info to the properties of each AD computer object. One of the commentators reasonably noted that to do it, you would have to install RSAT with Active Directory for Windows PowerShell on all user computers that may be time consuming. I decided to try and find out whether you can use the PowerShell ActiveDirectory Module cmdlets without installing RSAT on user computers. And I did it!

Suppose, we have a server running Windows Server 2012 R2, on which RSAT and RSAT-AD-PowerShell module are installed. Our task is to copy the RSAT-AD-PowerShell files to a user workstation and import them in order to run different AD module cmdlets. I deliberately use the computer running Windows 10 LTSC (based on 1809 build) as a workstation to show that earlier RSAT-AD-PowerShell versions are supported in newer OS versions.

First of all, let’s copy all AD module files from Windows Server 2012 R2 to Windows 10. Create a folder C:\PS\ADPoSh and copy all the contents of C:\Windows\System32\WindowsPowerShell\v1.0\Modules\ActiveDirectory to it.

Then copy the following files from C:\Windows\WinSxS folder:

  • Microsoft.ActiveDirectory.Management.dll
  • Microsoft.ActiveDirectory.Management.resources.dll
You can find these libraries by searching the WinSxS folder. In my example, the full paths in Windows Server 2012 R2 were as follows:

"C:\Windows\WinSxS\amd64_microsoft.activedirectory.management_31bf3856ad364e35_6.3.9600.16503_none_09aa35cd49da6068\Microsoft.ActiveDirectory.Management.dll"
"C:\Windows\WinSxS\amd64_microsoft.activedir..anagement.resources_31bf3856ad364e35_6.3.9600.16384_en-us_efefcf68718a71bc\Microsoft.ActiveDirectory.Management.resources.dll"

Microsoft.ActiveDirectory.Management.dll - copy active directory for powershell module files

Then copy the C:\PS\ADPoSh folder (in my case, its size was about 1.3MB) to a Windows 10 computer where RSAT AD module for Windows PowerShell is not installed.

Let’s try to import the copied Active Directory module to the current PowerShell session:

Import-Module "C:\PS\ADPoSh\Microsoft.ActiveDirectory.Management.dll"
Import-Module "C:\PS\ADPoSh\Microsoft.ActiveDirectory.Management.resources.dll"

Import-Module Microsoft.ActiveDirectory.Management.dll

The module has been successfully imported, and you can use any AD module cmdlet to manage and get information from your AD domain (e. g., Get-ADUser, Get-ADComputer, Get-ADGroup, etc.).

using get-aduser on windows 10 without installing rsat

If the error ‘Unable to contact the server. This may be because this server does not exist, it is currently down, or it does not have the Active Directory Web Services running‘ occurs, make sure that Active Directory Web Services (ADWS) on the closest domain controller is running and the TCP port 9389 is not blocked by firewall.

You can find a DC with ADWS role in your domain using the command:

Get-ADDomainController -Discover -Service “ADWS”

Get-ADDomainController discover Active Directory Web Services role

You can check the accessibility of the ADWS service using the Test-NetConnection cmdlet:

Test-NetConnection DC01 -port 9389

To run the cmdlets against the specific domain controller, use the –Server parameter:

Get-ADUser jbrion –server dc01.woshub.com

You can use the PowerShell AD module cmdlets till you close your PowerShell session. You can copy the AD module files to all domain computers using GPO.

16 comments
3
Facebook Twitter Google + Pinterest
previous post
How to Run Disk Cleanup (Cleanmgr.exe) on Windows Server 2016/2012 R2/2008 R2?
next post
Transferring/Seizing FSMO Roles to Another Domain Controller

Related Reading

How to Connect VPN Before Windows Logon

November 14, 2023

Using WPAD (Web Proxy Auto-Discovery Protocol) on Windows

November 7, 2023

Send Emails with Microsoft Graph API and PowerShell

November 6, 2023

Zabbix: How to Get Data from PowerShell Scripts

October 27, 2023

Tracking Printer Usage with Windows Event Viewer Logs

October 19, 2023

16 comments

Andrew March 23, 2020 - 8:17 am

Hi,
I tried this method but import of Microsoft.ActiveDirectory.Management.resources.dll always failed with error:

import-module : Could not load file or assembly ‘Microsoft.ActiveDirectory.Management.resources, Version=10.0.0.0,
Culture=en, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. Strong name validation failed. (Exception
from HRESULT: 0x8013141A)

I tried all x64 dll modules that was found in WinSXS but without success. Any idea what is wrong?

First module Microsoft.ActiveDirectory.Management.dll can be imported without problem.

Reply
Th March 28, 2020 - 2:04 pm

I have the same issue. Any luck so far?

Reply
admin March 31, 2020 - 9:00 am

List the files in your ADPoSh directory:
ls C:\ps\ADPoSh\
In my case the Microsoft.ActiveDirectory.Management.dll file size is about 1.1 Mb.

From which version of Windows did you copy the module files?

Reply
Mike July 31, 2020 - 10:33 pm

Has anyone solved this? I am seeing the same problem with the resources dll. The other one loads just fine

Reply
Viny May 17, 2020 - 2:15 pm

Thanks for sharing this article, This works fine but doesnt list all the properties. For example get-aduser abc -server DC -pr *

This should shows all properties. This doesnt work, please confirm if it works fine at your end.

Thanks again. Keep up the good work!

Reply
admin May 21, 2020 - 7:25 am

Yes, I confirm this problem.
You can try to list the available properties like this:
PS C:\Windows\System32> (get-aduser username -server 192.168.1.11 -Pr * -Credential woshub\admin).PropertyNames

Reply
Eric Willman July 27, 2021 - 8:32 pm

Did you figure this out? I get all the PropertyNames I want, but none of the values. If I run on a machine where the RSAT is installed, I get the values just fine.

Reply
Flint November 30, 2021 - 8:32 pm

I know this post is old, but try this:
[System.Reflection.Assembly]::LoadFile(‘C:\\Microsoft.ActiveDirectory.Management.dll’)
[System.Reflection.Assembly]::LoadFile(‘C:\\Microsoft.ActiveDirectory.Management.resources.dll’)

Reply
Flint November 30, 2021 - 8:34 pm

Hmmm, between the “C:\” and the “\Microsoft…” there should have been a ” included, but it got stripped out somehow.

Reply
Flint November 30, 2021 - 8:34 pm

Wow, nevermind. Anyway, the the path has to be an absolute path to the file.

Reply
Flint November 30, 2021 - 8:35 pm

[System.Reflection.Assembly]::LoadFile(‘C:\absolute path to file\Microsoft.ActiveDirectory.Management.dll’)
[System.Reflection.Assembly]::LoadFile(‘C:\absolute path to file\Microsoft.ActiveDirectory.Management.resources.dll’)

Reply
David December 15, 2021 - 7:47 pm

I am still new to PS, so I am wondering what this does? I have the same issue as others above where I get limited values for properties. I can expand the propertynames that returns but no values come with that.

Reply
Andy March 10, 2022 - 8:01 pm

I tried that. Same error:
Exception calling “LoadFile” with “1” argument(s): “Strong name validation failed. (Exception from HRESULT: 0x8013141A)”
At line:1 char:1
+ [System.Reflection.Assembly]::LoadFile(‘file-path-name-here’)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : SecurityException

Reply
Hal May 26, 2022 - 8:55 am

You don’t need to import the DDL files, just import the ActiveDirectory module directly. e.g. change to the folder and do import-module activedirectory.

Reply
dheeren September 15, 2022 - 7:24 am

you need to add 1 more line to make it work:

Import-Module “C:\Temp\a\Microsoft.ActiveDirectory.Management.dll”
Import-Module “C:\Temp\a\Microsoft.ActiveDirectory.Management.resources.dll”
import-module .\ActiveDirectory.psd1

Get-ADUser -server servername -identity ‘user’ -Properties *

Reply
Florian September 8, 2023 - 7:27 am

You sir, saved my day 🙂
This works and the tutorial should be updated!

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • How to Connect VPN Before Windows Logon

    November 14, 2023
  • Removing Azure Arc Setup Feature on Windows Server 2022

    November 9, 2023
  • Using WPAD (Web Proxy Auto-Discovery Protocol) on Windows

    November 7, 2023
  • Send Emails with Microsoft Graph API and PowerShell

    November 6, 2023
  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Get-ADUser: Find Active Directory User Info with PowerShell
  • Configuring Proxy Settings on Windows Using Group Policy Preferences
  • Managing User Photos in Active Directory Using ThumbnailPhoto Attribute
  • Changing Desktop Background Wallpaper in Windows through GPO
  • How to Restore Active Directory from a Backup?
  • Active Directory Dynamic User Groups with PowerShell
  • Restricting Group Policy with WMI Filtering
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top