Hi, Have a client with Exchange 2010 SP1. They want to setup a Policy that will Delete items from all users Deleted Items folder after 45 Days.
So Im going to setup a Retention Policy Tag and then Create a Retention Policy. In testing, it all worked out but I only assigned it to one user. I used the Exchange EMC Console to do this. But it looks like if you want to asign the policy
to All Users then I will have to use the Command Shell.
Is there a way to do it with the EMC Console or do you have to use the Command Shell?
If I have to use the Shell, I saw this command in the forum, Is this the correct command for SP1?
Get-Mailbox | Set-Mailbox –ManagedFolderMailboxPolicy 'MailboxPolicyName'
Get-User | Where-Object {$_.RecipientType -eq "UserMailbox"}| Set-Mailbox -ManagedFolderMailboxPolicy "MailboxPolicyName"
If that is correct, the next problem is what about new users? From some posts ive read if you create a new user then you have to asign the policy to the new user. One person suggested having a command run in Windows Task Scheduler once a week.
Is this Command correct for this with Exchange 2010 SP1?
Get-Mailbox -filter {RetentionPolicy -eq $null} | Set-Mailbox -RetentionPolicyretentionpolicyname -force
If so, how do you create a script? Im new to Power Shell so how do you setup that command in a script. Im assuming open a text editor and paste that command in there. Do you save the script as a PS1 extension?
Also how do you tell the script to use Exchange management shell to run the command?
Im sure the last questions are somewhere in the forum, but havent had time to look yet.
Sorry for asking so many questions, but I get confused with Commands, such as why do I use Get-mailbox one time and Get-User another time, then one time you use Where-Object and the other you use -filter.
Thanks
Mike