Azure Automation Hybrid Workers with PowerShell Remoting and Credential Resources

This video is a follow-up to a previous one on Azure Automation with Arc-enabled Hybrid Workers.  Hybrid Workers extend runbooks to a private network, but not every computer needs to be a Hybrid Worker.  In this video, we review using PowerShell Remoting with Hybrid Workers to build idempotent runbooks that target computers inside a private network.  Then we use a shared credential resource to authenticate the runbook in the local environment.  Multiple examples showing how to target other systems with PowerShell from the Hybrid Worker are provided.

Continue reading “Azure Automation Hybrid Workers with PowerShell Remoting and Credential Resources”

Azure Automation Hybrid Worker with Azure Arc Enabled Servers

Azure Arc Automation Hybrid Worker

Azure Automation is not just for Azure!  We can extend it to an on-premises or multi-cloud environment with Hybrid Workers.  This video starts with an introduction to Hybrid Workers and then moves on to installing an Azure Automation Hybrid Worker on Azure Arc enabled severs.  We then test the implementation with a simple runbook.

Continue reading “Azure Automation Hybrid Worker with Azure Arc Enabled Servers”

Use PowerShell to Create a Snapshot Based Image of an Azure Virtual Machine

PowerShell Image Snapshot

This video goes of using the SnapImage.ps1 PowerShell script.  This script automates the process of creating an image from an Azure VM without destroying it during the capture process.  At a high-level, the following steps are taken:

Continue reading “Use PowerShell to Create a Snapshot Based Image of an Azure Virtual Machine”

Git and VS Code for the Lone Scripter

This is where my last two articles, Git for System Admin Scripting and Get Started with Git Remote, come together.  Microsoft’s Visual Studio Code (VS Code) is a powerful and extendable IDE.  VS Code supports Git out of the box.  It also supports many programming and scripting languages with Microsoft and 3rd party extensions.  In this article, I walk through common tasks that we have already covered, only this time with the native Git integration within VS Code.  I also review new functionality with a free 3rd party extension.

Continue reading “Git and VS Code for the Lone Scripter”

Git for System Admin Scripting

Git

I spent most of my time in IT as a system admin, on the “Ops” side of DevOps.  Over the years, I have accumulated many different batch files and scripts of one type or another.  File shares worked well for storing the code I write.  I discovered Git and it’s become my main repository for all script related code.  Recently, I attempted to make a case to other admins for using Git, but failed to make a convincing case.  Below, I lay out my case to why a sysadmin or anyone writing any kind of script should move to Git.  I also outline how I use it in an effort to make my case and help anyone interested in getting started with Git. 

Continue reading “Git for System Admin Scripting”

JSON and ARM Templates

ARM Templates are written with JSON and are at the core of Azure Resource Manager deployments.  I have used and developed templates for months.  Although successful, I ran into issues with formatting and syntax this week and decided to take a step back and get a better understanding of the underlying JSON used in these templates.  In this post, I start from the beginning, exploring JSON as it relates to ARM templates. Continue reading “JSON and ARM Templates”

Writing to the Windows Event Log with PowerShell

Odds are,  you were Googling something like ‘write event log PowerShell’ and you stumbled on this page.  If that’s the case and you just want to write an event to the Event Log to test something like a monitoring or alerting app, I won’t disappoint, below is what you need to know.  If you want a little more information on writing to the Event Log as part of a script, keep going.

Write-eventlog requires 4 parameters, EventID, LogName, Message and Source.  It’s the -Source part that trip people up.  If you don’t know what the source is, simply make one up.  Create the new source with the New-Eventlog command like this:

New-EventLog -LogName <Log you are writing to> -Source ‘Make one up’

For example, Adding the source HAL to the application log looks like this:

New-EventLog -LogName Application -Source ‘HAL’

Continue reading “Writing to the Windows Event Log with PowerShell”