Code Monkey home page Code Monkey logo

configmgr.adminservice's Introduction

ConfigMgr.AdminService Module

The purpose if this module is to provide PowerShell cmdlet access to the ConfigMgr Administration Service (AdminService). The module features secrets management using Azure Key Vault and support for Token Authentication for automation workloads. Additionally, the AdminService can be configured to be accessible via Azure Application Proxy which allows you to run commands without a direct connection to your ConfigMgr provider server.

Prerequisites

I've built a lot of stuff out, but you'll have to do SOME legwork if you want to leverage Azure Key Vault or use AdminService over the internet.

  • Azure Tenant with Subscription
  • ConfigMgr Env with AdminService Enabled
  • Cloud Management Gateway
  • Azure App Proxy
  • ConfigMgr Web App and Client App Registrations

Key Vault with Cloud Management Gateway (CMG) or Azure App Proxy

Install-Module ConfigMgr.AdminService

Azure Key Vault

 New-CMKeyVault -TenantId bac71e12-25a3-4e40-b871-1896ef219357 -SubscriptionId 92812f8f-f4c8-4c99-8e9e-c8fa7d3e81b9 -Location "South Central US"

$Params = @{
    AdminServiceTenantId       = "bac71e12-25a3-4e40-b871-1896ef219357"
    AdminServiceBaseURL        = "https://adminservice.asquaredozen.com/AdminService_TokenAuth"
    AdminServiceCMGURL         = "HTTPS://ASDCMG.ASQUAREDOZEN.COM/CCM_Proxy_ServerAuth/72057594037927869/AdminService"
    AdminServiceClientAppId    = "b87d7ed1-7cd9-48a8-89af-f748bc6ce727"
    AdminServiceServerAppId    = "a0dbbd77-f01b-4c35-8aca-b8e14c084ece"
    AdminServiceServerAppIdUri = "api://bac71e12-25a3-4e40-b871-1896ef219357/a0dbbd77-f01b-4c35-8aca-b8e14c084ece"
}
Set-CMKeyVaultValues @Params

or

$Params = @{
    TenantId             = "bac71e12-25a3-4e40-b871-1896ef219357"
    SubscriptionId       = "92812f8f-f4c8-4c99-8e9e-c8fa7d3e81b9"
    Location             = "South Central US"
    CreateDefaultSecrets = $true
    Secrets              = @{
        AdminServiceTenantId       = "bac71e12-25a3-4e40-b871-1896ef219357"
        AdminServiceBaseURL        = "https://adminservice.asquaredozen.com/AdminService_TokenAuth"
        AdminServiceCMGURL         = "HTTPS://ASDCMG.ASQUAREDOZEN.COM/CCM_Proxy_ServerAuth/72057594037927869/AdminService"
        AdminServiceClientAppId    = "b87d7ed1-7cd9-48a8-89af-f748bc6ce727"
        AdminServiceServerAppId    = "a0dbbd77-f01b-4c35-8aca-b8e14c084ece"
        AdminServiceServerAppIdUri = "api://bac71e12-25a3-4e40-b871-1896ef219357/a0dbbd77-f01b-4c35-8aca-b8e14c084ece"
    }
}
$vault = New-CMKeyVault @Params

Local Secrets Vault

$vault = New-CMKeyVault -UseLocalVault

$Params = @{
    AdminServiceTenantId       = "bac71e12-25a3-4e40-b871-1896ef219357"
    AdminServiceBaseURL        = "https://adminservice.asquaredozen.com/AdminService_TokenAuth"
    AdminServiceCMGURL         = "HTTPS://ASDCMG.ASQUAREDOZEN.COM/CCM_Proxy_ServerAuth/72057594037927869/AdminService"
    AdminServiceClientAppId    = "b87d7ed1-7cd9-48a8-89af-f748bc6ce727"
    AdminServiceServerAppId    = "a0dbbd77-f01b-4c35-8aca-b8e14c084ece"
    AdminServiceServerAppIdUri = "api://bac71e12-25a3-4e40-b871-1896ef219357/a0dbbd77-f01b-4c35-8aca-b8e14c084ece"
}
Set-CMKeyVaultValues @Params

No Vault or Local Only

Not needed.

Install the module

Install-Module ConfigMgr.AdminService -Scope CurrentUser

Initialize the Secrets

To launch the module and get secrets from the vault you'll need to supply the Azure Key Vault Name.

Current User Auth

Initialize-CMAdminService

Or

Service Principal Auth

An Azure App Registration (Service Principal) is required and must have a certificate uploaded. Supply the certificate thumbprint to the function. The Service Principal will need permissions to the keyvault.

Initialize-CMAdminService -AzureKeyVaultName "MyAzureKeyVault" -TenantId "{TenantId}" -ApplicationId "{TenantId}" -CertificateThumbprint "2J3H23KKDD4IJDJDIW34JWK3JK23M32KK3N23"

Test these functions to get started

#Get all devices
Get-CMDevice

#Get all users
Get-CMUser

configmgr.adminservice's People

Contributors

adamgrosstx avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.