0
Answered

Dumping Adapter Data

Daniel Walters 6 years ago updated by anonymous 6 years ago 5

What would be the quickest way to dump the data in an adapter so I can compare two adapters? The use case is the replacement of an adapter and the new adapter should be a like-for-like replacement of the original with the same resulting data as a the old one. Would it be a PowerShell script that pulls the adapter via the ldap gateway?

Answer

Answer
Answered

Hey Daniel,

That's correct. The quickest and most supported way is to query the LDAP gateway for the adapter you're needing the data from.

Answer
Answered

Hey Daniel,

That's correct. The quickest and most supported way is to query the LDAP gateway for the adapter you're needing the data from.

Is there an example script? I'm trying to connect but getting username and password error when that's not the problem.

$Searcher = New-Object -TypeName System.DirectoryServices.DirectorySearcher

$RootOU = "ou=CSVUsers,DC=IdentityBroker"

$Searcher.SearchRoot = New-Object -TypeName System.DirectoryServices.DirectoryEntry -ArgumentList "LDAP://$($RootOU):9999" ,"read","read"

$Searcher.FindAll()

This works

$serverName = "localhost"
$Port = 9999
$UserName = "read"
$Password = "read"

#Load the assemblies
[System.Reflection.Assembly]::LoadWithPartialName("System.DirectoryServices.Protocols")
[System.Reflection.Assembly]::LoadWithPartialName("System.Net")

#Connects to Server on the standard port
$dn = "$ServerName"+":"+"$Port"
$c = New-Object System.DirectoryServices.Protocols.LdapConnection "$dn"
$c.SessionOptions.SecureSocketLayer = $false;
$c.SessionOptions.ProtocolVersion = 3

# Pick Authentication type:
# Anonymous, Basic, Digest, DPA (Distributed Password Authentication),
# External, Kerberos, Msn, Negotiate, Ntlm, Sicily
$c.AuthType = [System.DirectoryServices.Protocols.AuthType]::Basic

$credentials = new-object "System.Net.NetworkCredential" -ArgumentList $UserName,$Password

# Bind with the network credentials. Depending on the type of server,
# the username will take different forms. Authentication type is controlled
# above with the AuthType
Try
{

$c.Bind($credentials);

$baseDN = "OU=csvusers,DC=IdentityBroker"
$scope = [System.DirectoryServices.Protocols.SearchScope]::Subtree
$query = New-Object System.DirectoryServices.Protocols.SearchRequest -ArgumentList $baseDN, $objectFilter, $scope, $null

$var = $c.SendRequest($query)



}
catch
{
Write-host $_.Exception.Message
}