Moving collection objects

Hello again.

There are two WMI methods in the smsprovider for managing members of a collection (accessible through a script or powershell):
AddMembershipRule
DeleteMembershipRule

These are usually added in scripts to automate the inclusion of machines in collections, usually during the installation of the operating system in the execution of the task sequence.

But when we have a secure environment in ConfigMgr we can find events such as the following when running, visible in the smsprovider, which controls access to objects in the database:

ExecMethodAsync: SMS_Collection.CollectionID = “SIT00001” :: AddMembershipRule SMS Provider date 2:57:12 PM 18128 (0x46D0)
Requested class = SMS_Collection SMS Provider date 2:57:12 PM 18128 (0x46D0)
Requested num keys = 1 SMS Provider date 2:57:12 PM 18128 (0x46D0)
CExtProviderClassObject :: DoExecuteMethod AddMembershipRule SMS Provider date 2:57:12 PM 18128 (0x46D0)
* ~ * ~ E: \ cm1610_rtm \ sms \ siteserver \ sdk_provider \ smsprov \ sspcollection.cpp (945): Unable to update collection. Insufficent rights. ~ * ~ * SMS Provider date 2:57:14 PM 18128 (0x46D0)
* ~ * ~ Unable to update collection. Insufficent rights. ~ * ~ * SMS Provider date 2:57:14 PM 18128 (0x46D0)

This can be generated even when the user has permissions on the two collections involved, source and destination.

Why this situation?

As you can see documented at https://social.technet.microsoft.com/Forums/en-US/5dae90b9-c44a-4257-b8f3-0e6e7dd93405/unable-to-update-collection-insufficent-rights?forum=configmanagergeneral, Apart from premissions on these two collections, the user must have permissions in the limiting collection of the destination collection.
Since it seems that the object is temporarily hosted in this repository, generating this access denied in the logs.

This can be managed from the console in Administration/Overview/Security/administrative users, and within the properties of the user, by selecting Security Scopes, we add in the desired security role the limiting collection explicitly.

I hope this helps you.

Moviendo objetos en las colecciones

Hola de Nuevo.

Existen dos métodos de WMI en el smsprovider para gestionar los miembros de una colección (accesibles mediante un script o powershell):
AddMembershipRule
DeleteMembershipRule

Estos se suelen añadir en scripts para automatizar la inclusión de máquinas en colecciones, generalmente durante la instalación del sistema operativo en la ejecución de la task sequence.

Pero cuando tenemos un entorno securizado en ConfigMgr nos podemos encontrar con eventos como los siguientes al ejecutarlo, visibles en el smsprovider, que controla el acceso a los objetos en la base de datos:

ExecMethodAsync : SMS_Collection.CollectionID=”SIT00001″::AddMembershipRule        SMS Provider        date 2:57:12 PM        18128 (0x46D0)
Requested class =SMS_Collection        SMS Provider        date 2:57:12 PM        18128 (0x46D0)
Requested num keys =1        SMS Provider        date 2:57:12 PM        18128 (0x46D0)
CExtProviderClassObject::DoExecuteMethod AddMembershipRule        SMS Provider        date 2:57:12 PM        18128 (0x46D0)
*~*~e:\cm1610_rtm\sms\siteserver\sdk_provider\smsprov\sspcollection.cpp(945) : Unable to update collection. Insufficent rights.~*~*        SMS Provider        date 2:57:14 PM        18128 (0x46D0)
*~*~Unable to update collection. Insufficent rights. ~*~*        SMS Provider        date 2:57:14 PM        18128 (0x46D0)

Esto se puede generar incluso cuando el usuario empleado tiene permisos sobre las dos colecciones implicadas, origen y destino.

¿A qué se debe esta situación?

