Looking to prune inactive users

Hi everyone -

Looking for a script, or SQL query I could run to prune out inactive users. We are using LDAP for authentication, but find that some users come check out Mattermost once, then never come back.

Would like to purge those users based on a inactive for XX days.

Any suggestions? (I did submit a feature request).