ConfigMgr - An Administrator's Guide to Deploying Applications using PowerShell
By Owen Smith
5/5
()
About this ebook
My manager asked me to deploy an application: "Should be simple", he said. "It's a Setup.exe and part-way through the installer, the user has to make a choice from a drop-down menu - they must select 'Sage Enterprise Management' and you know they wont, so make sure that part's automated.
"After that, I have one more urgent deployment; you'll need to customise an xml file which needs to be copied to a specific folder structure that may or may not already exist on the computer. And there's an Excel Add-in - so we'll need it to be automatically picked up by Excel and activated so that the tab appears with no end-user config. Should be a piece of cake."
Are you fed up of sand being kicked in your face? Exactly how do you deploy a PowerShell script? What if it's a function? What if it's not? What if it accepts parameters? How do you know which properties of your MSI can be tweaked and even more importantly, how do you know what values can be passed to them? What about detection rules? What if there's nothing to detect? Help!
If you would like to know how to achieve all of this and much, much more using Microsoft Configuration Manager (SCCM) and PowerShell then you will want to read this book.
Owen Smith
Owen Smith has over 20 years experience working within the I.T industry and currently works as a Senior Network Administrator for a global company based in the U.K headquarters. As well as being an author, he has an I.T podcast and runs a popular technology blog focused mainly on ConfigMgr and PowerShell.
Related to ConfigMgr - An Administrator's Guide to Deploying Applications using PowerShell
Related ebooks
Microsoft System Center PowerShell Essentials Rating: 0 out of 5 stars0 ratingsPowerShell Troubleshooting Guide Rating: 0 out of 5 stars0 ratingsGetting Started with PowerShell Rating: 0 out of 5 stars0 ratingsPowerShell: A Comprehensive Guide to Windows PowerShell Rating: 4 out of 5 stars4/5PowerShell: A Beginner's Guide to Windows PowerShell Rating: 4 out of 5 stars4/5The Complete Powershell Training for Beginners Rating: 0 out of 5 stars0 ratingsINSTANT Windows PowerShell Rating: 0 out of 5 stars0 ratingsLearning PowerShell DSC Rating: 0 out of 5 stars0 ratingsGetting Started With Powershell for Office 365 Rating: 0 out of 5 stars0 ratingsBasics with Windows Powershell Rating: 0 out of 5 stars0 ratingsWindows PowerShell for .NET Developers - Second Edition Rating: 4 out of 5 stars4/5Practical PowerShell Security and Compliance Center Rating: 0 out of 5 stars0 ratingsMicrosoft System Center Configuration Manager Cookbook - Second Edition Rating: 0 out of 5 stars0 ratingsEnterprise PowerShell Scripting Bootcamp Rating: 0 out of 5 stars0 ratingsMastering Windows PowerShell Scripting Rating: 4 out of 5 stars4/5Mastering System Center Configuration Manager Rating: 0 out of 5 stars0 ratingsMastering the Microsoft Deployment Toolkit Rating: 0 out of 5 stars0 ratingsLearn System Center Configuration Manager in a Month of Lunches: Covers SCCM 1511 and Windows 10 Rating: 0 out of 5 stars0 ratingsLearn PowerShell Scripting in a Month of Lunches Rating: 0 out of 5 stars0 ratingsMastering Active Directory Rating: 0 out of 5 stars0 ratingsTroubleshooting System Center Configuration Manager Rating: 1 out of 5 stars1/5Active Directory with PowerShell Rating: 4 out of 5 stars4/5Instant Windows PowerShell Guide Rating: 0 out of 5 stars0 ratingsPowerShell 7 for IT Professionals Rating: 1 out of 5 stars1/5Learn Windows PowerShell in a Month of Lunches Rating: 0 out of 5 stars0 ratingsWindows Performance Analysis Field Guide Rating: 4 out of 5 stars4/5Mastering Windows Server 2016 Rating: 5 out of 5 stars5/5
Programming For You
SQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5Hacking: Ultimate Beginner's Guide for Computer Hacking in 2018 and Beyond: Hacking in 2018, #1 Rating: 4 out of 5 stars4/5Learn to Code. Get a Job. The Ultimate Guide to Learning and Getting Hired as a Developer. Rating: 5 out of 5 stars5/5Grokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5Coding All-in-One For Dummies Rating: 4 out of 5 stars4/5Python Programming : How to Code Python Fast In Just 24 Hours With 7 Simple Steps Rating: 4 out of 5 stars4/5Python QuickStart Guide: The Simplified Beginner's Guide to Python Programming Using Hands-On Projects and Real-World Applications Rating: 0 out of 5 stars0 ratingsExcel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5Learn PowerShell in a Month of Lunches, Fourth Edition: Covers Windows, Linux, and macOS Rating: 0 out of 5 stars0 ratingsHTML & CSS: Learn the Fundaments in 7 Days Rating: 4 out of 5 stars4/5SQL All-in-One For Dummies Rating: 3 out of 5 stars3/5Python for Beginners: Learn the Fundamentals of Computer Programming Rating: 0 out of 5 stars0 ratingsJava for Beginners: A Crash Course to Learn Java Programming in 1 Week Rating: 5 out of 5 stars5/5SQL: For Beginners: Your Guide To Easily Learn SQL Programming in 7 Days Rating: 5 out of 5 stars5/5Python Machine Learning By Example Rating: 4 out of 5 stars4/5Python: Learn Python in 24 Hours Rating: 4 out of 5 stars4/5PYTHON: Practical Python Programming For Beginners & Experts With Hands-on Project Rating: 5 out of 5 stars5/5The Unofficial Guide to Open Broadcaster Software: OBS: The World's Most Popular Free Live-Streaming Application Rating: 0 out of 5 stars0 ratingsLearn JavaScript in 24 Hours Rating: 3 out of 5 stars3/5Python: For Beginners A Crash Course Guide To Learn Python in 1 Week Rating: 4 out of 5 stars4/5HTML in 30 Pages Rating: 5 out of 5 stars5/5Learn SQL in 24 Hours Rating: 5 out of 5 stars5/5
Reviews for ConfigMgr - An Administrator's Guide to Deploying Applications using PowerShell
1 rating0 reviews
Book preview
ConfigMgr - An Administrator's Guide to Deploying Applications using PowerShell - Owen Smith
Who This Book Is For
I am going to make a few assumptions here:
1. You already know how to deploy a standard application using Configuration Manager.
2. You have some PowerShell experience.
Number 2 is important because, fundamentally, this is a book about deploying applications using PowerShell. Although you don't need a great deal of experience, it would be advantageous to have some PowerShell knowledge and a bonus would be some scripting experience too.
I'll cut to the chase here: this book is not going to teach you PowerShell or how to script.
Having said that, even if you do not possess either of these skills, I am certain that there is still a great deal of value to be had out of a read-through of this book.
So, do you take the blue pill or the red pill?
How This Book is Organised
I recommend reading this book in order; however, it is not necessary to do that, and should you wish to then feel free to jump to any section that takes your fancy.
Code
All PowerShell code used is presented in this book so that you don't have to 'jump out of the moment' however the downside to this is that the formatting may be a little off! A lot of the PowerShell screenshots taken for this book have backticks (`) added mid-line to split a single line of code over to multiple lines. This has been done so that it all fits nicely in the picture.
To see the actual code-as-is, look here on my Github repository:
https://github.com/ozthe2/ConfigMgr-Book-Code
All code examples used in this book will have the .ps1 filename just below it so you can easily find the matching PowerShell file in the Github repository.
The Sum of Its Parts
Part 1: Why Use PowerShell?
explains why you may choose this method and takes you through the various PowerShell cmdlets that you will use all the time when deploying applications.
Part 2: MSIEXEC
covers some of the fundamentals of this command; how to get help, how to extract from a setup.exe, installing and uninstalling, using parameters as well as explaining where uninstall GUIDs are stored in the registry and how you can use them to your advantage.
This part also explains how to easily find out not only which properties are available for you to set on your msi but crucially, how to find out what the allowed values are that you will pass to the property.
You are then shown an example of a 'problem' deployment: a Setup.exe that has user input, and step-by-step I explain how the msi is extracted, how I discover the available properties and their allowed values and build the final command line.
Part 3: Detection Rules
explains why you should use PowerShell for your detection rules and how they work. I then demonstrate some of the more traditional ways that you can use PowerShell for your detection rules; such as checking the registry for certain values or interrogating the file system. You will also learn how to create your own files or registry keys \ values to be used as part of the detection when all else fails.
Part 4: Location, Location, Location
is where you learn how to identify where your script is running from, how to use this to reference your files and where to place your script and files.
Part 5: Installing the Program
is the meat and bones of our deployment script. Here you will learn how to script our msi or exe installation as well as deal with common issues such as passing parameters and dealing with spaces in file names.
Part 6: Deploying the Script
explains how to deploy your finished script using the ConfigMgr 'application method.' We will learn the different methods we need to use depending on what type of script we have eg a function or a plain 'top-to-bottom' script.
Part 7: A Deployment Template
is a rough and ready template I created that can be used as the basis for all your deployments; you will just need to season to taste.
Part 8: Useful Code Snippets
gives examples of re-usable code I use frequently in my scripts, such as detecting Microsoft Office 'bitness' or obtaining the current logged in user as well as many more.
Part 9: Real World Examples
shows ready-to-go-code that can be used to deploy popular applications such as Java, Adobe Acrobat Reader, resizing the CCMCache and more.
Part 1: Why Use PowerShell?
My manager said to me, "Hey, I have an application that needs deploying to the Accounts department, it should be straight forward. Oh, by the way, you’ll need to customise an xml file which needs to be copied to a specific folder structure that may or may not already exist.
There’s also an Excel add-in, so you need to ensure that it’s automatically picked up by Excel and activated so that the tab appears with no end-user config. Should be a piece of cake."
Believe it or not, that was a true story and something that I had to deploy just the other day!
Or how about that good old favourite: Java! How can you be certain that all previous versions of Java have been removed and that only the new version gets installed? Better yet how can this be made an easy, repeatable procedure for when the next version is released?
Or how about an easy and repeatable method of uninstalling