Jump to content


Mimic ADR with Powershell Script

Recommended Posts

So I'm trying to better automate my update process in SCCM 2012 R2 SP1. Right now I have an ADR that runs in the evening on Patch Tuesday that finds the appropriate updates based on update classification, product, date, not expired or superseded. It downloads the updates it finds into the Deployment Package, creates a new SUG for the month and deploys it out to the first pilot group. Then the next morning I come in and change the name of the SUG and the deployment to meet the naming standard, deploy it out to the remaining pilot and prod groups and email the end users affected in each group. I know I can use powershell to automate the deployment to the additional groups that I currently do manually. I could probably even automate the renames and the email notifications.


The question I have not been able to find an answer for though is can I script what the ADR is doing with powershell? Can I script out finding the appropriate updates based on the search criteria (product, classification, date, etc) and create a SUG and do all of this all in one self contained PS script setup as a scheduled task? I've looked through the PS cmdlets but have not found a way to search for the applicable updates based on the criteria like i can in the ADR wizard.

Share this post

Link to post
Share on other sites

cleaning up old posts


I did look into using WMI to directly query for new updates in the script however I ended up leaving an ADR in SCCM and have the script invoke it to run. I felt that it was easier to set the criteria (or update the criteria in the future) in the ADR itself than to have to retool the WMI query in the script every time it needs a change.


The rest of the script then queries the SUG the ADR creates, takes the updates found in the SUG, creates a new SUG with a specific name, deploys the new SUG to appropriate collections with the agreed upon availability/deadline times for those users, deletes the ADR created SUG, and emails a notification to me with the log of the script. I have some alternate parts in the script that will consolidate any of the monthly SUGs into a baseline after they are 3 months old and deploy any baselines to the same list of collections that do not have the baselines already deployed.


I also have some scripts that will email notifications to the end users when the updates are available to them and a reboot reminder the day of the deadline.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.