FredBainbridge

Pester - TestGroups Stack Corrupted

Exception calling "LeaveTestGroup" with "2" argument(s): "TestGroups stack corrupted: Expected name/hint of '$name','$hint'.. Found '[context]','Context'." $pester.LeaveTestGroup($testScript.Path, 'Script') This is caused when your function is calling “exit” while testing. Or at least it did in my case. Properly mock whatever is calling exit or find a way to not use exit! Look at the source code here for hints as to what is actually happening. Pester makes sure it is still in the context it started as before leaving a test group. Read more →

Import-SMAModule fails!

When using Import-SMAModule you get a wild error. Import-SMAModule : Could not import the module []: System.Data.Services.DataServiceClientException: The underlying connection was closed: An unexpected error occured on a receive. ---> ... Make sure the module you are importing is a zipped folder with the proper module files! This is clearly documented. :) Read more →

Hosting my blog in Azure

Operation Goodbye Wordpress. Notes on my blog migration. Requirements My main motivation for migration my website was primarily to get off the WordPress platform. I found myself spending as much or more time maintaining the site as opposed to creating content and after getting hacked a few times I decided enough was enough, time to make a change. My requirements were as follows: Easy to maintain static website. I want whatever ends up being published to be nothing more than html and css files. Read more →

Uninstall the OMS Agent

Just keeping this here for future use. This will remove the OMS client / Microsoft Management Agent. Cheers! $App = Get-WmiObject -Query 'select * from win32_product where ` IdentifyingNumber = "{742D699D-56EB-49CC-A04A-317DE01F31CD}"' $App.Uninstall() Read more →

Implementing a Sample ConfigMgr Web API

The following steps get you a working WebAPI that can show data retrieved from a ConfigMgr database. The project is hosted at https://github.com/fredbainbridge/CMWebAPI. Prerequisites: ASPNET Core GIT Visual Studio Code C# extension You need remote TCP Connectivity to the ConfigMgr database. (probably port 1433 ) Implementing a simple yet awesome ConfigMgr Web API. Clone the repository From PowerShell or commadn prompt run: git clone https://github.com/fredbainbridge/CMWebAPI This will create a folder named CMWebAPI containing all the source code. Read more →

Getting Starting with a ConfigMgr WebAPI

Accessing portions of your ConfigMgr database via a webAPI can really open some doors for some pretty spectacular solutions and of course some nifty automation. Most of the automation “low hanging fruit” for WebAPI usage is during OSD. You can do things like combine data from an asset management system and the CM database to do things like name the device, select appropriate applications, place the device in a proper OU, validate it is corporate owned, etc etc… if you can think it up and you have the data available to you, you should be able to right the logic into your web API. Read more →

Download Office 2016 Updates Easier

I am a firm believer of keeping your Office installation source fully patched. This can reduce your deployment time and increase security while improving the end user experience. I have written a simple script that downloads all required Office 2016 x86 software updates using a list of updates I have published and data pulled from ConfigMgr based on entries in that list. I have a previous blog post on how to do this using ConfigMgr to search for available software updates download them to a deployment package, remove any problem updates and then extract the MSP files. Read more →

Windows Update Analytics not syncing with ConfigMgr (1610 fast ring)

Problem After configuring ConfigMgr to integrate with Windows Update Analytics no data appears in the console after potentially days and days. Upon inspection the DMPDownloader.log has the following: OMS Upgrade Analytics are not enabled And the SMS_CLOUDCONNECTION.log: ERROR: Found exception Microsoft.ConfigurationManager.CommonBase.CMException: Worker assembly doesn't exist Microsoft.ConfigurationManager.CloudConnection.Telemetry, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.~~ at Microsoft.ConfigurationManager.TaskExecutionManager.TaskExecution.Initialize (String componentName) ... Failed to initialize worker with error = Unknown error 0x80131500 Resolution After way too much troubleshooting I found my problem. Read more →

Finding and Removing Unused ConfigMgr Drivers

This is this the third and final part of my series on driver management in ConfigMgr. Part 1 can be found here. Part 2 can be found here. The script can be found here. Driver Cleanup Have you ever tried to clean up old or unused drivers in ConfigMgr and quickly became overwhelmed? It can become pretty hard to determine what drivers are truly not in use since if you attempt to import drivers that already exist, which is pretty common, you can quickly run into drivers that are in several driver packages and driver categories which can make for a challenging puzzle to unravel. Read more →