Como se puede ver documentado en https://social.technet.microsoft.com/Forums/en-US/5dae90b9-c44a-4257-b8f3-0e6e7dd93405/unable-to-update-collection-insufficent-rights?forum=configmanagergeneral, aparte de en estas dos colecciones, el usuario debe tener permisos en la limiting collection de la colección de destino.
Ya que parece que de forma temporal se alberga en este repositorio el objeto, generando este acceso denegado en los logs.

Esto se puede gestionar desde la consola en Administration/Overview/Security/administrative users, y dentro de las propiedades del usuario, seleccionando Security Scopes, añadimos en el security role deseado la limiting collection de forma explícita.

Espero que esto os resulte de utilidad.

¡Necesito recrear el espacio de nombres WMI!!!!

A veces vemos errores relacionados con WMI en el cliente ConfigMgr que pueden estar relacionados con el registro de dlls en el sistema o problemas con el repositorio WMI.

Esta base de datos del sistema operativo se utiliza ampliamente por ConfigMgr para almacenar la información del sistema.

Ahora tenemos nuestras propias bases de datos (en SQL Compact) para el cliente, así se alivia la carga de rendimiento de WMI, especialmente con el inventario y gestión de actualizaciones, estas bases de datos que se encuentran en C:\WINDOWS\CCM almacenado en el formato SDF para el SQL compact.

A estos contenidos en las bases de datos sólo se puede acceder mediante programación o con el componente de SQL 2005 Management Studio, planeo tener una entrada más profunda sobre este componente en un futuro próximo.

Pero seguimos utilizando ampliamente WMI en el cliente, por lo que podemos necesitar diagnosticar el estado del repositorio WMI, podemos hacerlo siguiendo el siguiente post:

https://blogs.technet.microsoft.com/askperf/2014/08/08/wmi-repository-corruption-or-not/

Basado en mi experiencia, a veces será suficiente con ejecutar el siguiente comando para la comprobación de repositorio (winmgmt /verifyrepository), si el resultado vuelve como inconsistente, la primera acción será ejecutar “winmmgmt /salvagerepository” seguidamente ejecutando “winmgmt /verifyrepository” de nuevo podemos confirmar si ahora regresa como consistente.

Estos simple pasos resuelven la mayoría de mis problemas con WMI en site servers.

Si nos movemos a la siguiente etapa en un servidor Windows 2012 y todavía se vuelva inconsistente, cuando es ejecutado “winmgmt /resetrepository” hay que tener cuidado ya que el espacio de nombres de clúster será eliminada debido a la cluswmiuninstall.mof contenida en el directorio c:\windows\system32\wbem. También causa la necesidad de regenerar el registro de clase para Cluster Actualizando Consciente (CAU), debido a su cauwmiv2.mof también presente en la carpeta WBEM, por lo que será necesario volver a crear manualmente este espacio de nombres para contar con los servicios de nuevo en línea, esto está documentado en el post anterior TechNet .

Podemos seguir las siguientes acciones para resolver los problemas de WMI en las máquinas si los primeros comandos no lo resuelven, WMI Diag explicó:

https://msdn.microsoft.com/en-us/library/aa394603(v=vs.85).aspx

Tenemos información más profunda para algunas situaciones específicas sobre:

https://technet.microsoft.com/en-us/library/ff406382.aspx

Sin embargo, en algunos casos extremos incluso podemos volver a crear el espacio de nombres WMI solamente en el sistema, en los tiempos muertos del servidor 2K3 fue relativamente habitual el incontrolada crecen en la carpeta de espacio de nombres WMI, y la única solución es volver a crear el espacio de nombres a partir de cero, esta base de datos la tecnología no tiene opciones de contracción como otras bases de datos, por lo que incluso si se suprime la información dentro de la base de datos va a ver ningún cambio en el espacio utilizado, y esto crece el uso de tener como resultado la corrupción de base de datos.

Esto debe ser aplicado sólo en casos extremos, ya que esto tiene un gran impacto en los sistemas.

Los posibles eventos que pueden confirmar la corrupción repositorio WMI como por desgracia hay un montón de componentes WMI dependientes que pueden proporcionar diferentes eventos:

