Connecting to MECM API Using Certificate Authentication

Ed S 0 Reputation points
2025-01-29T06:32:03.76+00:00

Hello everyone,
I'm writting a API to connecting MECM 2403 using python and have a question about the process I'm using. Currently, I establish a connection with the server using certificates. After that, I send a separate request using a requests session with NTLM authentication to access the MECM API and pull endpoint data. My question is: Is this two-step process necessary? Can I access the API directly using just certificate-based authentication, or is it required to establish the initial connection with the certificate and then send a separate request using RBAC?

Thank you for your assistance!

Microsoft System Center
Microsoft System Center
A suite of Microsoft systems management products that offer solutions for managing datacenter resources, private clouds, and client devices.
1,076 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. XinGuo-MSFT 21,126 Reputation points
    2025-01-29T08:05:50.9733333+00:00

    Hi,

    When connecting to the MECM API, you can indeed use certificate-based authentication directly without needing to follow up with NTLM authentication.

    Here are some steps to get you started:

    Direct Query via Web Browser:

    • You can use a web browser to query the administration service. Simply specify the query URI as the browser's URL, and the service will process the GET request, returning the result in JSON format.

    How to set up the administration service in Configuration Manager

    Using PowerShell:

    • You can make direct calls to the service using the Invoke-RestMethod cmdlet in PowerShell. For example:
    Invoke-RestMethod -Method 'Get' -Uri "https://<SMSProviderFQDN>/AdminService/wmi/SMS_Site" -UseDefaultCredentials
    
    • This command will return the output in JSON format. You can further drill down to specific values as needed.

    Power BI Desktop:

    • You can also use Power BI Desktop to query data in Configuration Manager via the administration service. In Power BI Desktop, select Get Data > OData feed, and specify the administration service route.

    For more detailed information, you can refer to the Configuration Manager API reference.


  2. AlexZhu-MSFT 6,501 Reputation points Microsoft Vendor
    2025-01-31T02:51:22.8266667+00:00

    Hi,

    To connect Configuration Manager, you can try wbem service. The code snippets are in this article

    Calling Code Snippets - Configuration Manager | Microsoft Learn

    User's image

    Regards,

    Alex

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.