@@ -8748,6 +8748,15 @@ specifying the user/group member to query for group membership.
8748
8748
8749
8749
Switch. Return users with '(adminCount=1)' (meaning are/were privileged).
8750
8750
8751
+ .PARAMETER GroupScope
8752
+
8753
+ Specifies the scope (DomainLocal, Global, or Universal) of the group(s) to search for.
8754
+
8755
+ .PARAMETER GroupProperty
8756
+
8757
+ Specifies a specific property to search for when performing the group search.
8758
+ Possible values are Security, Distribution, and CreatedBySystem.
8759
+
8751
8760
.PARAMETER Domain
8752
8761
8753
8762
Specifies the domain to use for the query, defaults to the current domain.
@@ -8910,6 +8919,15 @@ Custom PSObject with translated group property fields.
8910
8919
[Switch]
8911
8920
$AdminCount,
8912
8921
8922
+ [ValidateSet('DomainLocal', 'Global', 'Universal')]
8923
+ [Alias('Scope')]
8924
+ [String]
8925
+ $GroupScope,
8926
+
8927
+ [ValidateSet('Security', 'Distribution', 'CreatedBySystem')]
8928
+ [String]
8929
+ $GroupProperty,
8930
+
8913
8931
[ValidateNotNullOrEmpty()]
8914
8932
[String]
8915
8933
$Domain,
@@ -9054,6 +9072,24 @@ Custom PSObject with translated group property fields.
9054
9072
Write-Verbose '[Get-DomainGroup] Searching for adminCount=1'
9055
9073
$Filter += '(admincount=1)'
9056
9074
}
9075
+ if ($PSBoundParameters['GroupScope']) {
9076
+ $GroupScopeValue = $PSBoundParameters['GroupScope']
9077
+ $Filter = Switch ($GroupScopeValue) {
9078
+ 'DomainLocal' { '(groupType:1.2.840.113556.1.4.803:=4)' }
9079
+ 'Global' { '(groupType:1.2.840.113556.1.4.803:=2)' }
9080
+ 'Universal' { '(groupType:1.2.840.113556.1.4.803:=8)' }
9081
+ }
9082
+ Write-Verbose "[Get-DomainGroup] Searching for group scope '$GroupScopeValue'"
9083
+ }
9084
+ if ($PSBoundParameters['GroupProperty']) {
9085
+ $GroupPropertyValue = $PSBoundParameters['GroupProperty']
9086
+ $Filter = Switch ($GroupPropertyValue) {
9087
+ 'Security' { '(groupType:1.2.840.113556.1.4.803:=2147483648)' }
9088
+ 'Distribution' { '(!(groupType:1.2.840.113556.1.4.803:=2147483648))' }
9089
+ 'CreatedBySystem' { '(groupType:1.2.840.113556.1.4.803:=1)' }
9090
+ }
9091
+ Write-Verbose "[Get-DomainGroup] Searching for group property '$GroupPropertyValue'"
9092
+ }
9057
9093
if ($PSBoundParameters['LDAPFilter']) {
9058
9094
Write-Verbose "[Get-DomainGroup] Using additional LDAP filter: $LDAPFilter"
9059
9095
$Filter += "$LDAPFilter"
0 commit comments