Hi, welcome to Spiceworks, and thanks for your query. As a new user here on Spicworks, I urge all new users to read our ‘read before posting;’ post: PLEASE READ BEFORE POSTING! Read if you're new to the PowerShell forum!

You would need to use a few cmdlets to achieve this:

First, you would get all groups Get-ADGroups -Filter *.

For each of those groups, get group membership.

ANd for each member get the ADUser object (Get-ADUser) to see if they are disabled, and of so removing them from that groups.

Please have a go at doing this, then post any issues (and the code that is related).

1 Spice up