Skip to main content

Posts

Showing posts from 2016

Giving a helping hand - Community power

PowerShell is getting increasing attention and gaining followers each day. That is a good thing in my book. I saw a tweet about Citrix OctoBlu automation where Dave Brett ( @dbretty ) was using it to save money with a PowerShell script ( full post here ) to power on and off VMs. I reached out to him and asked if he would like a little help with his PowerShell script. To my delight, he happily accepted and this post is about how I transformed his scripts to take advantage of the full power of The Shell. Fair warning is in order, since I have never used or touched a OctoBlu solution. Starting scripts ( shutdownScript.ps1 ) ( StartupScript.ps1 ) What we would like to change First of, a PowerShell function should do one thing and do it well. My first goal was to split the function into two parts where we have one function that handles both the startup and the shutdown of the VM-guests. Secondly I would like to move the mail notification out of the function and ...

Ignite 2016 summary – Innovate, optimize, manage and empower your business with IT

This years Microsoft Ignite conference was all about transforming your business with technology. Here is a techy summary for business-minds. Going forward, IT-Pros must prepare to answer both tricky business questions, and leverage new tools to meet business demands. I imagine questions like these:   What are the needs of our business? How can we empower our users to apply the cloud to gain competitive advantages? How can we innovate with greater agility and optimize our IT resources? How can we migrate from the traditional model where IT is just a cost-center, to a lean/mean machine where IT is the engine that powers our business strategy with increased earnings? A model of the traditional business case We live in a traditional world with traditional problems. Simplified a business consists of a few silos: Internal users Your customers Your suppliers and partners The remainder of the universe All of these are connected directly and indirectly throu...

Windows Server 2016 – DevOps tools and features

I needed to dedicate a full blog post about Windows Server 2016 and the way it will impact you going forward. At some point some of these features will apply to you too, as your infrastructure start to run the new server bits. Here are the highlights from MSignite. > Highlights Installation Development Packaging and deployment Configuration Containers Operation Validation and Pester Testing Operating security > Installation Server 2016 comes in three flavors. You have the “Desktop experience” server intended for management of other flavors of 2016 or as a terminal server. Next is Server Core which is just the same full server without the desktop and is headless, intended to be managed from Powershell or from a server using the desktop experience. Then there is the new kid on the block, Nano Server. It is the new Cloud OS, born in the cloud and the workhorse for everyone serious about creating modern, lean, super-fast and easy to manage applications.  ...

Microsoft Ignite 2016 – Announcements and features

I have now spent 3 days at Ignite and walked a total distance of about 22km hustling from sessions and the Expo area according to my Iphone. These are some of my thoughts about what might affect you going forward the next year. Highlights Windows server 2016 Azure Monitoring Azure Functions Azure Networking Oh yeah, and System Center 2016 was launched. Why is it not on my list? Well to be perfectly honest, the feature list is almost identical to the latest rollup on 2012 R2. More on that later. Windows Server 2016 GA This release of Windows server is the chosen one that is going to power the Azure infrastructure and tenant workloads on Azure and AzureStack when it is released next year. From the Hyper-V perspective, things have changed quite a lot. You will have to forget all best practices and how you setup Hyper-V and Storage. 2016 is all about scaleout filesystem (reFS/NTFS) and storage direct. You also want to check the OEM hardware lis...

Making array lookups faster

This post is about making lookups in arrays as fast as possible. The array can have may properties or few, it really does not matter. The only thing required is something unique that identifies each row of data. So from time to time I find the need to make lookups fast. Usually it is a result of importing a huge csv file or something. Sample data First we have to create some dummy sample data which we can run some tests against. We will create an array of 10001 objects with a few properties. The unique property that identifies each row is called ID: (sample data script) How to test performance? There are a couple of items that impact performance in Powershell. For instance running a Measure-Command expression will yield quite different results. Normally the first run is slower than the second one and then the standard deviation is quite large for consequent runs. To decreate the standard deviation, I use a static call to the .net GarbageCollector with [...

Creating Menus in Powershell

I have created another Powershell module. This time it is about Console Menus you can use to ease the usage for members of your oranization. It is available on GitHub and published to the PowershellGallery . It is called cliMenu. Puppies This is a Controller module. It uses Write-Host to create a Menu in the console. Some of you may recall that using Write-Host is bad practice. Controller scripts and modules are the exception to this rule. In addition with WMF5 Write-Host writes to the Information stream in Powershell, so it really does not matter anymore. Design goal I have seen to many crappy menus that is a mixture of controller script and business logic. It is in essence a wild west out there, hence my ultimate goal is to create something that makes it as easy as possible to create a menu and change the way it looks. Make it easy to build Menus and change them Make it as "declarative" as possible Menus The module supports multiple Men...

Identity Manager and Powershell

It is year 2016 and Identity Manager looks like it did in 2010 when Forefront Identity Manager (FIM) was released. Who came up with the name and added it to the Forefront portfolio anyway, crazy stuff. As you probably know, looks can be deceiving. Even if MIM looks the same and run basically the same features, it is still a powerful state machine. I have been buzy collecting scripts and tools I have used the last couple of years and have started on 2 Powershell modules for MIM. This post is just a brief introduction to the module and the plans for the future. Why create a module Wait a minute. Does not  Identity Manager  come with a Powershell module? No, it comes with a Powershell snap-in from 2010. Back in those days Snap-ins where the cool kids on the block and everybody created snap-ins for things that should be created as a module. I blame  Powershell  version 1.0, however they fixed that in Powershell version 2.0, I think. I use the snap-in as ...