I recently published a script for removing old active sync partnerships from environment that might come in handy in this scenario, Please check same below
Also have a script that generates device report in csv file or for SQL upload. Will send same separately.
Good one Kris !
I would only change -Mailbox $_.Name for -Mailbox $_.Identity since you might have more than one mailbox with the same name (in which case we are going to get errors during execution ) , but Identity is unique for the Exchange organization.
Thanks Filip. I made that change in the one line. Thanks again for your feedback!
I have run this - but it doesnt output to the test.txt file, any idea why?Gavin.
Gavin, there are a number of ways with powershell to send output to a file. A couple of things you could do here would be to create the text file in advanced. this should eliminate any permissions issues with creating the file on the c: drive. You could also try a different drive path (d, for example). Also, are you sure the query is actually grabbing data? After the script has run, try typing $mbstats and hit enter, and make sure some data is displayed on the screen. If not, then the query is not finding any data that matches the query statement (for whatever reason).