Compress a Folder With a little bit of help from .NET Framework

Few weeks ago I needed to free some space form a disk on a Windows Server 20012 R2, so I wanted to compress a large number folders, each one of them contained few hundred MB of log files.  It required to preserve the folder name and deleting or moving the files or directory from that volume/partition was not an option.

It’s an easy task with PowerShell“, I thought, “I can re-use one of my functions or scripts“.

In fact, few months ago I’ve published an article on how to compress a folder, but to re-use that specific code on that environment I needed to install 7zip (which in this specific case I tried to avoid), because the cmd-let Compress-Archive was released with version 5 and the server is using PowerShell 4.  So I needed to revisit my script that wasn’t ready to go and solve my problem without a little tweak. Continue reading “Compress a Folder With a little bit of help from .NET Framework”

Automating Document Conversion from Markdown with Pandoc

I’m gradually moving away from reStructuredText (RST) and I use more MarkDown(MD) to write generic documentation.  In fact, I found myself using md files more and more and I really like the approach of focusing on content and let the tool generate a well formatted document according to the type needed.

If MarkDown doesn’t need much introduction the tool I’m using to convert .md is called Pandoc.

Pandoc is a universal document converter and from an MD file can generate multiple output format. It’s  open-source and really simple to use. Continue reading “Automating Document Conversion from Markdown with Pandoc”

Removing a phishing email from all Exchange 2016 mailboxes with PowerShell

Does’t matter how good is your security and design in your environment with with complex spam filters, gateways and appliances… sooner or later you’ll need to remove some sort of unwanted communication from one or more mailboxes on your Exchange Server.

In a very common incident response scenario like this, PowerShell is a very useful tool, this time the cmdlet used is New-ComplianceSearch and is available on-premises and on cloud services for Exchange Server 2016.

Continue reading “Removing a phishing email from all Exchange 2016 mailboxes with PowerShell”