Select-LDAP -Connection $conn -Table User -Where "CN = Administrator" | Remove-LDAP The following line deletes any records that match the criteria: The Connection, Table, and Columns are appended to the results in order to facilitate piping results from one of the
We do this because the CData Cmdlets append Connection, Table, andĬolumns information onto each "row" in the result set, and we do not necessarily want that information in our CSV file. You will notice that we piped the results from Select-LDAP into a Select-Object cmdlet and excluded some propertiesīefore piping them into an Export-Csv cmdlet. Select-LDAP -Connection $conn -Table User | Select -Property * -ExcludeProperty Connection,Table,Columns | Export-Csv -Path c:\myUserData.csv -NoTypeInformation $conn = Connect-LDAP -User "$User" -Password "$Password" -Server "$Server" -Port "$Port"įollow the steps below to retrieve data from the User table and pipe the result into to a CSV file: Note: Specifying a narrow BaseDN may greatly increase performance for example, cn=users,dc=domain will only return results contained within cn=users and its children.
#POWERSHELL LDAP QUERY USER PASSWORD#
Valid User and Password credentials (e.g., Domain\BobF or cn=Bob F,ou=Employees,dc=Domain).To establish a connection, the following properties under the Authentication section must be provided: PowerShell module offering straightforward integration with LDAP.įind examples of using our LDAP Cmdlets with native PowerShell cmdlets.Ĭreating a Connection to Your LDAP Objects The CData Cmdlets Module for LDAP is a standard