Powershell Modules on Linux (OutSide of .Net Core)

The DNSserver module for remote administration of Windows DNS servers does not appear to be available on powershell for Linux, as indicated by this error:

 


PS /home/gmonkey> Install-Module -Name DnsServer -Scope CurrentUser
PackageManagement\Install-Package : No match was found for the specified search criteria and module name ‘DnsServer’. Try Get-PSRepository to see all available registered module repositories.
At /opt/microsoft/powershell/6/Modules/PowerShellGet/PSModule.psm1:9491 char:21

  • … $null = PackageManagement\Install-Package @PSBoundParameters
  •                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
  • CategoryInfo : ObjectNotFound: (Microsoft.Power…InstallPackage:InstallPackage) [Install-Package], Exception
  • FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

 

Is it possible to get this module on linux’ powershell? My objective is to be able to administer Windows DNS configuration from a remote server (which is linux based).

Any workarounds or alternative solutions which include Linux as the host for the control instrumentation would be welcome, preferrably using powershell.

 

 

None of the normal RSAT (AD,DNS,etc) tools you would see on Windows are available on PSCore or OSX/NIX. Reason, they require full .Net to function.

From the What’s New In PowerShell Core 6.0 documentation, in the “Backwards Compatibility” section:

https://blogs.msmvps.com/richardsiddaway/category/powershell-v6

And using PSRemoting.

"We can proxy commands that you type and run and they will run on the remote machine. You'll be able to manage everything from everywhere," he explained. https://www.theregister.co.uk/2016/08/18/microsoft_brings_powershell_to_linux_and_mac_publishes_as_open_source
https://docs.microsoft.com/en-us/powershell/scripting/whats-new/what-s-new-in-powershell-core-60?view=powershell-6

Most of the modules that ship as part of Windows (for example,DnsClient, Hyper-V, NetTCPIP, Storage, etc.) and other Microsoft products including Azure and Office have not been explicitly ported to.NET Core yet. The PowerShell team is working with these product groups and teams to validate and port their existing modules to PowerShell Core. With .NET Standard and CDXML, many of these traditional Windows PowerShell modules do seem to work in PowerShellCore, but they have not been formally validated, and they are not formally supported.

They are all working to correct that, but no date when it will happen.

Even on Windows, unless you add the compatibility packs, PSCore does not have any of the RSAT cmdlets, you have to revert back to v1 language, using the .net namespace.

A quick option is to set up PowerShell Web Access on a remote Window’s server or Windows 8+ workstation and use your browser to PS stuff.

https://blogs.msdn.microsoft.com/powershell/2012/03/07/introducing-windows-powershell-web-access-in-windows-server-8-beta
https://blogs.msdn.microsoft.com/powershell/2012/03/07/introducing-windows-powershell-web-access-in-windows-server-8-beta

Other than that, see these:

PowerShell: Using Active Directory .Net methods in PowerShell Part 1 & 2 http://adsecurity.org/?p=113 https://adsecurity.org/?p=192

See also:

Support System.DirectoryServices.Protocols on Linux/Mac https://github.com/dotnet/corefx/issues/24843

Or

https://gp2x.org/adtool