Note: BTW, the following solution might not be the best or most efficient, so let me know if you know a faster/easier way to do this, I'm willing to learn more about querying AD.
Here are the key element of the script, I want:
- Computer Inactive for >=90 days
- Be able to specify a SearchRoot
- Filter on the Operating System if possible (I want only Windows Servers, without the Domain controllers for example)
- Return SamAccountName, Name, DN, Operating System, and Description
- Limit the number of object to return (can be useful for large environment)