Dec 06 2021 12:02 PM
Hello all
First thank you for any help with this. I have the below one liner that shows me all the disabled users that have a value for direct reports on the disabled users account. What i am trying to get is the upn, and samaccountname for the accounts that are mentioned on the direct reports. If i run the below command it shows me the DN for the accounts, but i need upn and sam. Thanks in advance.
$Disabled = Get-ADUser -Filter * -Properties samaccountname,directreports,enabled | where {$_.directreports -notlike $null -and $_.enabled -eq $False} |select samaccountname,enabled,directreports,distinguishedname
Dec 16 2021 07:44 AM