1.Unable to connect to root default or rootcimv2 namespaces. Fails returning error code 0x80041002 pointing to WBEM_E_NOT_FOUND.

2.When we open Computer Management and Right Click on Computer Management (Local) and select Properties, you get the following error: “WMI: Not Found” or it hangs trying connect

3.0×80041010 WBEM_E_INVALID_CLASS

4.Trying to use wbemtest, it hangs

5.Schemas/Objects missing

6.Strange connection/operation errors (0x8007054e):

get-cimclass : Unable to complete the requested operation because of either a catastrophic media failure or a data structure corruption on the disk.

At line:1 char:1

+ get-cimclass -Namespace rootcimv2TerminalServices

Durante el tiempo he modificado el script original por lo que puede ser lanzado en las máquinas con SQL Server instalado (los archivos DLL y archivos MOF no están en las carpetas por defecto del sistema operativo) y Exchange server.

Las ubicaciones de los archivos pueden ser diferentes en las versiones futuras (esto es definido a la discrección de Microsoft) así que por favor probar en gran medida antes de ejecutar en un entorno de producción.

Espero que esto sea informativo para todos

@echo off

REM %% for BATCH and% without batch in cmd window

REM ===============================================

sc config winmgmt start= disabled

net stop sms_site_component_manager /y

net stop ccmexec /y

net stop sms_executive /y

net stop sms_server_locator_point /y

net stop sms_reporting_point /y

net stop sms_sql_monitor /y

net stop SMS_SITE_SQL_BACKUP /y

net stop SMS_SITE_VSS_WRITER /y

net stop winmgmt /y

echo.

echo All stopped

echo.

echo All stopped

echo.

ping -n 1 127.0.0.1 > NUL

%systemdrive%

cd “%windir%\system32\wbem”

if exist repository.old2 rmdir /s/q repository.old2

rename repository.old repository.old2

if exist repository.old rmdir /s/q repository.old

rename repository repository.old

md repository

echo.

echo Created new repository folder

echo.

ping -n 1 127.0.0.1 > NUL

echo.

echo register wbem dll’s

echo.

for /f %%s in (‘dir /b *.dll’) do regsvr32.exe /s %%s

wmiprvse /regserver

winmgmt /regserver

echo.

echo register winmgmt and wmiprvse

echo.

ping -n 1 127.0.0.1 > NUL

regsvr32 /s /n /i “%windir%\system32\userenv.dll”

ping -n 1 127.0.0.1 > NUL

regsvr32 /s /n /i “%windir%\system32\scecli.dll”

ping -n 1 127.0.0.1 > NUL

regsvr32 /s /n /i “%windir%\system32\scesrv.dll”

ping -n 1 127.0.0.1 > NUL

echo.

echo Restart winmgmt

echo.

sc config winmgmt start= auto

net start winmgmt

echo.

echo Waiting 30 seconds until winmgmt is full restarted

echo …. then we will use mofcomp for register the mof files

echo.

ping -n 30 127.0.0.1 > NUL

for /f %%s in (‘dir /b *.mof *.mfl’) do mofcomp %%s

cd “%windir%\ccm”

for /f %%s in (‘dir /b *.mof *.mfl’) do mofcomp %%s

on error resume next

echo.

echo check if SQL 2005 mof file exist

echo.

mofcomp “%ProgramFiles%\Microsoft SQL Server\90\Shared\sqlmgmproviderxpsp2up.mof”

echo.

echo check if SQL 2008 mof file exist

echo.

mofcomp “C:\Program Files (x86)\Microsoft SQL Server\100\Shared\sqlmgmproviderxpsp2up.mof”

rem echo.

rem echo check if Exchange files exist

rem echo.

rem mofcomp exwmi.mof

rem mofcomp -n:root\cimv2\applications\exchange wbemcons.mof

