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”
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”
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”
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
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”