POWERSHELL   Powershell – Get-Content error if filename contains brackets

I needed to get the first 5 bytes of a file using the powershell:

PS D:\> Get-Content "D:\TEST\file.txt" -Encoding byte -TotalCount 5

But for some files the Get-Content command returns the following error "A parameter cannot be found that matches parameter name 'Encoding'"

PS D:\Scripting\CORRUPT> Get-Content "D:\TEST\file[1].txt" -Encoding byte -TotalCount 5
Get-Content : A parameter 
Read more

   Exchange 2013 – Exporting/importing mailboxes to a PST via Powershell

Stop using Outlook to export and/or import PST for your mailboxes. By using the Powershell commands (New-MailboxExportRequest and New-MailboxImportRequest) I have saved much time. And they come with some useful options.

Here some simple and interesting examples:

Simple mailbox export

[PS] C:\> New-MailboxImportRequest -Mailbox "user1" -FilePath "\\MYSERVER\PST\user1.pst"

The path must be an UNC path, a shared folder. After executing the … Read more

EXCHANGE   Exchange 2013 – Assign permissions to book room resources

I created some room mailboxes in Exchange 2010 and gave book permissions to some users using EMC (Exchange Management Console).

Now, after migrating all my mailboxes to Exchange 2013, I need to change some permissions on the room mailboxes. But no way to perform the changes in the web console.

The only way to view and modify booking permissions is Read more

POWERSHELL   Powershell – Excel reports automation (I)

Powershell can be very useful to extract data from our systems.
Excel can be very useful to show that data in a friendly way.
Powershell + Excel = Automatic generation of useful reports

These are the basic powershell sentences and functions needed to start generating our Excel reports using Powershell scripts:

Excel COM object

It is neccesary to reference a … Read more