rem mofcomp -n:root\cimv2\applications\exchange smtpcons.mof

rem mofcomp -n:root\cimv2\applications\exchange msgtrk.mof

rem mofcomp exmgmt.mof

net start ccmexec

echo.

echo.

echo ALL done

pause

I need to recreate WMI namespace!!!

Sometimes we see WMI errors on the ConfigMgr client that may be related to dll registration on the system or WMI repository situations.

This operating system database is extensively used by ConfigMgr to store system information.

Now we have our own databases (on Compact SQL) for the client to relieve the WMI performance charge that we used to create on WMI, specially with inventory and Updates Management, those are located on C:\WINDOWS\CCM stored on the sdf format for SQL server Compact.

Those databases contents may be only accessed programmatically, or with the out of support component SQL 2005 Management Studio, I plan to have a deeper post on a near future.

 

But we continue extensively using WMI on the client, so we may need to diagnose the WMI repository status, we can do it following the next post:

https://blogs.technet.microsoft.com/askperf/2014/08/08/wmi-repository-corruption-or-not/

 

Based on my experience sometimes will be enough to run the command for the repository check (winmgmt /verifyrepository), if the result comes  back as inconsistent, your first action is to run “winmmgmt /salvagerepository” followed by running “winmgmt /verifyrepository” again to confirm if it now comes back as consistent.

This simple steps solved most of my issues with WMI on site servers.

 

If we move to the next step on Windows server 2012 and it still comes back inconsistent, when run “winmgmt /resetrepository” need to be careful as the Cluster namespace will be removed due to the cluswmiuninstall.mof contained in the c:\windows\system32\wbem folder. It has also caused unregistering class names for Cluster Aware Updating (CAU), because of its cauwmiv2.mof also in the wbem folder, so will need to manually recreate this namespaces to have the services back online, this is documented on the previous TechNet post.

 

We may follow the next actions to solve WMI issues on the machines if the first commands did not solve it, WMI Diag explained:

https://msdn.microsoft.com/en-us/library/aa394603(v=vs.85).aspx

 

We have deeper information for some specific situations on:

https://technet.microsoft.com/en-us/library/ff406382.aspx

 

But on some extreme cases we may even need to recreate the WMI namespace completely on the system, on the 2K3 server times was relatively usual the uncontrolled grow on the WMI namespace folder, and the only solution is to recreate the namespace from scratch, this database technology has no shrink options as other databases, so even if we delete information inside the database will see no changes on the space used, and this grow use to have as a result the database corruption.

This should be implemented only on extreme cases as this has a huge impact on the systems.

 

Possible events that may confirm the WMI repository corruption as sadly there are a bunch of components WMI dependent that may provide different events:

 

1.Unable to connect to root default or rootcimv2 namespaces. Fails returning error code 0x80041002 pointing to WBEM_E_NOT_FOUND.

2.When we open Computer Management and Right Click on Computer Management (Local) and select Properties, you get the following error: “WMI: Not Found” or it hangs trying connect

3.0×80041010 WBEM_E_INVALID_CLASS

4.Trying to use wbemtest, it hangs

5.Schemas/Objects missing

6.Strange connection/operation errors (0x8007054e):

 

get-cimclass : Unable to complete the requested operation because of either a catastrophic media failure or a data structure corruption on the disk.

 

At line:1 char:1

+ get-cimclass -Namespace rootcimv2TerminalServices

 

During time I modified the original script so can be launched on machines with SQL server installed (the dlls and mof files are not on the default system locations) and exchange server.

The locations of the files may differ on future versions (this is on the Microsoft discrection) so please test largely before run on a production environment.

I hope that this be informative for you

*****************************************************

*****************************************************

@echo off

REM %% for BATCH and% without batch in cmd window

REM ===============================================

 

sc config winmgmt start= disabled

net stop sms_site_component_manager /y

net stop ccmexec /y

net stop sms_executive /y

