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 (680 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
0 answers

Softerra Adaxes does not extend the AD schema. Moreover, Softerra Adaxes does not store its data in Active Directory and doesn't modify the native permissions assigned in ... Adaxes, you can use Active Directory just as you did before the product installation.

asked Jun 17, 2009 by Adaxes (550 points)
0 votes
1 answer

Getting "object reference not set to an instance" when trying to sign into Office 365 Tenant Was working fine before

asked Sep 1, 2021 by davm79 (40 points)
3,346 questions
3,047 answers
7,782 comments
544,982 users