Powershell : A simple use of DSC

I’m a great PowerShell fan, I think it’s the second best (or maybe first one) thing Microsoft bring to IT world – for me still the one and best is MS Exchange.
Some time ago MS introduced a thing called Desired State Configuration, as I’m correct it was with PS 3.0, for sure with PS 4.0.
You can read a lot of DSC just to google it or go to MS site. I won’t explain how DSC works and what is the pull server, how to enforce configuration compliance, etc …

For my compliance I’m using SCCM, however I found Powershell DSC really useful for my initial server configuration, so I’d like to share how easy and handy is to build some initial server configurations – “Make it smart, make it simpe” – from this starting point one can go wherever … sky is the limit 🙂 Continue reading

Case Study : Windows 2012 R2 – ping internally returns wrong IP on multihomed server

As system engineer I’m providing a 3rd level support in IT areas I work on. So one day a strange case came to me.  An issue was reported that on multi-homed Windows 2012 R2 server – this case was : 2 network interfaces on Windows 2012 R2 (I can imagine it can happen on 2+ network interfaces Windows 2008 or newer). So on mutlihomed Windows Server 2012 R2, when try to ping internally FQDN wrong IP is returned. Continue reading

vRealize Orchestrator : Find network card by MAC

In this post I’ll focus mostly on code for creating simple vRO action to find a virtual machine network card by its MAC address. A use case for me was to set and IP address on VM with multiple network cards or delete a network card with specific MAC address. So instead of creating a new workflow I decided to create an action. Continue reading

Windows Server 2012 – WinRM Corrupt or Missing – in case you want to be too secure

Recently when I tried to add some features in Windows 2012 R2 using server manager I received this error : Failed to open the runspace pool. The Server Manager WinRM plug-in might be corrupted or missing.

I started to search for help and one of the posts I found was http://www.lukebrowning.com/sysadmin/windows/windows-server-2012-winrm-corrupt-or-missing/ – so maybe solution presented there is working – I don’t know for me it’s not. Continue reading

vRealize Orchestrator – Workflow to change DRS setting to default on single VM

In the post vRealize Orchestrator – Workflow to change DRS setting to default on single VM I presented the workflow to change DRS to manual on single VM. Now it’s the time to change this setting back to the default one, as it was. So to do this it’s quite easy to make a copy of previously create workflow.

And just edit the code of “Scriptable task”, because input parameter and attributes remain the same as in workflow described in previous post. Continue reading

vRealize Orchestrator – Workflow to change DRS setting to manual on single VM

Multiple times in multiple workflows, I needed to have VM not being migrated during the workflow run. Easiest way is to disable DRS on the VM. Well, it seems that DRS setting does not belong to VirtualMachine object, DRS settings is part of the ESX Cluster object. We’re still able to to set setting individually per VM, however it has to be set on ESX Cluster level not on the VM itself. I was pretty sure, that there built-in vRO workflows for such simple setting … However, it’s not. That’s what VMWare offers by default

  • Add DRS virtual machine
  • Add virtual machines to DRS group
  • Create cluster
  • Delete cluster
  • Disable DRS on cluster
  • Disable HA on cluster
  • Enable DRS on cluster
  • Enable HA on cluster
  • Remove virtual machine DRS group from cluster
  • Remove virtual machines from DRS group
  • Rename cluster

If there is a need and there is no solution – it has to be created.

Continue reading

VMware vCO – cloning VM, using cluster name instead of host and getting less used datastore of chosen host. – Part 2.

In the Part1 I have created a vCO workflow to get an ESX host from provided ESX Cluster name to pass it to the cloneVM action in vCO.
So now is time to get less used datastore of this host as another parameter for the cloneVM action. My workflow looks like this
GetLessUsedDatastoreOfHost
Continue reading

VMware vCO – cloning VM, using cluster name instead of host and getting less used datastore of chosen host. – Part 1.

Like I wrote in one of my previous host I’m currently playing with VMware Orchestrator. We’re working on full automated VM deployment, where one of the actions is cloneVM task.Some of the input values for this action are host and datastore. One can define this values as fixed ones in vCO, but what going on when in ones environment there is more than one cluster in vCenter. What I did, I created few simple workflows to find the ESX host of provided vCenter cluster name and then a workflow which finds less used datastore of this cluster. I was lucky, because I had an Orchestrator product consultant who showed me how to do this properly (according to the best practices). Continue reading

How to downlaod files from the web (through proxy) using powershell

Today I had to download around 900 files from ftp server, however firewall was blocking almost everything, however I was able to access the FTP server via web browser (I used one and only IE :)). So a colleague advised me to use wget to download the files, but I’m a kind of MS guy and I’m not get used to using wget, so I decided to use powershell. So I’d like to present you how easy it is to download the files using powershell (I’m  using v.2). Continue reading