My goal is to delete 90 day inactive users programmatically. While I am somewhat successful in doing that, I came across a situation where the user owns items that are shared to a special group. This is raising an exception (Error Code: 400) Unable to reassign user. User must not own items shared to a special group.
How could I handle this programmatically? Am I missing anything here.

Thanks.
-Naari