Remove disabled Users from groups
Get-ADUser -Filter “Enabled -eq ‘$false'” -SearchBase ‘OU=Test,DC=ndsedv,DC=de’ -Properties memberOf | ForEach {
Remove-ADPrincipalGroupMembership -Identity $_.SamAccountName -MemberOf $_.memberOf -Confirm:$false
}