Quicktips
-
Azure Stack Hub tenant portal missing resource types & properties
Quick tip: Another day in the life of a Cloud Operator Got a call from a user who was in the Azure Stack tenant portal and could access some resource types but not others and when in those resources blades the info was all weird (technical termâŚ) as shown below: I thought it was a cache/auth issue, so I asked the user to open a new browser and try again. -
Rename VMs in cluster to match SCVMM naming
Another one from the vaults: If youâve been using Hyper-V clusters with SCVMM, youâll probably notice the cluster resources named a specific way when the VM role is made highly available with SCVMM. example shown below: Now if youâre a bit of a nutter like me, and canât stand the cluster roles that donât have the âSCVMM Resourcesâ naming convention, then the below will update the names to match the SCVMM convention. -
Adventures of a Cloud Operator: Setup your Cloud Operator environment - Quick Tip!
Quick tip for all potential Azure Stack Cloud Operators As youâd be aware, essentially the majority of the Azure Stack extended setup requires PowerShell. Not only does managing Azure Stack require PowerShell, it requires specific modules, tools and PowerShell profiles⌠Oh, did I mention Azure Stack management requires PowerShell? This is typically fine, but if youâre anything like me and tend to use your computer (desktop/laptop etc) for many different functions, managing PowerShell profiles and having them all aligned can be a bit of a pain. -
SCVMM Host Not Responding. Error 2912â WinRM & The request is not supported (0x80070032)
Quick and dirty answer â Windows Updates relating to CredSSP updates for CVE-2018-0886 The fun story time answer Iâve seen this one a few times now so thought it best to share with you all as many clients have gone around and around in circles with this one. The typical story is usually after some sort of maintenance, update cycle, VMM server rebuild or (as was todayâs case) an upgrade to SCVMM 1807⌠Upon restarting VMM many of the hosts go in to a Not Responding state. -
Installing Azure Site Recovery Agent (i.e. running an exe/script) on a Hyper-V host using SCVMM
From time to time I have the requirement to deploy/update a basic app or run a script on my Hyper-V hosts. This is relatively simple using remote PS session or if you have SCCM managing your fleet. But sometimes you need to just push something out fast and luckily SCVMM can assist. My use case is to run an update for the Microsoft Site Recovery Services Agent on my hosts. I would do this periodically. -
Azure Application Gateway with WAP and HTTPS using PowerShell
So over the last year or so Iâve had a lot of fun extending client environments to Azure. One of the methods Iâve used has been leveraging Azure Application Gateway (AAG) with Web Application Firewall (WAF) to protect these services. The AAGâs with WAF have been a very fast and cost effective way for clients to deploy fast and protected services to Azure without the requirement for expensive 3rd-party WAF appliance licenses. -
Unable to delete duplicate cluster resource for Hyper-V VM
Quick tip: You find yourself with duplicate HA roles for a virtual machine and youâre unable delete the problematic resource⌠Symptoms: Duplicate cluster roles for a virtual machine. When attempting to delete, you get the error: Error code: 0x8007012f The file cannot be opened because it is in the process of being deleted. Firstly, why does this happen? This can happen if an admin uses Failover Cluster Manager (even after theyâve been specifically instructed many times not too) to enable HA for a VM, then goes to SCVMM and uses the Migrate Virtual Machine and enable HA. -
SMA Runbook to set VM custom property... (or run PS script)
A word⌠Having worked with many clients over the years, the commonality between many of them an under-utilization of automation. Even the biggest of Microsoft shops fall short when it comes to automation, regularly being confused about the options they have and often fear of introducing a new tool to their organisation. As a Hyper-V data center operator, I leverage automation as often as I can. This has been a concept we have tried to foster since the days of having scores of scripts triggered from scheduled tasks⌠-
Light up your Hyper-V Datacenter in minutes with OMS
In a recent project, the management were keen to see some dashboards and insights into their organizations shiny new infrastructure. Whilst SCOM gives some great data and statistics, itâs not overly helpful in demonstrating the high level view to management out of the box. This is where Microsoft Operations Management Suite (OMS)Â steps in.. Background: This engagement included a new Hyper-converged platform (Hyper-V and Storage Spaces Direct) managed and monitoring with System Center (SCVMM and SCOM), so we had a great foundation to light up OMS and some chosen solutions. -
Quick tip - Disabling ISO Media Sharing in SCVMM
Hello there! I often get asked if itâs possible to disable VMM users from âsharingâ ISOâs from the library when attaching to a VM. You can do this via applying a pre-configured Capability Profile and the Cloud and Virtual Machines. Note: Capability Profiles can only be assigned to Clouds, not to Host Groups Create a Capability Profile Name that means something to you Tip: In the capabilities we can scope the settings or range of many items within the profile. -
Managing a Hyper-V Datacenterâ Converged Networking and RDMA
Server 2016 brings great new feature called Switch Embedded Teaming (SET). A great overview of SET can be found in this TechNet article. But to summarize, SET basically allows a Virtual Network Adapter to access the features available by RDMA. I wonât go into too much detail on RDMA, there are essentially three types RoCE, iWarp and Infiniband. RoCE is the most common and requires that Datacenter Bridging (DCB) be enabled on your switches as well as the windows feature with the same name being installed. -
Managing a Hyper-V Datacenter - Extra thoughts & tuning
I will add to this post over time with anything I can recall that has helped in the tuning of the many environments Iâve worked on⌠Edited: 30/11 - Thoughts on Dynamic Optimization Before I continue, as usual Iâll try not to repeat what you can already find out there, so here are some tips that have been helpful over the years. Be sure to investigate whether each of the tips mentioned are valid for your version of hypervisor as a couple of these posts have aged: -
Managing a Hyper-V Datacenter - Host Networking - Teaming
There are many discussion topics around host networking that need to be considered. I will extend this post over time to include what I can, but many of these are dependent on your requirements. Some of the considerations include: Teaming options (this post) Converged design QoS policies SDN architecture Security & Edge Networking Switch high availability VMQâs and RSS Teaming options Typically when discussion teaming options we need to determine our teaming mode and the algorithm used. -
Quick tip: Add second NIC to ARM VM using PowerShell
This is one I use regularly, so thought it might come in handy for you.. Assumption here is you are connected via PowerShell to your intended subscription.. A few key points: The VM will need to be stopped to execute Check the Azure VM sizing to see how many NICs you can attach I have a pre-created Network Interface with my desired settings #Using OGV to target your objects $RG = Get-AzureRmResourceGroup | ogv -PassThru $NIC = Get-AzureRmNetworkInterface | ogv -PassThru $VM = Get-AzureRmVm | ogv -PassThru #The actual adding of the NIC to the VM $VM = Add-AzureRmVMNetworkInterface -VM $VM -Id $NIC. -
Export DHCP and import Reverse DNS zones using PowerShell
Had a fun one for a client recently whereby they were standing up some new DNS servers for a segment of their network. The forward lookup zones were very easy, import csv and PowerShell them in without much fuss at all.. Next came the Reverse DNS Zones. Now letâs just say that their documentation wasnât as up-to-date as it could have been, so the fun began when trying to go about importing them without having a reliable source of truth to go by. -
SMA Runbook: SCVMM Logical Networks into HP OneView
This SMA Runbook will add any new or missing logical network definitions (i.e. VLANâs) in SCVMM and to HP OneView appliance. As well as having a âworking SMA deploymentâ, the prerequisites for this Runbook are 5 SMA Variables (Assets) which are: VMMServer HPOneViewAppliance HPOneViewUsername HPOneViewPassword HPOneViewLoginDomain We use Active Directory to authenticate to our OneView. If you use local credentials you can remove this from the Runbook or set the variable to âLocalâ. -
Expose the Azure Stack TP3 Portal through NAT
Another quick one! :D For those playing with the Azure Stack TP3 POC deployment that want to make the portal available without having to logon to the console VM. This extends on from the work Ruud Borst did for TP2.. I suggest you read the full article which can be found here: https://azurestack.blog/2016/12/expose-portal-azurestack-through-nat/ Same rules apply around the certificate etc. Let me know if I have missed any ports. Enjoy! Dan -
Add networks to HP OneView 3.00 using REST API via PowerShell
I recently had the task of creating a PowerShell script to call REST API for adding Networks to an uplink set in HP OneView. A quick overview of the environment. Our enclosures have 4x FlexFabrics, 2 used to plumb an access port to the LOMs and 2 used as trunks to create the Virtual Switch teams. The vSwitch uplink sets are labelled Switch_A and Switch_B Each Vlan we connect is plumbed to each switch and named accordingly. -
Create empty custom Management Pack from SCOM via PowerShell
Found this one in my toolkit recently and thought Iâd share. Itâs a little old so the code could do with some optimizing.. What it does: Prompts the script runner for a client number and then asks them to confirm the name for new management pack. If the operator types âyesâ (highly sophisticated coding) then a new management pack will be created with the desired naming convention Our naming convention in this particular environment is to have all 3 client numbers at the beginning of the management pack name. -
Create empty overrides Management Pack for SCOM via PowerShell
Along the same line as this post, the below will create an empty overrides management pack based on a source management pack and client number These are meant for the SCOM operators to use for consistent management pack naming. Enjoy Dan! $ManagementServer = "SCOM01" $orgmanagementpackname = read-host "Enter Search Criteria" ### # Find the managementpacks which fit the filter documented in $orgmanagementpackname ### $managementpackslist = Get-SCOMManagementPack -ComputerName $ManagementServer |where{$.DisplayName -like "$orgManagementPackName" -and $. -
Disable all alerts for a SCOM management pack using PowerShell
So use this wisely⌠This script will use Out-Gridview to prompt the operator for the management pack to disable the alerts for and the override management pack to save those overrides in. Enjoy! Dan First, the script to do this for all monitors: Import-module operationsmanager $SCOMServer = "<SCOMServerName>" New-SCOMManagementGroupConnection -ComputerName $SCOMServer $MPSource = get-scommanagementpack -ComputerName $SCOMServer | where {$.Sealed -eq $True} | Out-GridView -Title "Select a single SOURCE Management Pack" -PassThru $MPOverride = get-scommanagementpack -ComputerName $SCOMServer | where {$. -
SCVMM and Datastores
Was cleaning out some old PS scripts recently and found this one in my toolkit. This one will appease some of those out there who came to Hyper-V from another virtualization technology and are familiar with the term datastore⌠We use SOFS storage so our VM paths are all SMB shares but Iâve included the CSV path split for those still running CSVâs to the nodes. What this gives you is a quick view into which storage device each VM lives on: -
Create empty Management Pack from SCOM via PowerShell
Found this one in my toolkit recently and thought Iâd share. Itâs a little old so the code could do with some optimizing.. What it does: Prompts the script runner for a client number and then asks them to confirm the name for new management pack. If the operator types âyesâ (highly sophisticated coding) then a new management pack will be created with the desired naming convention Our naming convention in this particular environment is to have all 3 client numbers at the beginning of the management pack name. -
Updating uri's for HA WAP deployment via PowerShell
Another quick one, just to shareâŚ. :) For a HA WAP deployment you will need to update each service of the pertinent url to ensure they are using the NLB endpoint rather than going direct to one of the servers.. This is one that catches a few people out when deploying a HA WAP environment. Bitâs of the below are scribed from other sources (they escape me right now so apologies for the lack of a references) but found that they didnât work. -
Applying updates (cab & msu) by batch file
Another one from my toolkit.. Basically run this batch file from a folder with the required update files and it will install them all. Once it is finished it will prompt for any input to restart the server. Enjoy! Dan @ECHO OFF SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION FOR /R "%~dp0" %%A IN (-KB.msu) DO ( CALL :SUB %%~nA ECHO= Installing KB!KB_NUM! >NUL TIMEOUT /t 3 WUSA "%%A" /quiet /norestart) ECHO= == Press any key to restart == >NUL PAUSE SHUTDOWN. -
SCVMM DataSize Property
Quick Tip!! So I was asked to create a custom property that gives a quick overview of the total size for the virtual disks on a VM So, leveraging of my DataStore script, I came up with the below.. Enjoy Note: This assumes you have created your custom property already $VMS = Get-scvirtualmachine Foreach ($VM in $VMS) { $DZ = $null $dzprop = Get-SCCustomProperty -Name Datasize $DataSize = Get-SCCustomPropertyValue -CustomProperty $dzprop -InputObject $VM IF ($DataSize. -
PowerShell Tools â Create an ISO
Brilliant little tool Hrisan Dzhankardashliyski at Powershell.com http://powershell.com/cs/media/p/49052.aspx Edit: updated the script block to enable copy & paste :D
Author: Hrisan Dzhankardashliyski # Date: 20/05/2015 # Inspiration from # # http://blogs.msdn.com/b/opticalstorage/archive/2010/08/13/writing-optical-discs-using-imapi-2-in-powershell.aspx</a> # # and # # http://tools.start-automating.com/Install-ExportISOCommand/</a> # # with help from # # http://stackoverflow.com/a/9802807/223837</a> $InputFolder = "" function WriteIStreamToFile([__ComObject] $istream, [string] $fileName) { # NOTE: We cannot use [System.Runtime.InteropServices.ComTypes.IStream], # since PowerShell apparently cannot convert an IStream COM object to this # Powershell type.
-
Quick migrate multiple VM's using PowerShell
As users of System Center Virtual Machine Manager would know, trying to quickly live migrate multiple VMâs can be a slow and tedious task. Whilst I always recommend to user of VMM to use the Migrate Virtual Machine function or the Start Maintenance Mode options, sometimes I need to react quickly and the normal VMM way isnât fast enough. This is where PowerShell comes in⌠$VMS = Get-SCVirtualMachine | ogv -passthru $VMHost = Get-SCVMHost | ogv -passthru ForEach ($VM in $VMS) { Move-SCVirtualMachine -VM $VM -VMHost $VMHost -HighlyAvailable $true -RunAsynchronously -UseDiffDiskOptimization } Hope this helps! -
Install Windows Features in Bulk with PowerShell
Quick Tip: Install Windows Features with PowerShell in bulk Using my current favourite PowerShell feature, Out-GridView, we can easily and quickly install windows features with a little gui.. The command: Get-WindowsFeature | Out-GridView âpassthru | Install-WindowsFeature You will get an ogv window with the ability to select items to âpassthruâ Select a single or multiple item (via ctrl + click) and hit OK. When done, all your new features will be installed. -
Set Agent Proxy Default setting - SCOM 2012 R2
Run this on any server that has the SCOM Console installed. add-pssnapin "Microsoft.EnterpriseManagement.OperationsManager.Client"; new-managementGroupConnection -ConnectionString:scomserver.domain.com; set-location "OperationsManagerMonitoring::"; Set-DefaultSetting -Name HealthService\ProxyingEnabled -Value True Totally stole this from the SCOM aficionado - Kevin Holman. His post is here Cheersâ Dan -
Windows Azure Pack - change web sites default domain - Web Sites v2 update rollup 4
I recently had a POC WAP environment where the client wanted the web sites default domain changed. Ordinarily you canât do this through the web ui nor is it recommended.. But that does not mean itâs not possible.. As the title suggests, this change applies to Windows Azure Pack Web Sites Version 2 - Update Rollup 4. More info found here - http://support.microsoft.com/kb/2992029 Firstly, take a look at the config: -
SCOM 2012 R2 - Enable Agent Proxy
Just a quick note on how to enable agent proxy via PowerShell Assumptions in this scenario: SCOM 2012 R2 - UR3 Using Operations Manager Shell You want all Agents with proxy enabled Some basics: Get-SCOMAgent Letâs limit our scope.. Get-SCOMAgent | where {$.ProxyingEnabled -match $False} Letâs enable the proxy for all listed agents Get-SCOMAgent | where {$.ProxyingEnabled -match $False} | Enable-SCOMAgentProxy Check the Agents again.. Get-SCOMAgent | where {$_.ProxyingEnabled -match $False} -
MDT 2013 - Windows 8.1 & disable Hibernation
Disabling hibernation is simple enough (âpowercfg.exe -h offâ) but how would we do this in MDT. As with all things MDT, there is often more multiple ways to achieve the same goal. The two methods I would use are by the modifying the unattend.xml as described here or using a command line step in the deployment sequence. A recent MDT project found the clients needs were more aligned with the task sequence step option. -
Powershell script to set speaker volume
On a recent MDT project the client requested to finish all builds with volume set at 30%. Being committed to doing everything in Powershell, I jumped on the book of knowledge looking for some inspiration. As luck would have it, I found this response from knuckle-dragger that performed the complete task perfectly for me. Below is the PowerShell script that meets my clients âneedâ⌠Function Set-Speaker($Volume){ $wshShell = new-object -com wscript.