Microsoft Intune - An Administrator's Guide to Deploying Applications using PowerShell (The Book + Source Code)


This book is no longer available for sale.

Microsoft Intune - An Administrator's Guide to Deploying Applications using PowerShell

About the Book

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 it's installed you'll need to customise an xml file which needs to be copied to a specific folder structure which may or may not already exist on the computer. And there's an Excel Add-in - we'll need it to be automatically picked up by Excel and activated allowing the custom tab to appear with no end-user config. Should be a piece of cake."


How do you deploy an application using 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 set and what values can be passed to them when you don't have a help parameter or manual to read? 

What about detection rules? What if there's nothing to detect?

Are you migrating from Configuration Manager and need to know how to get around the new Intune caveats?

How do you...the list goes on!

If you are fed up of telling user support to "Install this one manually" and you want to get kudos from your boss and all of those around you then you will want to buy this book.

About the Author

Owen Smith
Owen Smith

I'm a network admin for a global company based in the UK HQ.  

Table of Contents

    • About the Author
    • Who This Book is For
    • Introduction
  • Important Notes
      • Sample Code Wrapping
      • Code in Production
      • Source Code
  • Eat, Sleep, Deploy, Repeat
  • Chapter 1: PowerShell Cmdlets
    • The Twelve Cmdlets
      • Write-Host
      • Set-Location
      • Get-Process
      • Stop-Process
      • Start-Process
      • New-Item
      • New-ItemProperty
      • Get-Item
      • Copy-Item
      • Test-Path
      • Try \ Catch block
  • Chapter 2: MSIEXEC
    • Fundamentals
      • View the Help
      • Where Is It?
      • Better to use $Env:
    • Parameters
      • Installation
      • Silent Install
      • No Restart
      • Uninstall
    • Properties
      • Which Properties Can Be Set?
      • How to Find Valid Property Values
    • Uninstall GUIDs
      • 32-bit Installations
      • 64-bit Installations
  • Chapter 3: Setup.exe
    • Discovering the Setup.exe silent Install \ Uninstall parameters
      • EXE’s Have Registry Information Too
      • In-Built Help
      • Internet Search
    • MSI Extraction
      • MSI Extraction Method #1
      • MSI Extraction Method #2
    • Example MSI Extraction
  • Chapter 4: Detection Rules
    • Why Use PowerShell?
    • Detection Fundamentals
      • The Microsoft Rules
      • In Practice
      • Where Do I put My Detection Rules Anyway?
      • Silently Continue
    • Detection Types
      • File \ Folder Presence
      • Executable Presence
      • Executable Version
      • Hey! Where’s the Build Number?
      • Registry Subkey
      • Registry Value \ Data Pair
    • Custom Detection
      • Why Use Custom Detection?
      • Custom File Detection
      • Custom Registry Detection
      • Final Thoughts on Custom Detection
    • Branching
      • By Office Bitness
      • If This, Then That
      • This and This
  • Chapter 5: Location, Location, Location.
    • Where Is This Script Running from Anyway?
      • How We Used to Do Things
      • A Better Way
    • File Placement
      • Where to Place Your Files for Deployment
    • Referencing Files
      • Referencing Files in a Flat Structure
      • Referencing Files in Subdirectories
      • If You’re Elsewhere…
  • Chapter 6: Installing the Program.
    • Calling the MSI or Setup.exe
    • Start Your Engines Please
    • Parameters
      • -FilePath
      • -NoNewWindow
      • -Wait
    • Dealing with Spaces
    • Putting It All Together
      • Example 1 - Simple MSI
      • Example 2 - MSI with Properties
      • Example 3 - Setup.Exe
  • Chapter 7: Deploying the Script
    • Sys What Now?
      • In Practice
    • Calling Your Script
      • Standard Script (Top to Bottom)
      • Script with Entry Point
      • Function
      • Function Accepting Parameters
    • Example: Deploying a Script Containing Two Functions
      • Remote Server Administration Tools
  • Chapter 8: Deployment Template
    • How to Use
      • Deploying Based on Office ‘Bitness’
      • Deploying Based on Operating System Architecture
      • Pre-Deployment Tasks
      • Post-Deployment Tasks
      • Logging
      • How to call the Template
    • Final Thoughts
  • Chapter 9: Application Preparation
      • Download the Tool
      • Prep for Prep
      • Adding Your Content
      • Creating the .Intunewin
      • What’s in a Name?
  • Chapter 10: Uninstall an Application
      • The Function
      • How it Works
      • Exactly!
      • Test Run
      • How to Use
  • Chapter 11: Useful Code Snippets
      • Detect Office ‘Bitness’
      • Detect Operating System Architecture
      • Obtaining the Current Logged in User Name
      • Copying Files
      • Register \ Unregister DLL files
  • Chapter 12: Example Deployment - Start to Finish
    • Scenario
      • Determine the Command Line Parameters and Values
      • Captain’s Log
      • Sanity Check
      • Invoke-ApplicationInstall
      • Detection Script
      • Input and Output
      • Create the .IntuneWin File
      • Create the Windows App (Win32)
      • App Information
      • Program
      • Requirements
      • Detection Rules
      • Dependencies
      • Assignments
      • Review + create
      • Install the Application
      • Inspecting the Application Installation Log File

The Leanpub 60-day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms

80% Royalties. Earn $16 on a $20 book.

We pay 80% royalties. That's not a typo: you earn $16 on a $20 sale. If we sell 5000 non-refunded copies of your book or course for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earnedover $12 million USDwriting, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub