Run ACTIVE Directory commands from PowerShell installed on Linux RHEL 7

%3CLINGO-SUB%20id%3D%22lingo-sub-2078100%22%20slang%3D%22en-US%22%3ERun%20ACTIVE%20Directory%20commands%20from%20PowerShell%20installed%20on%20Linux%20RHEL%207%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2078100%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20run%20the%20Active%20Directory%20commands%20from%20PowerShell%20installed%20on%20Linux%20RHEL%207.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ehas%20anyone%20able%20to%20do%20this%20from%20Linux.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPS%20%2Froot%26gt%3B%20import-module%20ActiveDirectory%3CBR%20%2F%3EImport-Module%3A%20The%20specified%20module%20'ActiveDirectory'%20was%20not%20loaded%20because%20no%20valid%20module%20file%20was%20found%20in%20any%20module%20directory.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPS%20%2Froot%26gt%3B%20get-module%20-listavailable%3C%2FP%3E%3CP%3EDirectory%3A%20%2Fopt%2Fmicrosoft%2Fpowershell%2F7%2FModules%3C%2FP%3E%3CP%3EModuleType%20Version%20PreRelease%20Name%20PSEdition%20ExportedCommands%3CBR%20%2F%3E----------%20-------%20----------%20----%20---------%20----------------%3CBR%20%2F%3EManifest%201.2.5%20Microsoft.PowerShell.Archive%20Desk%20%7BCompress-Archive%2C%20Expand-Archive%7D%3CBR%20%2F%3EManifest%207.0.0.0%20Microsoft.PowerShell.Host%20Core%20%7BStart-Transcript%2C%20Stop-Transcript%7D%3CBR%20%2F%3EManifest%207.0.0.0%20Microsoft.PowerShell.Management%20Core%20%7BAdd-Content%2C%20Clear-Content%2C%20Clear-ItemProperty%2C%20Join-Path%E2%80%A6%7D%3CBR%20%2F%3EManifest%207.0.0.0%20Microsoft.PowerShell.Security%20Core%20%7BGet-Credential%2C%20Get-ExecutionPolicy%2C%20Set-ExecutionPolicy%2C%20ConvertFrom-SecureString%E2%80%A6%7D%3CBR%20%2F%3EManifest%207.0.0.0%20Microsoft.PowerShell.Utility%20Core%20%7BExport-Alias%2C%20Get-Alias%2C%20Import-Alias%2C%20New-Alias%E2%80%A6%7D%3CBR%20%2F%3EScript%201.4.7%20PackageManagement%20Desk%20%7BFind-Package%2C%20Get-Package%2C%20Get-PackageProvider%2C%20Get-PackageSource%E2%80%A6%7D%3CBR%20%2F%3EScript%202.2.5%20PowerShellGet%20Desk%20%7BFind-Command%2C%20Find-DSCResource%2C%20Find-Module%2C%20Find-RoleCapability%E2%80%A6%7D%3CBR%20%2F%3EScript%202.0.5%20PSDesiredStateConfiguration%20Core%20%7BConfiguration%2C%20New-DscChecksum%2C%20Get-DscResource%2C%20Invoke-DscResource%7D%3CBR%20%2F%3EScript%202.1.0%20PSReadLine%20Desk%20%7BGet-PSReadLineKeyHandler%2C%20Set-PSReadLineKeyHandler%2C%20Remove-PSReadLineKeyHandler%2C%20Get-PSR%E2%80%A6%3CBR%20%2F%3EBinary%202.0.3%20ThreadJob%20Desk%20Start-ThreadJob%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2078100%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EWindows%20PowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Visitor

Hi,

 

I am trying to run the Active Directory commands from PowerShell installed on Linux RHEL 7.

 

has anyone able to do this from Linux.

 

PS /root> import-module ActiveDirectory
Import-Module: The specified module 'ActiveDirectory' was not loaded because no valid module file was found in any module directory.

 

 

PS /root> get-module -listavailable

Directory: /opt/microsoft/powershell/7/Modules

ModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Manifest 1.2.5 Microsoft.PowerShell.Archive Desk {Compress-Archive, Expand-Archive}
Manifest 7.0.0.0 Microsoft.PowerShell.Host Core {Start-Transcript, Stop-Transcript}
Manifest 7.0.0.0 Microsoft.PowerShell.Management Core {Add-Content, Clear-Content, Clear-ItemProperty, Join-Path…}
Manifest 7.0.0.0 Microsoft.PowerShell.Security Core {Get-Credential, Get-ExecutionPolicy, Set-ExecutionPolicy, ConvertFrom-SecureString…}
Manifest 7.0.0.0 Microsoft.PowerShell.Utility Core {Export-Alias, Get-Alias, Import-Alias, New-Alias…}
Script 1.4.7 PackageManagement Desk {Find-Package, Get-Package, Get-PackageProvider, Get-PackageSource…}
Script 2.2.5 PowerShellGet Desk {Find-Command, Find-DSCResource, Find-Module, Find-RoleCapability…}
Script 2.0.5 PSDesiredStateConfiguration Core {Configuration, New-DscChecksum, Get-DscResource, Invoke-DscResource}
Script 2.1.0 PSReadLine Desk {Get-PSReadLineKeyHandler, Set-PSReadLineKeyHandler, Remove-PSReadLineKeyHandler, Get-PSR…
Binary 2.0.3 ThreadJob Desk Start-ThreadJob

 

1 Reply

Hello @Jayeshpc,

Can you please elaborate? What are you trying to achieve?

Can you please describe your use case?

 

As described here ActiveDirectory module is only supported in Windows and in PowerShell core relies on WindowsCompatibility module functionality:

Screenshot_20210129-012016.png

 

Hope that helps.