@@ -21,10 +21,10 @@ function Get-ADObject {
2121 [Parameter (Position = 0 )]
2222 [string ] $Type ,
2323
24- # The filter to search for entries. Uses normal AD Search syntax, *not*
24+ # The filter to search for entries. Uses normal LDAP Search syntax, *not*
2525 # PS ActiveDirectory search.
2626 [Parameter (Mandatory , ValueFromPipeline , ParameterSetName = ' Filter' )]
27- [string ] $Filter ,
27+ [string ] $LDAPFilter ,
2828
2929 # The identity of the entry to retrieve. Can be sAMAcountName, SID, LDAP
3030 # path, or distinguished name.
@@ -48,13 +48,13 @@ function Get-ADObject {
4848 }
4949 process {
5050 if ($Identity ) {
51- $Filter = Convert-ADIdentityToFilter - Identity $Identity
51+ $LDAPFilter = Convert-ADIdentityToFilter - Identity $Identity
5252 }
5353
5454 if ($Type ) {
55- $searcher.Filter = " (&(objectClass=$Type )($Filter ))"
55+ $searcher.Filter = " (&(objectClass=$Type )($LDAPFilter ))"
5656 } else {
57- $searcher.Filter = " ($Filter )"
57+ $searcher.Filter = " ($LDAPFilter )"
5858 }
5959 Write-Verbose " Searching for '$ ( $searcher.Filter ) '"
6060 $searchResult = $searcher.FindAll ()
@@ -130,7 +130,7 @@ function New-ADObject {
130130 Write-Verbose " $ ( $MyInvocation.MyCommand ) : $targetSummary "
131131 $newEntry = $baseEntry.Children.Add (" $DistinguishedComponenentType =$Name " , $Type )
132132 if ($DoSAMAccountName ) {
133- $existing = Get-ADObject - Filter " sAMAccountName=$Name " - Server $Server - Credential $Credential
133+ $existing = Get-ADObject - LDAPFilter " sAMAccountName=$Name " - Server $Server - Credential $Credential
134134 if (($existing | Measure-Object ).Count) {
135135 # objectClass contains the full class inheritance hierarchy so we only want the final, most-specific entry.
136136 $existingClass = $existing.objectClass | Select-Object - Last 1
0 commit comments