0

Quick Tip–Verify Which Hyper-V VMs Have ISO Mounted

Use PowerShell to Easily Show All Mounted ISO

It’s very common that we mount ISO files when needed, then forget to remove them after the fact.

This is generally a non issue until you want to move the mounted ISO file as Hyper-V may have a lock on the file.  Yes we could open up the properties of each VM in the console, but nope.  Not doing that.

Rather than search VMs one by one to see which is the offending VM, just run the below command in Po… Read the rest “Quick Tip–Verify Which Hyper-V VMs Have ISO Mounted”

0

QuickTip – PowerShell Unable To Run MSIEXEC Command Line

PowerShell MSIExec Help File - Command Failed

In this case there was an issue uninstalling the Azure Migrate Mobility Service, but the same principal will apply to running MSIEXEC commands in PowerShell that are not correctly formatted.  The Azure Migrate Mobility Service is a key component used during server replication to Azure. The Mobility Service agent is installed on machines to capture disk information and send it to the Azure Migrate … Read the rest “QuickTip – PowerShell Unable To Run MSIEXEC Command Line”

0

Quick Tip–Verify VHDs Mounted In Hyper-V VMs

Using PowerShell to List All Virtual Hard Disks

If you want to easily view all of the VHD or VHDX files that have been configured on Hyper-V VMs, the below PowerShell command makes this easy.

Since I may use a temporary VHDX as a mechanism to copy files into VMs, it sometimes get left mounted and this makes it easy to see which VM has that particular disk file attached.  Creating a temporary VHDX makes it easier to copy large source files to VMs… Read the rest “Quick Tip–Verify VHDs Mounted In Hyper-V VMs”

0

Quick Tip – Easily Allow JIT to Azure VMs In A Resource Group

Azure Portal Connect to VM

Controlling connections to Azure VMs using the just in time (JIT) policy of Microsoft Defender for Cloud (MDC) certainly improves the overall security of the Azure resource.  However, then having to enable JIT on a given VM runs into issues pretty quickly.

Azure Portal Too Permissive

Who thought it was a great idea to have “All configured IPs” as the default option? No thanks – I do not want to enab… Read the rest “Quick Tip – Easily Allow JIT to Azure VMs In A Resource Group”

0

Quick Tip – Easily Start All Azure VMs In A Particular Resource Group

Quick Tip Easily Start Azure VMs Using Azure Cloud Shell

Manually starting up lab VMs is painfully slow, and since many organisations will implement management policy to auutomatically shut them down to save costs you may find yourself powering them on a lot...

While you can set up automated tasks to power them on, not all really need to be running every day.  For example, I always want the DC's running so they are able to maintain replication and there … Read the rest “Quick Tip – Easily Start All Azure VMs In A Particular Resource Group”

0

Ghost In The (Power)Shell

Exchange PowerShell Output - Not What Was Expected

After taking an existing Exchange PowerShell script, and running on a newer version of Exchange, the output was not as expected.    This is a pretty simple script that just iterates through all of the Exchange virtual directories and writes the output to the screen.  Yes it uses Write-Host and some consider that to be evil.  Others say "Friends do not let Friends use Write-Host".  Oh well. This is… Read the rest “Ghost In The (Power)Shell”

3

Unable To Install PowerShell Modules – Unable To Download From URI Error

When you try to install a PowerShell module or connect to the PowerShell Repository you may get the below error messages:

WARNING: Unable to download from URI 'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409' to ''.
WARNING: Unable to download the list of available providers. Check your internet connection.

PowerShell Error - Unable to download from URI

For make most glorious benefit engine of search:

PackageManagement\Install-PackagRead the rest “Unable To Install PowerShell Modules – Unable To Download From URI Error”

0

Quick Tip – Get Unique Instances In PowerShell

To remove duplicates using PowerShell is exceedingly straightfroward.  However, I have a habit of forgetting the cmdlet so parking this here for future reference.

For example, we can use the Get-Unique cmdlet or  Select-Object -Unique parameter.

 

Get-Unique

As  a simple example:

 

The Get-Unique cmdlet compares each item in a sorted list to the next item, eliminates duplicates, and returns only… Read the rest “Quick Tip – Get Unique Instances In PowerShell”

1

Checking Exchange SMTP Logs To Determine Usage

This week I was fortunate to return to one of my favourite customers, to help with Exchange 2010 migration activities.  As we all know, Exchange 2010 will exit out of extended support on the 14th of January 2020.

Fortunately they are progressing very well with moving all mailboxes off Exchange 2010, and one of the last remaining items was to review SMTP mail flow through the Exchange 2010 Hub trans… Read the rest “Checking Exchange SMTP Logs To Determine Usage”

7

Easy Way To Retrieve Certificate Thumbprint Using PowerShell

Since many certificate operations involve knowing the certificate’s thumbprint, it is always useful to to have an easy way to get this information.  In some of the online documentation it mentions you can copy the thumbprint out of the Certificate MMC snap-in and then manually delete the spaces between the data.  No thanks.

However, if you *really* want to do that, or a quick and easy way to launch… Read the rest “Easy Way To Retrieve Certificate Thumbprint Using PowerShell”