PowerShell opensourced woop woop

You might have noticed on twitter and other media that now PowerShell has been released as open source and also available not only for your windows environment but also now for Linux and OS X 🙂

The release is available on Github and go there to get your preferred package for your OS! Read the instructions and be aware that this is the first step and the packages for the non-windows is in alpha!

I have a Mac with OS X and have of course installed it

Screen Shot 2016-08-18 at 16.08.36
Screen Shot 2016-08-18 at 16.09.34

Read some more on Snovers blog post here if you want some more insight in why and how and also some cool demos !

Happy powershelling!!

AWS Cloudwatch – watch out for outdated EC2config

I configured a Windows instance on AWS to start reporting logs and performance counters into their AWS Cloudwatch for centralised overview.

The day after I had started monitoring I found that it was consuming loads of CPU and memory and thus not normal,

Screen Shot 2016-07-14 at 12.01.01

Going into the instance, which took a while as it was so sluggish, I found that the EC2Config service was going berserk and I had to kill it.

Screen Shot 2016-07-14 at 10.53.59

Looking at the properties of the EC2 you can see that it was and far from the version available today.

Screen Shot 2016-07-14 at 11.12.56

So if you want to enable Cloudwatch make sure that you first update the EC2config to be sure that your server will survive the burden of monitoring  ?

Firmware update of NIC makes team go degraded

I have been doing some maintenance on a Hyper-V environment and patching with Windows updates and also firmware for the hardware.

The hosts was Dell R730 with former Broadcom and now Qlogic 10 Gbit NIC´s. There are 4 10 Gbit NIC´s on every host and they are set up with one team for management and one team for VM´s.

I have done firmware update before but now there was a new version that I wanted to apply.

It tock a while before I realised that the NIC`s had changed name and thus that was why the teams was degraded, we had some discussions and the Networking guy checked his configuration more than once and we also verified the cabling on the server and then after a while I realised that the NIC actually had changed name and once adding the correct NIC´s to the teams the status changed to normal!

Screen Shot 2016-06-23 at 10.33.14

So when doing maintenece please check the status after updating firmware or the battle with the networking guys can end in misery on your side 😉

Explorations within AWS – Setting ACLs on temporary SSD store for SQL

I have been quite busy lately and not had the time to update the blog so much that I wanted but I will try to add some posts during the summer!

In the project I am right now we are setting up environments in Amazons cloud AWS. I have used their images AMI for a SQL Always On cluster that spans over two nodes.

The AMI is preinstalled with SQL and ready for incorporation in an domain and the Enterprise version can be used with the r3.2xlarge r3.4xlarge and r3.8xlarge.

Screen Shot 2016-07-15 at 23.01.47

As you can see each of them have an SSD instance storage that can be used as a temporary volume which suits SQL tempdb perfectly. Just go into the SQL configuration and point its tempdb to the temporary storage! The MSSQL service account is a domain account without administrative rights on the server so that is why I explicit set the rights for the volume…

As the AWS documentations clearly tells us:

An instance store provides temporary block-level storage for your instance. This storage is located on disks that are physically attached to the host computer. Instance store is ideal for temporary storage of information that changes frequently, such as buffers, caches, scratch data, and other temporary content

You can specify instance store volumes for an instance only when you launch it. The data in an instance store persists only during the lifetime of its associated instance. If an instance reboots (intentionally or unintentionally), data in the instance store persists. However, data in the instance store is lost under the following circumstances:

  • The underlying disk drive fails
  • The instance stops
  • The instance terminates

So I created a small powershell script that runs each time the instance boots to set ACL´s on that volume for the SQL to be able to create its tempdb files. No tempdb files = no sql service running….

And this is set up as a powershell job that triggers on the server booting

Happy AWS´ing!

Howto Expand disk in VirtualBox for mac

I created a new Windows 10 client in my Mac that I have in an assignment and that on VirtualBox. I made it to small of course and when trying to add some stuff with onedrive sync I could not succeed …

So to be able to expand the underlying disk in virtualbox I had to go into terminal mode as this is not part of the gui which of course is okay, so find your vdi file and possible if you are afraid, do a copy of the file before and of course the VM have to be stopped during the expansion.

Using command VBoxManage modifymedium disk  xxxx.vdi –resizebytes  85899345920

Screen Shot 2016-05-27 at 14.12.11

and checking the properties on the virtual disk file I can see that it has been expanded

Screen Shot 2016-05-27 at 14.12.03

after that you boot the VM and go into windows disk settings and expand the partition and you are ready to add files 🙂

Screen Shot 2016-05-27 at 14.13.51

Upgrade to Windows Server 2016 TP5 – Live migrate from TP4

So the day have come when finally the new TP5 bits have been released! And I of course downloaded and wanted to test to upgrade one of my hyper-v servers in my home lab.

Screen Shot 2016-04-27 at 21.53.33

Once installed I tried to migrate a VM from the hyper-v manager at the new TP5 node, I had of course set up kerberos and delegation before but still it gave me an error. To see if it was just in the GUI or also in PowerShell I tried the same move and got the same issue

Screen Shot 2016-04-27 at 23.26.57

So powershell remoting to the rescue to test that I could live migrate my VM´s from the TP4 to the TP5 and that worked nicely. I will dig some more into if there is an issue with the AD objects or what causes this and do an update if I find anything…

Screen Shot 2016-04-27 at 23.27.44

happy testing!


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!