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 (2.3k points)

1 Answer

0 votes
by (213k 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
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 (450 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 (2.7k points)
0 votes
0 answers

I have one user in my domain that will not get the self service enrollment popup, no matter which machine they log into. I can log into it and get prompted to ... find any difference and they show as not enrolled in Statistics. Any help would be appreciated.

asked Dec 4, 2014 by jasonearljohnson (480 points)
0 votes
1 answer

Modify mailbox settings for the user: set Hide from Exchange address lists to 'True' A parameter cannot be found that matches parameter name 'DomainController'. I am using Exchange ... How can I check this property? and can I force this property? Thank you.

asked Jun 9, 2015 by wynandt (280 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 Support (213k points)
2,037 questions
1,811 answers
5,159 comments
1,059 users