AdsiPS icon indicating copy to clipboard operation
AdsiPS copied to clipboard

Compatibility with .Net Core framework to make the module cross platform (compatible with linux/macos)

Open lazywinadmin opened this issue 7 years ago • 7 comments

https://docs.microsoft.com/fr-fr/dotnet/api/system.directoryservices?view=netcore-2.0

lazywinadmin avatar Oct 20 '17 16:10 lazywinadmin

The system.directoryservices class is in preview version : https://dotnet.myget.org/feed/dotnet-core/package/nuget/System.DirectoryServices (The feed : https://dotnet.myget.org/gallery/dotnet-core) To install it in Linux (Debian 8) with PackageManagement :

  • Add Feed in sources : PS > Register-PackageSource -Name 'dotnet-core' -Location https://dotnet.myget.org/F/dotnet-core/api/v2 -Provider NuGet

  • To find package preview : PS > Find-Package System.DirectoryServices -Source dotnet-core -AllowPrereleaseVersions -Force

  • To install package preview : PS > Find-Package System.DirectoryServices -Source dotnet-core -AllowPrereleaseVersions -Force | Install-Package -Force

Before this, you need to install 4 dependecies with the same method :

  • System.IO.FileSystem.AccessControl
  • System.Security.AccessControl
  • System.Security.Permissions
  • System.Security.Principal.Windows

All package downloaded in : /usr/local/share/PackageManagement/NuGet/Packages/

Every packages have a dll file in ./"PackageName"/lib/netstandard2.0. Put them in /usr/share/dotnet/shared/Microsoft.NetCore.App/2.0.0

I'm here now. I did not succed to load the System.DirectoryServices.dll.

NicolasBn avatar Nov 05 '17 10:11 NicolasBn

@lazywinadmin I don't know if you've tried this but if I import the PSCoreWindowsCompat package from PowerShell Gallery I've been able to use the AdsiPS module, at least in PowerShell Core on Windows. I haven't really tested much yet but it looks promising. 😃

gwojan avatar Dec 15 '17 17:12 gwojan

Thanks @gwojan ! Looks promising indeed. Will give it a shot probably in January.

lazywinadmin avatar Dec 16 '17 00:12 lazywinadmin

As mentioned by @lxlechat there is some new capabilities in .Net Core 3: https://docs.microsoft.com/en-us/dotnet/api/?view=netcore-3.0&term=direct

To investigate

lazywinadmin avatar Oct 03 '19 22:10 lazywinadmin

I Make some test on Centos VM which is integrate into the domain ADDS but with no success I have all Namespaces. image (5) img1 image (2) img2

JM2K69 avatar Oct 04 '19 12:10 JM2K69

Thanks for checking @JM2K69 what do you see if you do [System.DirectoryServices.ActiveDirectory]|gm -static

lazywinadmin avatar Oct 04 '19 23:10 lazywinadmin

I will test it not this weekend but Monday. 😉

JM2K69 avatar Oct 05 '19 05:10 JM2K69