question

TonyMu-4025 avatar image
0 Votes"
TonyMu-4025 asked TonyMu-4025 commented

Remove Messageclass from exchange server 2016

Hi Guys
I think through this link: https://eightwone.com/2013/05/16/removing-messages-by-message-class-from-mailbox/, to remove exchange 2016 inside for the IPM. Note. EnterpriseVault. Shortcut ", but the script in my exchange 2016 cannot run, how should I modify the script, thanks

office-exchange-server-dev
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

GlenScales-6756 avatar image
0 Votes"
GlenScales-6756 answered TonyMu-4025 commented

Because its a script from an untrusted source (which is basically anything that you didn't create yourself) you will need to probably unblock it (right click the script see https://social.technet.microsoft.com/wiki/contents/articles/38496.unblock-downloaded-powershell-scripts.aspx ) and potential change your execution policy https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-executionpolicy.

Its important when you post something to always include the actual error (drop in a screen shot if that is easier) that assists anybody trying to help

· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks you reply,Follow the link provided and execute the script again. The following error is reported
85910-exh01.jpg


1 Vote 1 ·
exh01.jpg (38.7 KiB)

So Autodiscover is failing that could be one of two reasons the first is to do with you DNS config the Author of the script included a Server parameter that will allow you to work around this issue so try using the -Server with the Exchange CAS ServerName which should bypass Autodiscover eg

-Server YouExchangeCasServerName

The other reason it could be failing is due to the credentials so if you use the above and then see a 401 issue try using the downlevel credentials format (if you aren't already) eg domain\username rather then the UPN (or vice versa)

0 Votes 0 ·

Thanks
According to what you said, there is still an error

[1]: /answers/storage/attachments/86645-exh02.jpg

0 Votes 0 ·
exh02.jpg (53.6 KiB)
Show more comments