Add Chocolatey to my PackageManagement in Windows 10

I wanted to install the different browsers and also ChefDK on an new Windows 10 client and that with PowerShell. There is of course a way to just run Chocolatey command line but I wanted to use the PackageManagement so I had to add that provider and source so I could just use the Install-Package cmdlet.

I have a Windows 10 1511 with latest patches and I run the following commands to enable the chocolatey repository:

Screen Shot 2016-04-11 at 14.21.17

As you can see, when I enter Find-PackageProvider I find the Chocolatey provider and just run the Install-PackageProvider -Name Chocolatey

Screen Shot 2016-04-11 at 14.25.20

Then I need to open a new PowerShell window and can see that the PackageProvider and PackageSource have the Chocolatey records and thus I can now add software from this,

Screen Shot 2016-04-11 at 14.50.35

First I add Firefox and as you can see my PackageSource is not trusted and I get an warning, that can be configured with the Set-PackageSource -Name chocolatey -Trusted

Screen Shot 2016-04-11 at 14.53.06

Have fun with your package management 🙂

Preview of Azure Site Recovery in the new Azure Portal

Finally the Azure Site Recovery service can be reached from the new Azure Portal and the ARM way of doing things! It has been possible to use ASR with PowerShell and the new ARM way for some months but only for a subset of the site recovery services (VMM/Hyper-V).

Screen Shot 2016-04-05 at 14.33.31

Not a day to soon! I have a customer that we have engaged in the CSP program and as that is based on the new, the old ASR was not possible to use with that subscription and use another subscription just for ASR sucks..

As you can see on the following screendump I go into the “Getting Started” to select scenario and then follow the guide to complete and in the case with physical and VMware I need to install a process/configuration server on-premise.

Screen Shot 2016-04-05 at 14.39.29

Once installed on a Windows 2012 R2 server I connect it to the ASR with the registration file,

Screen Shot 2016-04-04 at 14.00.08

One thing to think about using this service is that the process server will if you do not go in and configure the bandwidth settings eat all available internet capacity as my customer so nicely explained…

Configure this to something that works for both you and the company, and with the enhanced ASR where you do not need additional servers in Azure you find this setting in the backup properties.

Screen Shot 2016-04-04 at 23.00.05

It is quite easy to start and protecting your workloads and remember that the first 30 days are free 🙂

 

updated AzureRM PowerShell Module with Export of Resource Group

Today the version 1.3.0 of AzureRM module was released and in that there was a new cmdlet Export-AzureRMResourceGroup that can be used on an resource group and get a json file from that!

updating your AzureRM is quite easy with the powershell gallery repository

Screen Shot 2016-03-30 at 12.13.19

And then you can run the Export cmdlet and get the json file from that deployment and start playing in Visual Studio or VS Code 🙂

Screen Shot 2016-03-30 at 11.43.21

Have fun automating and deploying with Azure Resource Manager!

powershell env:PSModulepath duplicate records Winserv 2016 TP4

I was testing some xAzure DSC configuration stuff on my Windows Server 2016 TP4 and noticed that when I was trying to use the resource it said that duplicate modules was found but I could not find any in the powershell module libraries and thus it ought to be something else,

I found the tweet that Ben Gelens sent pointing me to the $env:psmodulepath

Screen Shot 2016-03-23 at 22.02.29

So looking in my psmodulepath I could see that I had two records that was the same and that had to be fixed,

Screen Shot 2016-03-23 at 14.48.58

So to remove the duplicate I first remove both and then add the one again:

Screen Shot 2016-03-23 at 14.49.52

$env:PSModulePath = $env:PSModulePath –replace “;C:\\Program Files\\WindowsPowerShell\\Modules”

Screen Shot 2016-03-23 at 14.52.54

$env:PSModulePath = $env:PSModulePath + “;C:\Program Files\WindowsPowerShell\Modules”

Happy automating 🙂

SC VMM bare metal deploy with UEFI enabled host

During last week I was working on some bare metal deployment on some Hyper-V hosts with System Center VMM. We had deployed them before using legacy boot but now we had updated the BIOS to latest version and got into some trouble.. Maybe it was because of the HPE instead of the HP 😉

Screen Shot 2016-03-17 at 11.19.02

During the deployment the WinPE got an error and could not connect to the VMM server,

Screen Shot 2016-03-17 at 13.17.02

We tried to update NIC drivers and stuff on the WinPE image but that did not help. During the testing we started the server and configured it to boot with EFI instead of legacy boot and olala it worked to connect to the VMM server but thus as the Hyper-V VHD was MBR we got the following error:

Screen Shot 2016-03-17 at 15.41.29

