Posts

Showing posts with the label PowerShell

How-to: Create a Silent Installer with AutoHotkey and Publish it on Chocolatey

Image
Supposed there is a portable Windows application without an installer and uninstaller, how to create them back? In today's post, we will explore one way to build a  Setup.exe  using AutoHotkey (AHK), with additional compression of 7-Zip applied to the  Setup.exe  and remaining files of the portable application for maximum compression, and then wrap it with an outer unattended installer, turning a portable application into an installable one while being suitable also for silent deployment. The application example, i.e. the application for which a setup is created is  AeroZoom . While some terminologies are specific to AeroZoom, the general concepts should apply to other software. // ⭐1️⃣ to be built: outer unattended installer written in AHK AeroZoom_Unattended_Installer.exe │ │ // 2️⃣ to be built: 7-Zip self-extracting archive │ └───AeroZoom_7-Zip_SFX.exe │ ├───AeroZoom // portable app example │ ...

Tip-Packed Gem from Microsoft Ignite 2018 – Windows Life Hacks

Image
I came across this top session, 45 Life Hacks in 45 Minutes, from Microsoft Ignite 2018 which I consider to be a gem to Windows enthusiasts. It is packed with useful Windows techniques, many of which are advanced while practical. This blog post merely summarizes the interesting tips from the session as an entry point – to experience the amazingness of the live demos, please go watch the recorded session on YouTube and look for other works by Sami Laiho from whom I learned a lot. 1. Exit Explorer Windows 10/2016 Right-click taskbar > Exit Explorer Windows 8/2012 Press Alt+F4 to bring up shutdown dialog. Next, while holding Ctrl+Shift+Alt, click Cancel 2. Violate a Group Policy which e.g. only allows running IE, but not Command Prompt or others In Task Manager > Run New Task It always open a Command Prompt 3. Redo old commands from history without typing again F7 hotkey History of Command Prompt or PowerShell 4. Tab auto completi...

Storage Failover and Failback PowerShell Scripts for Failover Cluster (e.g. Hyper-V) with an Interactive Console Menu

Image
Note: This is a template to ease development. The storage-vendor-specific part of the scripts have to be coded by yourself. An alternative way is to engage professionals to develop the script on one of the freelancing platforms . There sometimes comes a need to simplify complex operations, in this case failover and failback operations of SAN storage replication between sites (e.g. production and DR), for reasons such as letting operators or the less technically-confident colleagues to more easily perform the operations in case of disasters or drill tests. To achieve that, this template has been created. Written primarily in PowerShell, this package contains a set of SAN storage failover and failback scripts for Microsoft Failover Cluster (including Hyper-V cluster) and vendor-neutral pseudo code for SAN storage (for further modification to support different SAN vendors). Not only does it perform storage failover and failback, services running on top of it such as databases and vir...

Exchange 2016 Migration Checklist (with PowerShell Examples)

Image
Recently, I have been working on Exchange migration projects and the “ 70-345 – Designing and Deploying Microsoft Exchange Server 2016 ” exam. (Yes. I have passed the exam, thankfully, and I am now a certified MCSE of the Productivity track.) I have found video lessons on Pluralsight to be of great help, such as this one . Based on studies, a checklist including PowerShell commands has been crafted in the hopes of easily keeping track of milestones throughout similar projects. Except where noted, the example is for non-HA migration scenario from Exchange 2010 and 2013 to 2016. (This document is also available on GitHub as “ exchange-2016-migration-checklist.md ”). Need a Pluralsight referral code? Here's my referral URL: http://referral.pluralsight.com/mQgdSmZ for a discount (up to 50%) in Pluralsight registration (Last updated: 16 April 2020) Inventorying Existing Environment List existing Exchange servers in the environment Get-ExchangeServer | ft Name, Edition, Adm...

Exchange 2013/16 Journal Mailbox Archive-to-PST PowerShell Script Automation with Reporting

Image
Recent Exchange versions have built-in support of journaling for recording all inbound and outbound email messages for backup or compliance reasons. Overtime, the journal mailbox grows so large and needs to be trimmed or pruned. This script was written to automate the process. This article documents a PowerShell maintenance script I have written for reporting and automating a monthly archive-to-PST process of the Exchange 2013 journaling mailbox. (Based on reader feedback, it also suits Exchange 2016 Standard.) Go to Download Archiving Concept This script uses the PowerShell cmdlet New-MailboxExportRequest -Mailbox to export Exchange Journaling Mailbox of previous month (e.g. 2016-01-01 to 2016-01-31) as a standard PST file (e.g. archive 2016_01_31.pst) to specified locations (up to two locations) and then uses Search-Mailbox -DeleteContent to delete email messages within the date range if successful. It is designed to be run at the beginning of each month (e.g. 2/Feb/16)...

Script for Booting to Windows PE using HPE iLO PowerShell Cmdlets

Image
This blog post documents the HP/HPE iLO PowerShell commands I used for scripting the process of booting to Windows PE for purposes such as using Microsoft SCCM (System Center Configuration Manager) and/or SCO (System Center Orchestrator) runbooks for automated operating system deployment. Thanks to Kyle Murley's blog post which led me to this. Prerequisites HP iLO Cmdlets for Windows PowerShell (x86/x64) - http://www.hp.com/go/powershell (v1.3 as of this moment). HP iLO Server with Advanced iLO License. (Already required by the first Mount-HPiLOVirtualMedia command) - This post is based on iLO4, but it might also work for iLO3 or others. Kindly let me know if it does for you. Web server (e.g. Microsoft IIS) for hosting the Windows PE ISO file (as required by ImageURL parameter). [Optional] Sysinternals Process Monitor for monitoring the download of Windows PE ISO file from the web server. [Optional] HP Scripting Tools for Windows PowerShell User Guide (Also, I found the built...