net stop sms_server_locator_point /y

net stop sms_reporting_point /y

net stop sms_sql_monitor /y

net stop SMS_SITE_SQL_BACKUP /y

net stop SMS_SITE_VSS_WRITER /y

net stop winmgmt /y

 

echo.

echo All stopped

 

echo.

echo All stopped

echo.

ping -n 1 127.0.0.1 > NUL

 

%systemdrive%

cd “%windir%\system32\wbem”

if exist repository.old2 rmdir /s/q repository.old2

rename repository.old repository.old2

if exist repository.old rmdir /s/q repository.old

rename repository repository.old

md repository

 

echo.

echo Created new repository folder

echo.

ping -n 1 127.0.0.1 > NUL

echo.

echo register wbem dll’s

echo.

 

for /f %%s in (‘dir /b *.dll’) do regsvr32.exe /s %%s

 

wmiprvse /regserver

winmgmt /regserver

 

echo.

echo register winmgmt and wmiprvse

echo.

ping -n 1 127.0.0.1 > NUL

 

regsvr32 /s /n /i “%windir%\system32\userenv.dll”

ping -n 1 127.0.0.1 > NUL

regsvr32 /s /n /i “%windir%\system32\scecli.dll”

ping -n 1 127.0.0.1 > NUL

regsvr32 /s /n /i “%windir%\system32\scesrv.dll”

ping -n 1 127.0.0.1 > NUL

 

echo.

echo Restart winmgmt

echo.

 

sc config winmgmt start= auto

net start winmgmt

 

echo.

echo Waiting 30 seconds until winmgmt is full restarted

echo …. then we will use mofcomp for register the mof files

echo.

ping -n 30 127.0.0.1 > NUL

 

for /f %%s in (‘dir /b *.mof *.mfl’) do mofcomp %%s

 

cd “%windir%\ccm”

for /f %%s in (‘dir /b *.mof *.mfl’) do mofcomp %%s

 

on error resume next

 

echo.

echo check if SQL 2005 mof file exist

echo.

mofcomp “%ProgramFiles%\Microsoft SQL Server\90\Shared\sqlmgmproviderxpsp2up.mof”

 

echo.

echo check if SQL 2008 mof file exist

echo.

mofcomp “C:\Program Files (x86)\Microsoft SQL Server\100\Shared\sqlmgmproviderxpsp2up.mof”

 

rem echo.

rem echo check if Exchange files exist

rem echo.

rem mofcomp exwmi.mof

rem mofcomp -n:root\cimv2\applications\exchange wbemcons.mof

rem mofcomp -n:root\cimv2\applications\exchange smtpcons.mof

rem mofcomp -n:root\cimv2\applications\exchange msgtrk.mof

rem mofcomp exmgmt.mof

 

net start ccmexec

 

 

echo.

echo.

echo ALL done

pause

*****************************************************

*****************************************************

El cliente ConfigMgr y los métodos WMI

El cliente de ConfigMgr controla las acciones a realizar en la máquina llamando a métodos WMI, lo podemos confirmar en el log scheduler.log donde podemos ver algunas de ellas.

 

Sending message for schedule ‘Machine/{00000000-0000-0000-0000-000000000021}’ (Target: ‘direct:PolicyAgent_RequestAssignments’, Name: ”)        Scheduler        22/05/2016 20:17:45        9072 (0x2370)

 

Por lo tanto, aparte de las acciones de la consola del cliente en el panel de control, podemos realizar otras muchas acciones que no aparecen en ella indicada, incluso llamar otros metodos WMI que pueden ayudarnos en la solucion de problemas, como podemos ver en este pantallazo de WMIExplorer:

WMIExplorer_Methods

Para lanzar estas acciones bastará llamar a los metodos WMI que los inician, esto podremos hacerlo desde wmiconfig, el cmd mediante wmic, o desde powershell, segun el grado de posible automatización que deseemos añadir, eso sí, recordad que tenemos impersonar la cuenta local de sistema, por lo que necesitaremos psexec para lanzar un cmd/powershell con este usuario.

 

