Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Oracle Change Log Entries using PowerShell. Associated blogpost https://blog.darrenjrobinson.com/querying-oracle-internet-directory-ldap-with-powershell/
# 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
You can’t perform that action at this time.