Powershell script collection for ConfigMgr 2012

This post will contain all my scripts and snippets in zip format for download, that I use to manage my ConfigMgr environments or anything related to System Center 2012. I’m going to update this post with every script I write. These scripts should all work, you probably need to adjust some of those scripts to your environment as some of them still have hard-coded stuff in them. As always: No warranty Download all in one: 

Add or remove features in MDT WinPE

Not going too deep here, just something I found the other day. In your MDT 2013 Deploymentshare, if you go to the share’s properties, you will find the WinPE Tab and the WinPE’s features: In here you can add components to your boot images. These components are either in C:\Program Files\Microsoft Deployment Toolkit\Templates\Distribution\Tools (like DaRT: http://www.deploymentresearch.com/Research/tabid/62/EntryId/131/Adding-DaRT-8-1-from-MDOP-2013-R2-to-ConfigMgr-2012-R2.aspx ) or in your ADK install directory here: C:\Program Files (x86)\Windows Kits\8.1\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs If you take a look at the latter, you might see that there are components in there that don’t show up in that list in your MDT Deploymentshare, for example WinPE-FMAPI.cab (File Management API). Why is that? … Continue reading

Cloud OS MVP Roadshow 2014 – Sydney

If you haven’t heard about it already, the Cloud OS MVP Roadshow, a worldwide event hosted by Microsoft, will come to Sydney in August 2014. I will be speaking there alongside other MVPs about how to get you away from that old, stinking, legacy Windows Server 2003, to the new, shiny, with a smell of roses Windows Server 2012 R2. If you are from the Sydney, Australia area and want to join for these couple of sessions, head over to https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032592489&Culture=en-AU&community=1 and register for the event. IT’S COMPLETELY FREE! Here is another good write-up about previous Cloud OS Roadshow events: http://mvp.microsoft.com/en-us/story/Cloud%20OS%20MVP%20Roadshow-20140324162819 Looking forward to seeing you in Sydney! -David

What if Windows 8.1 had intelligence and no-one cared?

I am currently working on a Windows 8.1 deployment that will end up on quite a few tablets used in retail stores. Interesting project from a requirements perspective, because usually I never had to worry about machines being stolen by customers that much New Feature in Windows 8.1 Update Of course, I am deploying Windows 8.1 Update (latest and greatest!) to these tablets which is easy. Create a Build & Capture Task Sequence in MDT and afterwards deploy it with whatever you like. I have to stick to MDT as a deployment tool for the time being, as the customer has not yet upgraded their ConfigMgr environment to 2012 R2. … Continue reading

How to deploy a SMA worker via Powershell DSC

[UPDATED 21/07/2014 and 18/08/2014] See below In my previous article around Powershell DSC I demonstrated some very basic example of what DSC can do. This article will go a bit deeper and show you a complete solution where Desired State Configuration can come in very handy. I recently needed to deploy a couple of SMA (Service Management Automation) Runbook Worker machines. In this case I did not want to install them all manually, as I tend to forget some of the software requirements and I also don’t want to install too many unneeded server roles and features. I couldn’t find anything on the internet, so I thought I’d create a … Continue reading

Powershell DSC 101 – How to add Windows Features

Powershell Desired State Configuration is a very powerful feature of Powershell 4.0 and Windows Server 2012 R2. Coming from a very strong Microsoft System Center Configuration Manager background I like to think of it a bit as Compliance Settings. I’m configuring a state I want a Server to be in and DSC makes sure it ends up looking like that (and even stays like that – remediation!). And all that, if you like, without the “overhead” of any additional infrastructure (and even for Linux!) Crazy?! More information around DSC can be found here: http://blogs.technet.com/b/privatecloud/archive/2013/08/30/introducing-powershell-desired-state-configuration-dsc.aspx and http://technet.microsoft.com/en-us/library/dn249912.aspx WindowsFeature resource in DSC Being based on Powershell, DSC knows certain keywords you can … Continue reading

How to publish URL shortcuts to Windows 8.1

A customer of mine asked me to create a new Windows 8.1 Enterprise SOE (golden image, standard image, whatever) and also customise the Start Menu and Start Screen layout. This customer is pretty easy as most of their applications are web apps. Therefor I only have to deploy all the shortcuts to their web applications. Job done. Easy. I asked the customer to give me all their shortcuts so that I can then copy them to the default user’s profile during deployment (in this case MDT 2013 stand alone, but that doesn’t matter). All the shortcuts looked like this: “%programfiles%\Internet Explorer\iexplore.exe” https://www.google.com.au Regular shortcut you’d think, right? The special thing … Continue reading

How to use scripts with ConfigMgr Powershell cmdlets

This is a short note to everybody using my scripts for ConfigMgr or who plans on using any automation (Powershell, Orchestrator runbooks, whatever) based on the native Powershell cmdlets for ConfigMgr. Up until now I always thought it is “common knowledge”, but here you go: The account that executes your automation and has to run the SCCM cmdlets needs to install the signing certificate with which the ConfigMgr Powershell module was signed. This needs to be done manually!!! Before doing any automation, log on to the machine which has the admin console installed and against which your scripts, runbooks or whatever are being executed and do the following: If that … Continue reading

ConfigMgr Console Extension to find referenced Task Sequences

UPDATE: 22/05/2014 Please download the files again, if you downloaded them before 22/05/2014. They now need to go somewhere else in the file system. When working with ConfigMgr I sometimes ask myself, “Hey, is this Package / Application / Image / … even used in a Task Sequence?”. I know that a lot of other people must ask themselves this question as well, from time to time at least. There are two ways you can do it and check if any of your objects is referenced somewhere else, via the console. I will show you that these two ways are either stupid or dangerous. Task Sequences References Tab You can … Continue reading

How to find ConfigMgr collections with incremental update enabled

In addition to my last article on collections I just got asked if there is a quick and easy way to find ConfigMgr collections that have the ‘Incremental updates’ enabled on them. Why? Because it’s a very bad idea to have this enabled on too many collections. There is a Microsoft recommendation to not enable this on more than “round about 200 collections” in your hierarchy. See here: http://technet.microsoft.com/en-us/library/gg699372.aspx Here’s the answer, look at the SMS_Collection WMI class and the RefreshType property. Full documentation for this WMI class is here: http://msdn.microsoft.com/en-us/library/hh948939.aspx   Executing the script will open up two separate windows. One for device collections and one for user collections. … Continue reading

How to – ConfigMgr collection updates

This is a topic I haven’t seen much covered around but is quite important, especially if you’re managing an environment with a lot of clients, regular changes and a lot of collections. What is a ConfigMgr collection? According to Technet (http://technet.microsoft.com/en-us/library/gg682169.aspx): Collections in System Center 2012 Configuration Manager provide a method of managing groups of computers, mobile devices, users, and other resources in your organization. So they are nothing more than groups of objects in your environment. How you group them is not mentioned yet or for what reason. Collections can be used to deploy Software, Operating Systems, Task Sequences or settings to these managed groups. Basics covered, we all … Continue reading