The System Center Configuration Manager AdminService Guide

This post is dedicated to the System Center Configuration Manger (SCCM/ConfigMgr) AdminService. Please check back here for helpful links and to blog posts, documentation and examples for using the AdminService. Please note, I wasn’t sure what the name was officially when I first started, and I didn’t expect to keep posting new info about it, so sorry if it’s disjointed.

Original Posts

Latest AdminService News

Community Blogs

Sandy Tsang – Use ConfigMgr administration service (AdminService) over internet

The Basics

The AdminService is a REST API that runs as a service, independent of the other web components in IIS on your site servers.

Service

You can check the status of the service in the console under \Monitoring\Overview\System Status\Component Status – SMS_REST_PROVIDER

Files and Registry Keys

There are several files to be aware of. Below are the key files of interest.

  • Service components
    • <INSTALLDIR>\bin\X64\CMRestProvider\sccmprovidergraph.exe
    • <INSTALLDIR>\bin\X64\CMRestProvider\sccmprovidergraph.exe.config
  • Logs
    • Locations
      • 1810 CB – <INSATALLDIR>\CMProviderLog
      • 1901 TP – <INSTALLDIR>\Logs
      • 1902 TP – <INSTALLDIR>\Logs
      • 1902 CB – <INSTALLDIR>\Logs
      • Application Event Log – Source – CMRestProviderService
    • Files
      • SMS_REST_PROVIDER.log – Logs the status of the provider service
      • AdminService.log – logs commands run against the AdminService
  • Registry
    • HKLM\SOFTWARE\Microsoft\SMS\Tracing\SMS_REST_PROVIDER
    • HKLM\SOFTWARE\Microsoft\SMS\COMPONENTS\SMS_REST_PROVIDER
    • HKLM\SOFTWARE\Microsoft\SMS\COMPONENTS\SMS_SITE_COMPONENT_MANAGER\Component Servers\<SERVERNAME>\Components\SMS_REST_PROVIDER

Setup

Beginning in 1810 CB, you will see the SMS Provider API as an option during setup. This feature enables the AdminSerivce REST API. You also have the option to install the SMS Provider role on additional site servers. When you do this, the AdminService will also be included on this new server. See info here: https://docs.microsoft.com/en-us/sccm/core/plan-design/hierarchy/plan-for-the-sms-provider

Additionally, you can configure the AdminService to communicate through the Cloud Management Gateway CMG by configuring the SMS Provider role.

Usage

My earlier posts linked above show the progression of testing that I performed with the AdminService. Below is a summary and key changes between releases. You can test using PostMan or another REST API testing tool.

URLs

03/30/2019 – In 1902 CB – the URLs have been updated to match what we saw in 1902 TP.

The base urls between 1810 CB, 1901 TP & 1902 TP are unchanged. However, in 1902 TP, the class names used for the WMI controller uses the original SMS_ prefixed names, whereas the 1810 CB and 1901 TP both used class names with the SMS_ prefix removed. Additionally these versions also used simplified names for Device, User and possibly other classes. In 1902 TP, they will use SMS_R_System and SMS_R_User, presumably to maintain consistency between WMI and the AdminService conversion.

Versioned Controllers
https://<ServerName/AdminService/v1.0/
https://<ServerName/AdminService/v1.0/$metadata

WMI Controller

https://<ServerName/AdminService/wmi
https://<ServerName/AdminService/wmi/$metadata

Read-Only Query Basics

