VBScript – Get a Folder/File Size or Verify That a Folder/File Exists

Here are some snippets of VBScript I pieced together from various sources out on the web to be able to find the size of a folder or file or check that a folder or file exists. This is pretty handy because it also works for UNC path names or files and folders out on network shares, as long as your user has permission to access that path. Continue reading “VBScript – Get a Folder/File Size or Verify That a Folder/File Exists”

Batch Script – Get User’s SID One-Liner

While researching a way to try and send files to a user’s Recycle Bin from a batch script, I came across this one liner either at StackExchange or SuperUser forums somewhere. FYI, there is no way natively to send something to the trash without using a VB script or some third party utility. Yes you can physically move the files into the C:\$Recycle.Bin\<UsersSID> folder, but the files will not show up in Explorer and won’t be removed when you empty the trash that way.
Continue reading “Batch Script – Get User’s SID One-Liner”

Exchange Server 2010 – Get a List of Mailboxes by Size

In the Exchange Management Shell, to get a simple list of mailboxes sorted by size, in descending order:

Get-Mailbox | Get-MailboxStatistics | Sort-Object TotalItemSize -descending | ft DisplayName,TotalItemSize -autosize

Now let’s dig a little deeper and show each mailbox’s storage quota limit status and display the total count of email messages as well:

Get-Mailbox | Get-MailboxStatistics | Sort-Object TotalItemSize -descending | ft DisplayName,StorageLimitStatus,ItemCount,TotalItemSize -autosize

Continue reading “Exchange Server 2010 – Get a List of Mailboxes by Size”