The easiest way I could think of right there and then was to create my new GPT based VHD to boot the Hyper-V host with a powershell convert script from the original MBR vhd. The script required to be run on a Hyper-V host so I connected to one of the Hyper-V nodes in the test cluster and ran the script on a patched VM that was sysprepped:

Screen Shot 2016-03-17 at 16.02.48

And once that was done I had to update the Physical profile to set the disk to GPT instead of MBR:

Screen Shot 2016-03-17 at 16.23.23

And now the deployment worked nicely all the way!

 

install-service during bootstrap a windows node with chef knife

I was exploring last week how I could add a managed windows node in my internal test environment where I have a chef server.

Bootstrap a windows node has been possible quite a while but not so long ago the knife windows added the parameter for also setting up the client as a service. This was part of the Knife Windows 1.0 release as you can read on the Chef site.

Screen Shot 2016-03-17 at 08.43.37

Another great parameter now available is the –msi_url that gives the possibility to set the chef client msi path to something local if the servers cannot speak to the mighty Internet

happy chef-ing!

Configure VM Network settings from the host using Hyper-V 2016

Today I used Ravikanth script for configuring an VM´s NIC settings from the host and can confirm that it works nicely also on a Hyper-V Host with 2016 TP4 and a full-GUI VM and also with VM´s running Nanoserver 🙂

There is a cmdlet in the Hyper-V PowerShell module that is named: Set-VMNetworkAdapterFailoverConfiguration although that configures only the nic for the Hyper-V replicated VM and cannot be used on a ordinary vm. So using the function from Ravi I set the VM´s configuration using the Hyper-V WMI virtualization namespace.

Screen Shot 2016-03-01 at 14.53.00

And trying to set it on a Nano server also works nicely

Screen Shot 2016-03-01 at 15.19.58

 

SCVMM Bare-Metal Deploy errors and PXE error 21164

I was working with a customer yesterday and trying out bare-metal deploy of a Image for their Hyper-V servers, and in this case a brand new Dell R730 with nice specs 🙂

During the deployment we got some errors that we had to handle and I wanted to highlight them so that you can handle them if they appear in your environment one day!

First of we had some issues to enable the NIC to respond to PXE but that had more to do with where to find stuff in the bios and iDRAC settings 😉

But once that was fixed we got the following error and I have already mentioned that in a blog post earlier.

Screen Shot 2016-02-25 at 13.09.47

So trying to update the WinPE image got us into some more trouble, as you can see on the following screen dump. This was a new one that I have not seen before, checking the folders I could not find any strange things but…

Screen Shot 2016-02-25 at 15.25.55

I tested to restart the VMM service just in case and the same error appeared and thus I thought that it might go away if I remove and add the PXE server again and yes that worked!

Screen Shot 2016-02-25 at 15.26.05

And after this we were able to deploy a physical servers as a Hyper-V host!

Finally the AzureStack TP1 bits have arrived!

Yesterday the AzureStack TP1 PoC files was released and now you can play around and create your own Azure. Now I just need a decent hardware to run this!

If you have some issues with the requirements my friend Daniel have made a blog about how you can try to install it with less memory!

Shown below is the diagram of the PoC setup and here you can see all the different roles included for your Azure on premises 🙂

image1

On this page you can read more about it and learn how to deploy it to your environment!

Cool Stuff happening!

So 2016 have started and fun stuff will happen in the near future!

Last week me and the family was in the ski mountains Idre and the rest of the family was skiing but I had a achilles tendon rupture in the christmas weekend so I had to be in the cabin most of the time! Although one evening I got to do some sightseeing on the mountain B-)

20160114_190931000_iOS

Pretty amazing stuff going with a large piste caterpillar and seeing the result!

But more importantly what is happening in the near future:

DevOps Hackathon in CopenHagen 20-21/1

I will be one of the proctors on Rasmus Hald´s DevOps Hackathon that will take place in Microsoft´s office in Copenhagen Denmark. During two days we will do workshops in DevOps stuff.

NIC in Oslo 4-5/2

Me and Fredrik will do two sessions on DevOps and automation with Chef/Azure/PowerShell/ARM during the Nordic Infrastructure Conference

Want to join? sign up here and book your flights

TechXAzure Microsoft Sweden 15-16/2

During the two-day event at Microsoft Sweden´s TechXAzure me self and Fredrik Nilsson will talk about AzureStack,OMS,Chef and Azure

Sign up here

DevOps day Microsoft Sweden 24/2

In this one-day event I will be with some MVP friends Jacob and Mathias and also Fredrik Nilsson where the Swedish Devs and Ops will learn how to become DevOps with Microsoft solutions.

Please join us! this one is free!!