How to query an ibm domino server using powershell

Create a connection to an IBM domino server and create custom filters


# Create the credentials of a domino administrator #

$user = 'poweruser'
$password = 'Power123'

# Create a conection string, note in this example the server is called domino2, change to suit your server name #
$root = New-Object -TypeName System.DirectoryServices.DirectoryEntry("LDAP://Domino2/CN=All Lotus Note Users", $user, $password, [System.DirectoryServices.AuthenticationTypes]::None)

# create the query using the variable above #
$query = New-Object System.DirectoryServices.DirectorySearcher($root)

# Create a filter to narrow down your search, below are some examples but you should modify these to suit your purpose #
$query.Filter = "(cn=*)"
$query.Filter = "(objectClass=*)"
$query.Filter = "(objectClass=dominoPerson)"
$query.Filter = "((objectclass=dominoPerson)(cn=london))"
$query.Filter = "(cn=chicago)"
$query.Filter = "(objectClass=mail)"
$query.Filter = '(member=*Jason Manford*)'

# Store the result in a variable #
$result = $query.FindAll()



Comments