HI Team,
How can i list all ou’s under the o=world of ldap server.
here is the script that i used.
any help is much appreciated. Thank oyu

Clear-Host
#Install-Module -Name S.DS.P -RequiredVersion 1.8.2
Add-Type -AssemblyName System.DirectoryServices.Protocols
# Load the required modules.
Import-Module S.DS.P

$userName           = "uid=test,ou=people,ou=test,o=world"
$password           ="test" 
$userPass           = $userName + ':' + $password


$hostName               = "test.com"
$port                   = 636
$filter                 = "uid"
$baseDN                 = "o=world"
$searchScope            = "Subtree"

                          

# Establish a connection to the directory and authenticate.
$directoryIdentifier = New-Object System.DirectoryServices.Protocols.LdapDirectoryIdentifier($hostName, $Port)
$conn = New-Object System.DirectoryServices.Protocols.LdapConnection($directoryIdentifier)
$conn.SessionOptions.SecureSocketLayer=$true
$conn.AuthType = "Basic"
$cred = New-Object System.Net.NetworkCredential($userName, $password)
$conn.Credential = $cred
$conn.Bind()

Is this Active Directory LDAP or a third party LDAP server?

Why not just the query at Domain Users & Computers, then export the list ?

its sa ldap server