Quantcast
Channel: Directory Services forum
Viewing all articles
Browse latest Browse all 31638

pull users using AD attribute

$
0
0
Hi Experts

I want to make a dynamic distribution list but before that i am trying to write a query to pull Johns ogranization of manager who has direct reports and without direct reports

We have below custom attribute in AD for example 

for paul i have customattribute01 as |john|roger|<paul>|
for tim  i have customattribute01 as|john|roger|paul|<tim>|

If i use the below query i am getting the output but i dont see tims name because tim doesnot have direct reports, even though tim doesnot have direct reports i want to pull tim as well. experts guide me on this to modify the below query to include tim as well.

((extensionAttribute01 -like '*john*') -and (directReports -like '*' ))

$input = "((extensionAttribute01 -like '*john*') -and (directReports -like '*' ))"
Get-ADUser -Filter $input -properties DisplayName,Userprincipalname| Select DisplayName,Userprincipalname |export-csv C:\data.csv -Notypeinformation

Viewing all articles
Browse latest Browse all 31638

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>