Por ejemplo:

psexec -i -d -s c:\windows\cmd.exe

psexec -i -d -s %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe

 

Los métodos para las acciones disponibles están documentados en:

https://blogs.technet.microsoft.com/charlesa_us/2015/03/07/triggering-configmgr-client-actions-with-wmic-without-pesky-right-click-tools/

 

Pero aquí sólo aparecen métodos con WMIC, encontré otro post con ejemplos para PowerShell de forma que sea posible automatizarlo, o incluso crear herramientas con ello, sin necesidad del SDK (ejemplo con hardware inventory y una variable $computer que da mas flexibilidad al script, también podemos crear una variable $strMethod para flexibilizar las acciones a realizar):

 

 

ref: http://myitforum.com/articles/40/view.asp?id=11731

$strComputer = “”

$SMSCli = [wmiclass] “\\$strComputer\root\ccm:SMS_Client”

$SMSCli.TriggerSchedule(“{00000000-0000-0000-0000-000000000001}”)

 

 

$strComputer = “”

$strMethod = “”

$SMSCli = [wmiclass] “\\$strComputer\root\ccm:SMS_Client”

$SMSCli.TriggerSchedule(“{$strMethod}”)

 

$strComputer = “computername”

$strMethod = “{00000000-0000-0000-0000-000000000001}”

$SMSCli = [wmiclass] “\\$strComputer\root\ccm:SMS_Client”

$SMSCli.TriggerSchedule(“$strMethod”)

 

 

Los métodos disponibles para lanzar son:

 

{00000000-0000-0000-0000-000000000001} Hardware Inventory

{00000000-0000-0000-0000-000000000002} Software Inventory

{00000000-0000-0000-0000-000000000003} Discovery Inventory

{00000000-0000-0000-0000-000000000010} File Collection

{00000000-0000-0000-0000-000000000011} IDMIF Collection

{00000000-0000-0000-0000-000000000012} Client Machine Authentication

{00000000-0000-0000-0000-000000000021} Request Machine Assignments

{00000000-0000-0000-0000-000000000022} Evaluate Machine Policies

{00000000-0000-0000-0000-000000000023} Refresh Default MP Task

{00000000-0000-0000-0000-000000000024} LS (Location Service) Refresh Locations Task

{00000000-0000-0000-0000-000000000025} LS (Location Service) Timeout Refresh Task

{00000000-0000-0000-0000-000000000026} Policy Agent Request Assignment (User)

{00000000-0000-0000-0000-000000000027} Policy Agent Evaluate Assignment (User)

{00000000-0000-0000-0000-000000000031} Software Metering Generating Usage Report

{00000000-0000-0000-0000-000000000032} Source Update Message

{00000000-0000-0000-0000-000000000037} Clearing proxy settings cache

{00000000-0000-0000-0000-000000000040} Machine Policy Agent Cleanup

{00000000-0000-0000-0000-000000000041} User Policy Agent Cleanup

{00000000-0000-0000-0000-000000000042} Policy Agent Validate Machine Policy / Assignment

{00000000-0000-0000-0000-000000000043} Policy Agent Validate User Policy / Assignment

{00000000-0000-0000-0000-000000000051} Retrying/Refreshing certificates in AD on MP

{00000000-0000-0000-0000-000000000061} Peer DP Status reporting

{00000000-0000-0000-0000-000000000062} Peer DP Pending package check schedule

{00000000-0000-0000-0000-000000000063} SUM Updates install schedule

{00000000-0000-0000-0000-000000000071} NAP action

{00000000-0000-0000-0000-000000000101} Hardware Inventory Collection Cycle

{00000000-0000-0000-0000-000000000102} Software Inventory Collection Cycle

{00000000-0000-0000-0000-000000000103} Discovery Data Collection Cycle

