PowerShell
                                
                                 PowerShell copied to clipboard
                                
                                    PowerShell copied to clipboard
                            
                            
                            
                        Get-ADDirectReports -Recurse where extensionattribute1 is not equal to "AAA"
@lazywinadmin Thank you, the code you have shared is very good.
In my case, I need to collect direct and indirect reporters with using -recurse feature where extensionAttribute1 is not equal to "AAA". Since the result count is very high (1,5k users) I believe we should apply that filter while the function collect the data.
Can you please help me?
line 71; try Get-Aduser -identity $Account -Properties directreports, extensionAttribute1 | Where extensionAttribute1 -ne 'AAA' |
from head, no testing