Softerra.Adaxes.Adsi.Search.DirectorySearcher not getting loaded.

General discussion of using Adaxes for Active Directory management and administration
Post Reply
Brajesh
Posts: 25
Joined: Fri Sep 11, 2015 1:37 pm

Softerra.Adaxes.Adsi.Search.DirectorySearcher not getting loaded.

Wed Aug 14, 2019 12:06 pm

Any idea why Softerra.Adaxes.Adsi.Search.DirectorySearcher is not getting loaded?

PS C:\Windows\system32> [Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")
$admNS = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$admService = $admNS.GetServiceDirectly("localhost")

GAC Version Location
--- ------- --------
True v4.0.30319 C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Softerra.Adaxes.Adsi\v4.0_3.10.16008.0__43a637781bd9a3c2\Softerra.Adaxes.Adsi.dll

PS C:\Windows\system32> $searcher = New-Object "Softerra.Adaxes.Adsi.Search.DirectorySearcher" $NULL, $False
New-Object : Cannot find type [Softerra.Adaxes.Adsi.Search.DirectorySearcher]: verify that the assembly containing this type is loaded.
At line:1 char:13
+ $searcher = New-Object "Softerra.Adaxes.Adsi.Search.DirectorySearcher ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidType: (:) [New-Object], PSArgumentException
+ FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewObjectCommand

User avatar
Support
Site Admin
Posts: 2379
Joined: Thu Apr 23, 2009 2:28 am

Re: Softerra.Adaxes.Adsi.Search.DirectorySearcher not getting loaded.

Thu Aug 15, 2019 2:00 am

Hello Brajesh,

The DirectorySearcher class is not getting loaded in Windows PowerShell because it can only be used in PowerShell scripts executed on the server side (by Business Rules, Custom Commands, Scheduled Tasks, and Reports). This behaviour is by design. For details, see http://adaxes.com/sdk/?DirectorySearcherClass.html.
To suggest you a solution, please, clarify what the script should do.
Active Directory Identity Management

Follow Adaxes in social networks
Image Image Image

Brajesh
Posts: 25
Joined: Fri Sep 11, 2015 1:37 pm

Re: Softerra.Adaxes.Adsi.Search.DirectorySearcher not getting loaded.

Thu Aug 15, 2019 12:01 pm

Okay. I was trying to create my own external PowerShell reports - like if a custom attribute is set to a value. Or working with managed and unmanaged users. Overlooked the "on the server side" statement. I will try to use it inside the tool. Thanks

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests