PowerShell / PowerShellModuleCoverage

Track issues related to using Windows PowerShell modules with PowerShell
13 stars 10 forks source link

ActiveDirectory Module recognized but all Cmdlets fail with same error #16

Open jackfalveyiv opened 4 years ago

jackfalveyiv commented 4 years ago

Steps to reproduce

Get-ADDomain

Expected behavior

Return of user/domain information

Actual behavior

Error Message:

Get-ADUser: Type 'generatedProxy_14' from assembly 'ProxyBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is attempting to implement an inaccessible interface.

Get-ADDomain domain.com
Get-ADDomain: Type 'generatedProxy_15' from assembly 'ProxyBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is attempting to implement an inaccessible interface.

Environment data

Name                           Value
----                           -----
PSVersion                      7.0.0-preview.5
PSEdition                      Core
GitCommitId                    7.0.0-preview.5
OS                             Microsoft Windows 10.0.18362
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
george-chakhidze commented 4 years ago

Looks like PS Core 7 problem — it works fine on PS Core 6.2.3

rjmholt commented 4 years ago

@SteveL-MSFT @daxian-dbw we should investigate this

SteveL-MSFT commented 4 years ago

Setup a new 18362 VM, added RSAT AD mgmt feature, and installed PS7 preview.6 and Get-AdUser worked for me.

rjmholt commented 4 years ago

@jackfalveyiv @george-chakhidze are you still seeing this in PS 7-rc.1?

doctordns commented 4 years ago

I have done extensive testing with the AD modules.

The AD DS Deployment module (used to add DCs etc) does NOT work natively but is fine via WInCompat. I have installed a Forest root DC, a second DC, a Child domain DC, a second forest root dc and connected with the first by a x-forest trust. The Active Directory module DOES works natively.

Aside from the warning message when loading the AD DS module, my Windows PowerShell code works fine for AD management.

george-chakhidze commented 4 years ago

@rjmholt Works fine in 7.0.0-rc.2 (I don't have rc.1 installed).

SteveL-MSFT commented 4 years ago

@doctordns time for a blog post on this? :)

doctordns commented 4 years ago

That could be done...

BradCalvertHCA commented 3 years ago

I have noticed this same thing with every version since 7.0 was released, but it is not consistent. Often it will work fine on a freshly opened PS window but if I come back the next day to the same window, AD commands no longer work again. Closing the window and opening a new one will make it work.

Currently running 7.1.0

andersrson commented 3 years ago

Sorry for the necro, but just stumbled on this. Powershell 7.1.5, getting this error somewhat randomly. Different shell instances get this error with different cmdlets. Get-AdDomain sometimes, Get-AdForest sometimes.

PS C:\Users\anders.OZWCORP> Get-ADForest Get-ADForest: Type 'generatedProxy_4' from assembly 'ProxyBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is attempting to implement an inaccessible interface.

PS C:\Users\anders.OZWCORP> get-addomain Get-ADDomain: Type 'generatedProxy_5' from assembly 'ProxyBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is attempting to implement an inaccessible interface.