Last active
June 13, 2019 00:32
-
-
Save darrenjrobinson/dcb826c6d6d1d048037cc82a412824a3 to your computer and use it in GitHub Desktop.
Oracle Change Log Entries using PowerShell. Associated blogpost https://blog.darrenjrobinson.com/querying-oracle-internet-directory-ldap-with-powershell/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Uses slightly different query that for general users as ChangeLog is extremely perscriptive on format in Oracle Internet Directory | |
$changeNumber = "8781760" | |
$changeResponse = $null | |
$ldapCredentials = New-Object System.Net.NetworkCredential($username,$password) | |
$ldapConnection = New-Object System.DirectoryServices.Protocols.LDAPConnection("$($server):$($port)",$ldapCredentials,"Basic") | |
$changeFilter = "(&(targetdn=*$($ldapSearchBase))(changeNumber>=$($changeNumber)))" | |
$changeTimeOut = new-timespan -Seconds 30 | |
$changeRequest = New-Object System.DirectoryServices.Protocols.SearchRequest("cn=changelog", $changeFilter, "OneLevel", $null) | |
$changeResponse = $ldapConnection.SendRequest($changeRequest, $changeTimeOut) | |
$changeResponse.Entries |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment