0 votes

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

by (460 points)

1 Answer

0 votes
by (216k points)
selected by
Best answer

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.

0

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

Related questions

0 votes
1 answer

Good morning, I'm trying to process a search and export using the Adaxes console to create a list of users using specific criteria. I've been able to process this ... and the job is cancelled Please advise on how I might proceed in addressing this issue.

asked Jan 13, 2022 by jtop (700 points)
0 votes
0 answers

I could not find an example of an ADSI API paged search, and learned the following through trial-and-error (using VB.NET). LDAP searches are ... = ex.Message Finally If Not IsNothing(admSearchResultIterator) Then admSearchResultIterator.Dispose() End Try

asked Jul 18, 2016 by jmcmurry (40 points)
0 votes
1 answer

Hallo, I'm trying to build a function that will have two parameters $Containrer and $Filter $filter - is a LDAP filer that serach some specific objects $Containrer - is a ... is treated by powershell as a hash table, is it possible to workoroud it somhow?

asked Aug 12, 2015 by axmaster (510 points)
0 votes
1 answer

I'd like to see all the possible configuration settings if possible.

asked Jun 4 by ZoomGhost (280 points)
0 votes
1 answer

We have a business rule that will update an AD attribute when a new member is added to a group. This business rule works when we use powershell commands or the admin console ... set to trigger "After adding a member to a group". Thank you for your support!

asked Mar 29, 2023 by mark.it.admin (2.3k points)
3,552 questions
3,242 answers
8,243 comments
547,828 users