You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[adsi] type accelerator is unavailable / throws an exception #3266
Steve Lee (@SteveL-MSFT) Do we have any idea when the active directory types are going to be added to CoreClr? You can't add the accelerators until the underlying types are there so marking this "up for grabs" is kind of pointless.
Steve Lee (@SteveL-MSFT)Dongbo Wang (@daxian-dbw) I believe it is important features for Enterprises and we should enable its.
Currently there is no progress in CoreFX with System.DirectoryServices. So I think we should enable it for Windows only.
It seems we cannot directly reference in GAC System.DirectoryServices .
Is there a way to solve this problem?
In CoreFX repo comments say that it depends very much on COM, also, there is no port LDAP library yet. I believe that this will not be done much longer. That's why I'm requesting to enable it on Windows based on GAC dlls.
@PowerShell/powershell-committee reviewed this and agreed we should not take explicitly dependency on assemblies in the GAC. However, to resolve this class of issues, we agreed that we should have a module like "WindowsPSModulePath" to create aliases that have been excluded from PSCore6. Steve to work on that module. Leaving this issue until DirectoryEntry shows up in corefx.
Unfortunately, it appears my workaround isn't complete so I can't actually enable this in my module. Currently, we explicitly #ifdef out the type convertors for ADSI (and WMI) as the type doesn't exist in corefx. Without the type convertors, it's only a partial solution to manually add the type accelerator.
It would be useful to have a "delay resolved" type accelerator - that would help startup performance a bit by not eagerly loading all the assemblies referenced by accelerators, and as a bonus, you could add the adsi accelerator in the core.
That said, I never implemented this idea because I was pretty sure some other code running during startup would just load the assemblies I was trying to defer.
Vladimir (@dronkoff) the PSCoreWindowsCompat module will add most of the .NET System.DirectoryServices namespace back (Only works on windows, no support for macOS or Linux). The ADSI type accelerators and the special things PS does with them are not available.
We consider Windows Compatibility Pack as an opportunity to return back the excluded features in PowerShell Core on Windows until .Net Core implement the APIs.
Currently Windows Compatibility Pack is still preview.
Activity
iSazonov commentedon Mar 6, 2017
Following types not in CoreCLR:
BrucePay commentedon Mar 6, 2017
Steve Lee (@SteveL-MSFT) Do we have any idea when the active directory types are going to be added to CoreClr? You can't add the accelerators until the underlying types are there so marking this "up for grabs" is kind of pointless.
SteveL-MSFT commentedon Mar 6, 2017
Bruce Payette (@BrucePay) no idea, not a focus for PS Core 6.0.0
iSazonov commentedon Mar 6, 2017
They've just added to CoreFX without tests. The work has high priority for .NET Standard 2.0
https://github.com/dotnet/corefx/issues/2089#issuecomment-261681168
iSazonov commentedon Sep 15, 2017
CoreFX change milestone to 2.1.0. System.DirectoryServices is still unstable.
iSazonov commentedon Sep 27, 2017
Steve Lee (@SteveL-MSFT) Dongbo Wang (@daxian-dbw) I believe it is important features for Enterprises and we should enable its.
Currently there is no progress in CoreFX with
System.DirectoryServices. So I think we should enable it for Windows only.It seems we cannot directly reference in GAC
System.DirectoryServices.Is there a way to solve this problem?
SteveL-MSFT commentedon Sep 27, 2017
I think we should defer this to 6.1.0 given we should depend on corefx. Perhaps we should suppress the type accelerator for now.
iSazonov commentedon Sep 27, 2017
In CoreFX repo comments say that it depends very much on COM, also, there is no port LDAP library yet. I believe that this will not be done much longer. That's why I'm requesting to enable it on Windows based on GAC dlls.
SteveL-MSFT commentedon Sep 27, 2017
I'm not sure if we want to set a precedent on creating a dependency on the GAC from PSCore. cc Dongbo Wang (@daxian-dbw)
daxian-dbw commentedon Sep 27, 2017
It seems DirectoryServices code is available in corefx: https://github.com/dotnet/corefx/tree/master/src/System.DirectoryServices/src/System/DirectoryServices
and the preview version nuget package for
System.DirectoryServicesis also available on dotnet-core feed (https://dotnet.myget.org/feed/dotnet-core/package/nuget/System.DirectoryServices).Can't we wait for that to mature and depend on that instead?
4 remaining items
iSazonov commentedon Sep 29, 2017
I thought about this and about our compatibility module.
My concerns:
Suggestion is - create temporary nuget package to expose the GAC dll until CoreFX issue a ported version.
I think too many Windows users will be forced to use workarounds - why should we rob them? :-)
SteveL-MSFT commentedon Nov 1, 2017
@PowerShell/powershell-committee reviewed this and agreed we should not take explicitly dependency on assemblies in the GAC. However, to resolve this class of issues, we agreed that we should have a module like "WindowsPSModulePath" to create aliases that have been excluded from PSCore6. Steve to work on that module. Leaving this issue until DirectoryEntry shows up in corefx.
SteveL-MSFT commentedon Nov 2, 2017
Unfortunately, it appears my workaround isn't complete so I can't actually enable this in my module. Currently, we explicitly
#ifdefout the type convertors for ADSI (and WMI) as the type doesn't exist in corefx. Without the type convertors, it's only a partial solution to manually add the type accelerator.lzybkr commentedon Nov 2, 2017
It would be useful to have a "delay resolved" type accelerator - that would help startup performance a bit by not eagerly loading all the assemblies referenced by accelerators, and as a bonus, you could add the
adsiaccelerator in the core.That said, I never implemented this idea because I was pretty sure some other code running during startup would just load the assemblies I was trying to defer.
dronkoff commentedon Jan 15, 2018
So, gentleman, can I search in AD from PS Core 6.0 or need to wait for future releases?
iSazonov commentedon Jan 15, 2018
Try the module https://github.com/markekraus/PSCoreWindowsCompat
markekraus commentedon Jan 15, 2018
Vladimir (@dronkoff) the PSCoreWindowsCompat module will add most of the .NET
System.DirectoryServicesnamespace back (Only works on windows, no support for macOS or Linux). The ADSI type accelerators and the special things PS does with them are not available.dronkoff commentedon Jan 15, 2018
Guys, that works for me. Thanks Mark Kraus (@markekraus) !
Is it an official way (workaround) from PS team?
iSazonov commentedon Jan 15, 2018
We consider Windows Compatibility Pack as an opportunity to return back the excluded features in PowerShell Core on Windows until .Net Core implement the APIs.
Currently Windows Compatibility Pack is still preview.