Skip to content
The Lazy Administrator
  • Home
  • Disclaimer
  • Contact
  • About Me
  • Search Icon

The Lazy Administrator

Finding ways to do the most work with the least effort possible

Getting Started with the IntuneCLI, an Automated Intune Management Solution

Getting Started with the IntuneCLI, an Automated Intune Management Solution

November 29, 2023 Brad Wyatt Comments 1 comment

Table of Contents

  • Obtaining the IntuneAssistant
    • Manual
      • Make the Binary Executable
      • Meeting Pre-Preqs (DotNET)
    • Command Line
      • Install Dotnet SDK
      • Add the NuGet Feed
      • Install IntuneAssistant
      • Modify PATH Environment Variable
  • IntuneCLI Commands
    • Login
    • Show Intune Assignment Groups
    • View Specific Group Information
    • Help

Disclaimer: The IntuneAssistant is an ongoing project that is in development. The document below may be outdated in newer versions. The developer is very active on GitHub if you run into any issues. You should reference the GitHub Project: https://github.com/srozemuller/IntuneAssistant

I would also recommend checking out their blog at: Sander Rozemuller | All about Identity, AVD, Automation, DevOps, Monitoring, Intune and Security

Obtaining the IntuneAssistant

Manual

The first thing we need to do, is to download the CLI binary which can be found here. In my case, I am running a M1 Pro Mac so I will grab the MacOS ARM binary. I then placed it in a folder called “Dev” in the root of my Home directory.

Make the Binary Executable

The next step in the process is to make the binary executable. This is something that you do not have to do on a Windows machine, so if you are on Windows you can proceed to the next step.

  1. Open a terminal and navigate to the binary location. In my example I will go to Home > Dev

2. Next, I will rename the file to “IntuneAssistant.Cli”. This is not required but preferred.

3. Back in the terminal, I need to make the binary executable by running the following command:

chmod +x IntuneAssistant.Cli

4. Next, I need to attempt to run it by running the following command:

./IntuneAssistant.Cli auth login

5. That will invoke a security warning shown below:

In Settings > Security and Privacy > click Allow Anyway

Meeting Pre-Preqs (DotNET)

Back in the terminal if I re-run ./IntuneAssistant.Cli auth login this time it will run and fail the pre-req check (DotNET).

Command Line

Another method to download the IntuneAssistant is using the command line.

Install Dotnet SDK

First item that must be done, is to download dotnet 7 SDK for macOS which can be obtained here.

Add the NuGet Feed

Next, we need to add the Nuget feed

dotnet nuget add source https://api.nuget.org/v3/index.json --name nuget.org

Install IntuneAssistant

The following command will install the IntuneAssistant

dotnet tool install --global IntuneCLI

Modify PATH Environment Variable

This next step is optional but by adding the IntuneAssistant path to the PATH, it will be loaded into memory when you start your terminal.

cat << \EOF >> ~/.zprofile
# Add .NET Core SDK tools
export PATH="$PATH:/Users/bradleywyatt/.dotnet/tools"
EOF

Now when I open my terminal up I can just type “IntuneCli”

Note: It seems to download to binary for Intel Mac’s and not ARM for now. Which is why you see the error being thrown.

IntuneCLI Commands

Login

Now that I have DotNET installed, running the command again launches a web browser for me to sign in.

Since this is the first time I am using the CLI, I will be prompted to approve the permissions.

Once I have authenticated on the web, the terminal shows that I have successfully authenticated to Entra.

Show Intune Assignment Groups

The following command will display detailed information on all of our Intune Assignment Groups

./IntuneAssistant.Cli show assignments groups

View Specific Group Information

Next, I want to view what is being applied to my group “Intune – Base Config”. This will allow me to see what my base deployment looks like. To do so, I need to run the following command:

./IntuneAssistant.Cli show assignments groups --group-name "Intune - Base Config"

Help

The IntuneAssistant also includes a helpful Help system which can be called by using “-h”

In the following example I am going to view the help for showing devices by running the following command:

./IntuneAssistant.Cli show devices -h
Brad Wyatt
Brad Wyatt

My name is Bradley Wyatt; I am a 5x Microsoft Most Valuable Professional (MVP) in Microsoft Azure and Microsoft 365. I have given talks at many different conferences, user groups, and companies throughout the United States, ranging from PowerShell to DevOps Security best practices, and I am the 2022 North American Outstanding Contribution to the Microsoft Community winner.


Intune
API, Automation, CLI, Intune

Post navigation

PREVIOUS
Centrally Manage Company Contacts and Deploy to Built-In Contacts App Using Intune, SharePoint, PowerShell and Graph API.
NEXT
Microsoft Graph API Endpoint Adds Last Successful Sign-In Date Time

One thought on “Getting Started with the IntuneCLI, an Automated Intune Management Solution”

  1. Pingback: Intune Newsletter - 1st December 2023 - Andrew Taylor

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Subscribe

Email


Categories

  • Active Directory (8)
  • AI (3)
  • API (1)
  • AutoPilot (2)
  • Azure (15)
  • Bicep (4)
  • Connectwise (1)
  • Defender for Cloud Apps (1)
  • Delegated Admin (1)
  • DevOps (6)
  • Graph (6)
  • Intune (15)
  • LabTech (1)
  • Microsoft Teams (6)
  • Office 365 (19)
  • Permissions (2)
  • PowerShell (50)
  • Security (1)
  • SharePoint (3)
  • Skype for Business (1)
  • Terraform (1)
  • Uncategorized (2)
  • Yammer (1)

Recent Comments

  • Kristopher Gates on Getting Started with GitHub Copilot in the CLI
  • MD SHARIQUE AKHTAR on Modern Active Directory – An update to PSHTML-AD-Report
  • TommyBoich on How The ConnectWise Manage API Handles Pagination with PowerShell
  • LOTTERY 365 LOGIN on Windows LAPS Management, Configuration and Troubleshooting Using Microsoft Intune
  • SPRUNKI PHASE 6 on Get a New Computer’s Auto Pilot Hash Without Going Through the Out of Box Experience (OOBE)

1,740,532 People Reached

© 2025   All Rights Reserved.