SDK and PowerShell
18 TopicsUsing REST API to get / set device variables
Hi, I'm trying to set a couple of variables against a machine name, through using the REST API. These are the variables that are set that you can see in the console if you right click properties on a device and go to the 'Variables' tab. These are handy because they can later be referenced during Task Sequences / OSD. I just can't figure out how to do it with the REST API. I have no issues doing it with the powershell module using the 'New-CMDeviceVariable' command, but my solution i'm building at the moment requires the solution to be done with rest api, not with ps modules... I can connect to REST API using powershell using commands such as the below. This all works fine. $ConfigMgrServerURL = "https://SCCMserver.domain.local" $MachineName = "MachineName1" # Following command is a sample GET request, which works. (Invoke-RestMethod -Method Get -Uri "$ConfigMgrServerURL/AdminService/wmi/SMS_R_System?`$filter=Name eq '$MachineName'" -Credential $Credential) #I can also fetch "Custom Properties" via this command (Invoke-RestMethod -Method Get -Uri "$ConfigMgrServerURL/AdminService/v1.0/Device($ResourceID)/AdminService.GetExtensionData" -Credential $Credential) Now i just can't see where i can go to set a variable on the machine. Does anyone have any ideas ? Thanks!37Views0likes0CommentsAdminService add/delete rules in collection
Hi I'm trying to add and delete devices from a collection via AdminService on Configuration manager 2203 from PowerShell. When I try the below command I receive an error Invoke-RestMethod -Method Post -Uri "https://<ServerName>/AdminService/wmi/SMS_Collection('<CollectionID>')/AdminService.AddMembershipRule" -Credential $Credentials -Body "{'collectionRule':{'RuleName':'<DeviceName>'}}" -ContentType "application/json" Error: Invoke-RestMethod : {"error":{"code":"500","message":"An error with description \"Could not get CCollectionRule* from instance\" occurred when performing MethodExecution operation on WMI class: SMS_Collection."}} At line:1 char:1 Error log AdminService.log Management exception caught: Could not get CCollectionRule* from instance System.Management.ManagementException: Not found at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode) at System.Management.ManagementObject.InvokeMethod(String methodName, ManagementBaseObject inParameters, InvokeMethodOptions options) at Microsoft.ConfigurationManager.AdminService.ManagementObjectAbstraction.InvokeMethod(String methodName, IManagementBaseObject inParams, InvokeMethodOptions invokeOptions, WindowsIdentity windowsIdentity) I get the same error if I try to delete a device from a collection. Anybody able to help ?? Regards Martin1.8KViews0likes1CommentUpdate 2203 for Microsoft Endpoint Configuration Manager current branch is now available
Update 2203 for Microsoft Endpoint Configuration Manager current branch is now available. One of the exciting new features is the content distribution status visualizer. With it you can now monitor content distribution path and status in a graphical format.31KViews7likes11CommentsOrganize packages and update groups in Configuration Manager TP 2202
Update 2202 for the Technical Preview Branch of Microsoft Endpoint Configuration Manager has been released. In this release, Admins will be able to organize packages and update groups in a much better way using folders.13KViews3likes3CommentsUpdate 2111 for Microsoft Endpoint Configuration Manager current branch is now available
Update 2111 for Microsoft Endpoint Configuration Manager current branch is now available. We are excited to announce that two popular pre-release features, orchestration groups and application groups are now full features in this release.33KViews3likes8CommentsApplication approval improvements in ConfigMgr 1810
We have added several new improvements to application approvals in Configuration Manager current branch 1810. Machine-based pre-approved requests (SDK only) Re-approve a previously denied application request (SDK only) Email notifications for application approval requests including CMG support to enable approving the application outside of the internal network23KViews3likes10CommentsImprovements to the Windows Servicing Dashboard in Configuration Manager Technical Preview 2111
Update 2111 for the Technical Preview Branch of Microsoft Endpoint Configuration Manager has been released. We now display a Windows 11 Latest Feature Updates chart in the Windows Servicing dashboard.11KViews1like0CommentsUse Windows Update native experience with Configuration Manager Technical Preview 2105.2
Update 2105.2 for the Technical Preview Branch of Microsoft Endpoint Configuration Manager has been released. When installing software updates from Configuration Manager, you can now choose to use the native Windows Update interface and restart experience.30KViews4likes4CommentsDownload baselines from Community hub in Configuration Manager Technical Preview 2103
Update 2103 for the Technical Preview Branch of Microsoft Endpoint Configuration Manager has been released. Community hub now supports contributing and downloading configuration baselines including the child configuration items. This integration allows administrators to easily share and reuse configuration baselines and configuration items11KViews0likes2Comments