Note: All queries in this section use a HTTP GET method.

  • Get all Devices
    • 1810 CB & 1901 TP – https://<ServerName>/AdminService/wmi/Device
    • 1902 CB & 1902 TP – https://<ServerName>/AdminService/wmi/SMS_R_System
  • Get All Users
    • 1810 CB & 1901 TP – https://<ServerName>/AdminService/wmi/User

    • 1902 CB & 1902 TP – https://<ServerName/AdminService/wmi/SMS_R_User
  • Get Device By ResourceID (same syntax for users)
    • 1810 CB & 1901 TP – https://<ServerName>/AdminService/wmi/Device(12345678)

    • 1902 CB & 1902 TP – https://<ServerName>/AdminService/wmi/SMS_R_System
      (12345678)
  • Retrieve related class information
    • 1810 CB & 1901 TP – https://<ServerName>/AdminService/wmi/Device(12345678)/
      COMPUTER_SYSTEM

    • 1902 CB & 1902 TP – https://<ServerName>/AdminService/wmi/SMS_R_System(
      12345678)/SMS_G_System_OPERATING_SYSTEM

You can find more query examples in my previous posts.

Create and Edit Methods

03/30/2019 – The following also works in 1902 CB.

Beginning in 1901 TP, you can now create and modify objects. Be warned, this is still very much in development, so some things are still a but buggy, however I think it works well enough for testing. The following only applies to 1901 TP and 1902 TP.

Create a new Package

1901 TP
POST – https://<ServerName>/AdminService/wmi/AdminService/wmi/Package
Body – {"Name": "Test Package", "Manufacturer": "ASD"}

Create a new Package in 1901 TP

Note, there’s a bug on the return of the Post method currently which will return a 500 error. You can check the AdminService log to verify that the method was processed. You can also check the Admin Console and see your new package.

Successfully created a package

1901 TP
POST – https://<ServerName>/AdminService/wmi/AdminService/wmi/SMS_Package
Body – {"Name": "Test Package", "Manufacturer": "ASD"}

The results will be the same as above.

Editing A Package

Using the methods above, we can edit the package that we just created. I’ll only show the methods for 1902 TP in these examples. Simply change out SMS_Package for Package for 1901 TP. First we have to

Get the ResourceID for the package. Returns all packages. Check for the

GET – https://<ServerName>/AdminService/wmi/AdminService/wmi/SMS_Package

Edit the Package object

POST – https://<SERVERNAME>/AdminService/wmi/SMS_Package
Body – {"PackageID": "TP100009", "Name": "Test Package #1", "Manufacturer": "A Square Dozen"}

Once again, we got a 500 error so se have to search for our package again. This time using the new name. Notice the URL Encoded # sign is %23. Also we can add the select parameter to filter the column list.

GET –
https://<SERVERNAME>/AdminService/wmi/SMS_Package?$filter=Name eq 'Test Package %231'&$select=PackageID,Name,Manufacturer

Console Connections

In 1901 TP, navigate to \Administration\Overview\Security\Console Connections in the Admin Console to see a list of all Admin Consoles that are connected and their versions. Check the AdminService.log to see the query that get’s executed.
https://<SERVERNAME>/AdminService/v1.0/ConsoleAdminsData

Application Approvals

In 1810 CB Email Users can request application and it generates an email that contains an approval URL. This URL contains a secret (only visible in the Database) on-time use key that is used to approve or deny the application installation request. The URL uses the AdminService.

Read more about it here.

PowerShell Usage

You can use the above queries in PowerShell as well. Here’s a sample script that I made for CTSMUG. It’s just for demo purposes and isn’t complete but it should give you a good starting point. Feel free to reach out if you have questions.

Cloud Management Gateway (CMG)

This one is on my list. I just haven’t gotten my lab rebuilt to the point that I can test this functionality. More info in the future.

Read more about it here.

OData

I will update this section with additional content as I have time. In the meantime, check out this PowerBI report that I made for CTSMUG using 1810 CB.

Summary

I plan to update this page as new AdminService features are released. Please check back for more info. Also, I’d love to hear what things you’ve tested out. Check out my ConfigMgrAdminService GitHub Repo for more sample files in the future.

You Might Also Like

1 Comment

  • Reply
    Mike
    July 8, 2019 at 10:18 am

    Rocking! Your sceenshot has a Typo 🙂
    AdminSevice instead of AdminService

  • Comment

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    7,063