Hi Everyone,Using the below script, I need your help to modify the RegEx pattern filtering to exclude certain patterns.
$RegExPatterns = @( '[0-9A-Fa-f]{8}' ) $filter = ' ( ObjectClass -eq "user" -or ObjectClass -eq "computer" ) -and Enabled -eq $true -and isRecycled -eq $false ' Get-ADObject -Filter $filter | Where-Object { $_.Name -match $RegExPatterns }The above RegExPattern match everything, but I wanted to exclude the below name selected or filtered:Customer876Feedback Class820Feedback Class821FeedbackThank you.
$RegExPatterns = @( '[0-9A-Fa-f]{8}' ) $filter = ' ( ObjectClass -eq "user" -or ObjectClass -eq "computer" ) -and Enabled -eq $true -and isRecycled -eq $false ' Get-ADObject -Filter $filter | Where-Object { $_.Name -match $RegExPatterns }