Skip to content

Commit 7b0ac46

Browse files
committed
Rename Filter to LDAPFilter to match ActiveDirectory module API
1 parent 6f6e41c commit 7b0ac46

File tree

7 files changed

+16
-16
lines changed

7 files changed

+16
-16
lines changed

src/ADServices/ADGroup.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ function Get-ADGroup {
1515
[OutputType([DirectoryServices.DirectoryEntry])]
1616
[CmdletBinding(DefaultParameterSetName='Filter')]
1717
param (
18-
# The filter to search for groups. Uses normal AD Search syntax, *not*
18+
# The filter to search for groups. Uses normal LDAP Search syntax, *not*
1919
# PS ActiveDirectory search.
2020
[Parameter(Mandatory, ValueFromPipeline, ParameterSetName='Filter')]
21-
[string] $Filter,
21+
[string] $LDAPFilter,
2222

2323
# The identity of the group to retrieve. Can be sAMAcountName, SID, LDAP
2424
# path, or distinguished name.

src/ADServices/ADObject.psm1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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

src/ADServices/ADOrganizationalUnit.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function Get-ADOrganizationalUnit {
1919
# The filter to search for OrganizationalUnits. Uses normal AD Search
2020
# syntax, *not* PS ActiveDirectory search.
2121
[Parameter(Mandatory, ValueFromPipeline, ParameterSetName='Filter')]
22-
[string] $Filter,
22+
[string] $LDAPFilter,
2323

2424
# The identity of the OrganizationalUnit to retrieve. Can be SID, LDAP
2525
# path, or distinguished name.

src/ADServices/ADUser.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ function Get-ADUser {
1717
[OutputType([DirectoryServices.DirectoryEntry])]
1818
[CmdletBinding(DefaultParameterSetName='Filter')]
1919
param (
20-
# The filter to search for users. Uses normal AD Search syntax, *not*
20+
# The filter to search for users. Uses normal LDAP Search syntax, *not*
2121
# PS ActiveDirectory search.
2222
[Parameter(Mandatory, ValueFromPipeline, ParameterSetName='Filter')]
23-
[string] $Filter,
23+
[string] $LDAPFilter,
2424

2525
# The identity of the user to retrieve. Can be sAMAcountName, SID, LDAP
2626
# path, or distinguished name.

src/ADServices/Tests/Integration/ADGroup.tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,5 @@ Describe 'ADGroup' -Tags Integration {
5757
& "$PSScriptRoot\Shared\Clear-TestObjects.ps1"
5858
}
5959

60-
#TODO Test by other Identity types, Set dict, test -Filter, automate clean-up.
60+
#TODO Test by other Identity types, Set dict, test -LDAPFilter, automate clean-up.
6161
}

src/ADServices/Tests/Integration/ADUser.tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,5 @@ Describe 'ADUser' -Tags Integration {
7575
& "$PSScriptRoot\Shared\Clear-TestObjects.ps1"
7676
}
7777

78-
#TODO Test by other Identity types, Set dict, test -Filter, automate clean-up.
78+
#TODO Test by other Identity types, Set dict, test -LDAPFilter, automate clean-up.
7979
}

src/ADServices/Tests/Integration/Shared/Clear-TestObjects.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ process {
1111
$BuiltInUserDistinguishedNames = & "$PSScriptRoot\Get-BuiltInUserDistinguishedNames.ps1"
1212

1313
# Cleanup ADUsers.
14-
Get-ADUser @ConnectionParam -Filter 'sAMAccountName=*' |
14+
Get-ADUser @ConnectionParam -LDAPFilter 'sAMAccountName=*' |
1515
Select-Object -ExpandProperty distinguishedName |
1616
Where-Object {
1717
($_ -NotIn $BuiltInUserDistinguishedNames) -and ($_ -notlike '*OU=Domain Controllers,DC=samdom,DC=example,DC=com')
@@ -24,7 +24,7 @@ process {
2424
$BuiltInGroupDistinguishedNames = & "$PSScriptRoot\Get-BuiltInGroupDistinguishedNames.ps1"
2525

2626
# Cleanup ADGroups.
27-
Get-ADGroup @ConnectionParam -Filter 'sAMAccountName=*' |
27+
Get-ADGroup @ConnectionParam -LDAPFilter 'sAMAccountName=*' |
2828
Select-Object -ExpandProperty distinguishedName |
2929
Where-Object {
3030
$_ -NotIn $BuiltInGroupDistinguishedNames
@@ -39,7 +39,7 @@ process {
3939
)
4040

4141
# Cleanup ADOrganizationalUnits.
42-
Get-ADOrganizationalUnit @ConnectionParam -Filter 'distinguishedName=*' |
42+
Get-ADOrganizationalUnit @ConnectionParam -LDAPFilter 'distinguishedName=*' |
4343
Select-Object -ExpandProperty distinguishedName |
4444
Where-Object {
4545
$_ -NotIn $BuiltInOrganizationalUnitDistinguishedNames

0 commit comments

Comments
 (0)