{00000000-0000-0000-0000-000000000104} File Collection Cycle

{00000000-0000-0000-0000-000000000105} IDMIF Collection Cycle

{00000000-0000-0000-0000-000000000106} Software Metering Usage Report Cycle

{00000000-0000-0000-0000-000000000107} Windows Installer Source List Update Cycle

{00000000-0000-0000-0000-000000000108} Software Updates Assignments Evaluation Cycle

{00000000-0000-0000-0000-000000000109} Branch Distribution Point Maintenance Task

{00000000-0000-0000-0000-000000000110} DCM policy

{00000000-0000-0000-0000-000000000111} Send Unsent State Message

{00000000-0000-0000-0000-000000000112} State System policy cache cleanout

{00000000-0000-0000-0000-000000000113} Scan by Update Source

{00000000-0000-0000-0000-000000000114} Update Store Policy

{00000000-0000-0000-0000-000000000115} State system policy bulk send high

{00000000-0000-0000-0000-000000000116} State system policy bulk send low

{00000000-0000-0000-0000-000000000120} AMT Status Check Policy

{00000000-0000-0000-0000-000000000121} Application manager policy action

{00000000-0000-0000-0000-000000000122} Application manager user policy action

{00000000-0000-0000-0000-000000000123} Application manager global evaluation action

{00000000-0000-0000-0000-000000000131} Power management start summarizer

{00000000-0000-0000-0000-000000000221} Endpoint deployment reevaluate

{00000000-0000-0000-0000-000000000222} Endpoint AM policy reevaluate

{00000000-0000-0000-0000-000000000223} External event detection

 

Espero que os resulte de utilidad.

ConfigMgr Client and WMI methods

ConfigMgr client controls the actions to be performed on the machine calling WMI methods, we can confirm this on the log scheduler.log, where we can see some of them.

 

Sending message for schedule ‘Machine / {00000000-0000-0000-0000-000000000021}’ (Target: ‘direct: PolicyAgent_RequestAssignments’ Name ”) Scheduler 5/22/2016 20:17:45 9072 (0x2370)

Therefore, apart from the actions of the client console in the control panel, you can perform many other actions that do not appear in it indicated, or even call other methods that allow some troubleshooting on the client (review on WMI as this may depend on the client version), the options on my lab shown with WMIExplorer:

WMIExplorer_Methods

To launch these actions you may call WMI methods, you can do so from wmiconfig, cmd by calling wmic, or from PowerShell, according to the degree of automation you want to add, but please, remember that we need  impersonating local account system, so we need psexec to launch a cmd/powershell with this user.

 

For example:

psexec -i -d -s c:\windows\cmd.exe

psexec -i -d -s %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe

 

Methods available are documented at:

https://blogs.technet.microsoft.com/charlesa_us/2015/03/07/triggering-configmgr-client-actions-with-wmic-without-pesky-right-click-tools/

 

But here only appear how to call WMIC methods , I found another post with PowerShell examples, so we may have some kind of automation, or even create tools without SDK (example inventory hardware and a variable $strComputer which gives more flexibility to the script, we can also create a variable $strMethod to relax the actions to be taken):

 

ref: http://myitforum.com/articles/40/view.asp?id=11731

$strComputer = “”

$SMSCli = [wmiclass] “\\$strComputer\root\ccm:SMS_Client”

$SMSCli.TriggerSchedule(“{00000000-0000-0000-0000-000000000001}”)

 

$strComputer = “”

$strMethod = “”

$SMSCli = [wmiclass] “\\$strComputer\root\ccm:SMS_Client”

$SMSCli.TriggerSchedule(“{$strMethod}”)

 

$strComputer = “computername”

$strMethod = “{00000000-0000-0000-0000-000000000001}”

$SMSCli = [wmiclass] “\\$strComputer\root\ccm:SMS_Client”

$SMSCli.TriggerSchedule(“$strMethod”)

 

