Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Exchange/EWS powershell script help

$
0
0

I have a script that I am modifying from here that checks mailboxes for personal folders that are empty and deletes them. This is to get rid of empty folders left over after our retention policy moves messages to an archive mailbox after they reach a certain age. My Powershell knowledge is limited although I am learning a great deal about it.

My problem/question has to do with this snippet of code:

1.## Get the Mailbox to Access from the 1st commandline argument  
2.  
3.$MailboxName = $args[0]  
4. 
5.## Load Managed API dll    
6.Add-Type -Path "C:\Program Files\Microsoft\Exchange\Web Services\1.2\Microsoft.Exchange.WebServices.dll"    

I'm unsure of what to do with the $args[0] variable. Is it an array that I can use with multiple user mailboxes? If so how do I do this and can it accept input from a file of users? My script works if I omit $args[0] and use $MailboxName = Get-Mailbox -Identity 'user'.

Thanks for any help that you can provide

~Denna


Viewing all articles
Browse latest Browse all 15370

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>