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”
Browse Recent:
VBScript – How to Access Environment Variables -OR- How to Get the Username, Domain, or a User’s SID
Here is a simple example of how to use VBScript to access environment variables, use the variables to obtain a user’s SID, and then print them to the screen. Continue reading “VBScript – How to Access Environment Variables -OR- How to Get the Username, Domain, or a User’s SID”
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”
Exchange Server 2010 – Get a List of Mailboxes by Creation Date
In the Exchange Management Shell, to get a list of mailboxes by creation date in ascending order:
Get-Mailbox -ResultSize unlimited | Sort-Object WhenMailboxCreated | ft Name,WhenMailboxCreated -autosize
Continue reading “Exchange Server 2010 – Get a List of Mailboxes by Creation Date”
Exchange Server 2010 – Get a List of All Mailbox Columns/Attribute Names
To get a list of all available column names or mailbox attributes so you know what values to enter when trying to sort query results with the “Get-Mailbox” command, issue the following in the Exchange Management Shell:
Continue reading “Exchange Server 2010 – Get a List of All Mailbox Columns/Attribute Names”