The methods available are:

 

{00000000-0000-0000-0000-000000000001} Hardware Inventory

{00000000-0000-0000-0000-000000000002} Software Inventory

{00000000-0000-0000-0000-000000000003} Discovery Inventory

{00000000-0000-0000-0000-000000000010} File Collection

{00000000-0000-0000-0000-000000000011} IDMIF Collection

{00000000-0000-0000-0000-000000000012} Client Machine Authentication

{00000000-0000-0000-0000-000000000021} Request Machine Assignments

{00000000-0000-0000-0000-000000000022} Evaluate Machine Policies

{00000000-0000-0000-0000-000000000023} Refresh Default MP Task

{00000000-0000-0000-0000-000000000024} LS (Location Service) Refresh Locations Task

{00000000-0000-0000-0000-000000000025} LS (Location Service) Timeout Refresh Task

{00000000-0000-0000-0000-000000000026} Policy Agent Request Assignment (User)

{00000000-0000-0000-0000-000000000027} Policy Agent Evaluate Assignment (User)

{00000000-0000-0000-0000-000000000031} Software Metering Generating Usage Report

{00000000-0000-0000-0000-000000000032} Source Update Message

{00000000-0000-0000-0000-000000000037} Clearing proxy settings cache

{00000000-0000-0000-0000-000000000040} Machine Policy Agent Cleanup

{00000000-0000-0000-0000-000000000041} User Policy Agent Cleanup

{00000000-0000-0000-0000-000000000042} Policy Agent Validate Machine Policy / Assignment

{00000000-0000-0000-0000-000000000043} Policy Agent Validate User Policy / Assignment

{00000000-0000-0000-0000-000000000051} Retrying/Refreshing certificates in AD on MP

{00000000-0000-0000-0000-000000000061} Peer DP Status reporting

{00000000-0000-0000-0000-000000000062} Peer DP Pending package check schedule

{00000000-0000-0000-0000-000000000063} SUM Updates install schedule

{00000000-0000-0000-0000-000000000071} NAP action

{00000000-0000-0000-0000-000000000101} Hardware Inventory Collection Cycle

{00000000-0000-0000-0000-000000000102} Software Inventory Collection Cycle

{00000000-0000-0000-0000-000000000103} Discovery Data Collection Cycle

{00000000-0000-0000-0000-000000000104} File Collection Cycle

{00000000-0000-0000-0000-000000000105} IDMIF Collection Cycle

{00000000-0000-0000-0000-000000000106} Software Metering Usage Report Cycle

{00000000-0000-0000-0000-000000000107} Windows Installer Source List Update Cycle

{00000000-0000-0000-0000-000000000108} Software Updates Assignments Evaluation Cycle

{00000000-0000-0000-0000-000000000109} Branch Distribution Point Maintenance Task

{00000000-0000-0000-0000-000000000110} DCM policy

{00000000-0000-0000-0000-000000000111} Send Unsent State Message

{00000000-0000-0000-0000-000000000112} State System policy cache cleanout

{00000000-0000-0000-0000-000000000113} Scan by Update Source

{00000000-0000-0000-0000-000000000114} Update Store Policy

{00000000-0000-0000-0000-000000000115} State system policy bulk send high

{00000000-0000-0000-0000-000000000116} State system policy bulk send low

{00000000-0000-0000-0000-000000000120} AMT Status Check Policy

{00000000-0000-0000-0000-000000000121} Application manager policy action

{00000000-0000-0000-0000-000000000122} Application manager user policy action

{00000000-0000-0000-0000-000000000123} Application manager global evaluation action

{00000000-0000-0000-0000-000000000131} Power management start summarizer

{00000000-0000-0000-0000-000000000221} Endpoint deployment reevaluate

{00000000-0000-0000-0000-000000000222} Endpoint AM policy reevaluate

{00000000-0000-0000-0000-000000000223} External event detection

 

I hope that this have been informative for you.