AD Disabled Users RRS feed

  • Question

  • I'd like to run a PowerShell script that will report on disabled users that are in security groups that contain certain characters in the name of the groups. The below code doesn't work but you hopefully you'll understand what I'm trying to do.

    $365group = Get-ADGroup -Filter "Name -like '*_365*'"

    Get-ADUser -Filter "memberof -eq '$(Get-ADGroup $365Group)' -and Enabled -eq '$false'" | Select Name, SamAccountName

    • Moved by Dave PatrickMVP Tuesday, September 29, 2020 12:46 PM looking for forum
    Tuesday, September 29, 2020 12:32 PM