r/SCCM • • 1d ago

Anyone using Claude code?

Anyone using Claude code with powershell for sccm or other sys admin roles?

I've been fairly impressed with what it can do, assuming you have the proper read access and start off carefully. Just curious what the community has been doing with it because I don't see much online about it.

13 Upvotes

54 comments sorted by

47

u/Soltkr-admin 1d ago

I haven’t allowed Claude to actively do anything yet but it’s really great at reading my SCCM logs and pinpointing issues I am troubleshooting.

16

u/JerikkaDawn 1d ago

This is what I've been doing with the Github Copilot app actually. The only time I look at SCCM logs now to confirm what it's telling me or if it's a one-off I can figure out with a glance at AppEnforce.log or something.

But if I'm really trying to drill down on what caused an issue, it seems the SCCM logs were made for AI. No way I have enough time to correlate the same event across 3-6 different log files and also resolve ModelIDs to app names. Frack that, the cylon can do it. Troubleshooting SCCM client issues has been orders of magnitude easier and quicker.

5

u/Soltkr-admin 1d ago

So say we all

2

u/noaccess 1d ago

I've had great luck with it asking it about high-level infrastructure questions, overlapping boundary groups, viewing OSD logs after imaging and comparing that to task sequences, and validation that content is distributed properly. It's very thorough and very quick, and this is just read-only access.

5

u/Soltkr-admin 1d ago

Yeah it really helped me troubleshoot some annoying pxe boot issues we were having. Gave it the logs and it pointed right at the problem and walked me through a fix

1

u/JamesJoens 23h ago

Used it to analyze my pkgxfer logs when I was trying to figure out a ton of errors. Turned out infosec removed our crowdstrike exclusions and it was hosing up large packages like driver packages.

1

u/Gummyrabbit 1d ago

I’ve been using AI to look through my logs when I’m troubleshooting issues. It’s really good for that.

8

u/SuperMangMang 1d ago

I'm not allowed to use anything agentic in my real work but I have it doing lots of admin on my home network including configmr lab.

I've been building a gateway as a control point and to manage credentials, log all actions etc. Using it as an opportunity to learn how to implement agentic tools securely.

Its all honestly amazing

14

u/An0mymou5 1d ago

Yeah, it's been a massive, massive help for SCCM, AD and general sysadmin work. Been giving some of our older scripts a some polish and smarts. Most recently I completely revamped our patch remediation script to give it a lot of smarts that apply a different set fixes based on the SCCM error code, as well as giving it a fancy GUI dashboard - which also doubles up as a replacement for the Monitoring tab (which is slow and clunky and doesn't summarize the whole deployment).

In terms of SCCM, I've written a whole bunch of functions/modules that are way, way faster than the official powershell module which is slow and a PITA to use (like... why do I even need to switch to a "site:" drive first, completely pointless).

Have also used it to troubleshoot WMI corruption issues on devices. In the past I'd blow away the whole repository (when /salvage fails) which is less than ideal of course, but now I'm able to do surgical fixes like recompiling the exact MOFs/dlls that's broken.

Wrote scripts that do proper clean driver uninstalls for some tricky drivers, scripts that pull up the driver versions and paths for a particular class of device (like audio, graphics etc) which makes it easy to compare and verify driver versions. Bunch of scripts for secure boot CA2023 remediation. Bunch of scripts to do a clean uninstall and reinstall of tricky apps like Teams. And several other, way too many to name.

2

u/DonkestHour 1d ago

This is cool. Do you have a GitHub for these scripts?

14

u/An0mymou5 1d ago • Bravo

Thanks, they're not on GH yet but planning to publish them soon after giving 'em a bit more polish. Will post in this sub when done.

1

u/zlatan77 20h ago

This is cool and interested in the CM remediation you shared.

1

u/ipreferanothername 18h ago

the sccm official module is definitely meh, on its best day. respect for doing all this work. ive done a moderate amount of sccm scripting because i just want to do as little as i can with the product and then do other work on my list.

1

u/Far_Goal_2670 1d ago

Im very interested in your patch remediation thing. Looks great and something Im curious of building very soon.

13

u/tabris-angelus 1d ago

I'm thinking about getting Claude to create a SCCM MCP server.

I've connected the Microsoft learn connector to Claude and it's real good at creating scripts for SCCM

0

u/SuperMangMang 1d ago

I haven't decided if an MCP server is worth it for me yet. It works really well just being able to run PowerShell remotely.

Obviously a ConfigMgr MCP server would constrain the available tools, but that would be a double edged sword I think

4

u/Maleficent-Umpire201 1d ago

Im running a custom system management portal on top of wsus with backend powershell. Connected claude code in VS code and acting as a IDE.

So I have my entire fleet(azure and onprem) servers and vms in control.

I also have made a agent which is running on these servers for patch control, automatic software deployment, monitoring and reporting.

Ultimately its a vibe coded app but tested by internal red team.

0

u/Reaction-Consistent 1d ago

sounds like you reinvented the CM client! Does your system mgm portal use the CM admin service at all?

2

u/Maleficent-Umpire201 16h ago

Exactly. I dont have any working experience with sscm but wsus was best suitable for us. So on top of this wsus, using the custom made automation system management portal, im able to achieve lot more.

The ultimate Goal is to add some intelligent around that(not AI) and let the portal handle admin task(not destructive) by it self without my intervention.

Kind of achieved already but hope I complete soon and get the complete application tested by security once again.

4

u/Reaction-Consistent 1d ago

I run claude with no restrictions in a hyper-v lab, with the Microsoft 0365 windows deployment hydration kit. I have it develop various tools for me in there, test them in a moc environment, then I sync the code with my github, and finally deploy it in my prod environment, after approval. I have made a CM maintenance app (to help identify/remove old/unused apps, packages, collections, etc.) a driver packaging automation tool (similar to modern driver management...but the difference is, this one works with our security apps with no problems or adjustments.) I made an OS patching tool - again, similar to others, but tailored to a wider variety of OS versions and with a few other enhancements that we needed. I'm working on a 3rd party app packaging tool (yep, those are out there as well..but they all have some aspect that presents a challenge or complexity we just don't want to deal with or work around because it requires additional security adjustments.) Claude works fast, spits out working code every time...tested, ready to go. It's been an amazing tool to work with for sure!

1

u/NysexBG 1d ago

I am interested in the maintenance app and driver tool. You mind telling us/me more?

2

u/Reaction-Consistent 20h ago

Ok, so here's two of my projects, not perfect by any means, but they work for what I need them to do - and they don't have a ton of prereqs, which is kind of where I start with my prompts to claude - I hate having to adopt new apps, services, or introduce new 3rd party tools in my environment - namely because they all represent potential security issues and/or require additional FW rules or other allowances to even let them function in our systems which have a million security agents, gateways, etc. watching/blocking every other packet/process...anyways:

CM Maintenance App

CM Driver Packaging Tool

3

u/Reaction-Consistent 20h ago

the CM Maintenance App helps us untangle the references, dependencies that abound in CM objects - applications with zero deployments, collections with no includes/excludes/deployments/limiting collections or other collections that reference them...it gathers the current inventory from Cm and the CM SQL DB, populates what amounts to an excel table that can easily be filtered, sorted, exported, and even mark collections to be deleted - back up those collections do a what-if deletion, restore those collections if needed, etc. all in the readme!

2

u/Reaction-Consistent 20h ago

the CM Driver Packaging Tool is a clone of the Modern Driver Management Tool, but with some changes that allow it to work in our environment. To be honest, I've only used it to automate the creation of some new driver packages, but I select the option for a standard package and a .wim file, rather than a standard driver package - the .wim provides a fantastic compression ratio, is 10x faster to import into CM, doesn't clutter the CM driver database and has been pretty much 100% successful in its implementation in our OSD task sequences. it does allow the creation of standard driver packages - all from automatically downloaded enterprise driver packs from your favorite vendors - HP LENOVO DELL :) . it has a complete system for pilot testing, a scheduled task for updating/promoting driver packages from dev to prod - it's those features I haven't really utilized yet, but I plan to.

1

u/Reaction-Consistent 22h ago

Certainly! I’ll send some info after I eat breakfast lol. I will probably just clone them to a new public repo and share the link.

1

u/leb4life69 21h ago

How do you learn to come up with that? Is just experience coding?

2

u/Reaction-Consistent 20h ago

I saw a need (mine) and an opportunity to vibcode the solutions. these all started as simple, one .ps1 file scripts that did...something..., then I told claude to take a look at my crap code which I orriginally came up with from copilot, prompted some added improvements...it made the changes, I copied the code to a test lab and started manually testing each. Then a buddy of mine (who is NOT an SCCM admin, but loves to vibecode solutions for his own IT work) told me he created a full VM lab for his own code testing, installed claude code and gave it permission to do whatever it needed to do in that lab environment. So I decided to give that a try myself, as scary as it sounded. So, with additional prompts to claude and some other github repos as examples of where I wanted to take my own project, given directly to claude in my project space - I just iterated the code until it did exactly what I wanted it to do. no real coding experience, and I'm sure I'm doing this all wrong, but I'm having a blast, and learning how to improve the whole process day by day. I think most people assume you need some sort of software engineering/coding background to do this stuff, you don't. I did have some powershell, sql, basic scripting experience (you kinda have to as an SCCM admin..) and that was enough to give me some confidence with make some more advanced stuff. Advanced for me...my projects are tame in comparison to some of the stuff my collegues are doing, hell, even my son vibe-coded his way into an e-commerce admin position for which he had nearly zero experience with! Be BOLD! hahah....enjoy the creative process, because that's all it really is man.

12

u/redvelvet92 1d ago

Uhhh yeah and at this point I’m thinking I’ll use it to build a better SCCM.

8

u/SokkaHaikuBot 1d ago

Sokka-Haiku by redvelvet92:

Uhhh yeah and at this

Point I’m thinking I’ll use it

To build a better SCCM.


Remember that one time Sokka accidentally used an extra syllable in that Haiku Battle in Ba Sing Se? That was a Sokka Haiku and you just made one.

2

u/amreagan 21h ago

Apparently even AI can't fix whatever they did wrong with the 2609 update, even though AI probably caused it.

0

u/h0serdude 1d ago

Do it! I did.

0

u/NysexBG 1d ago

Make SCCM better and most importantly make no mistakes.

3

u/Xrora 1d ago

Not Claude but after I fed it the proper logs, copilot told me the reason sccm can't patch 2025 with offline servicing is that the label for the image is another product code and that's why it can't find any patches for it.

3

u/dgmayor 23h ago

I use Claude daily, but I'm not quite ready to use Claude code and connect it with anything.. I still do everything in the base Claude on the web and copy/paste any code into a new file.

It's been remarkable, to be honest. I'm just not going to hand it the keys to anything directly.

5

u/FactorFear74 1d ago

No

1

u/Reaction-Consistent 1d ago

What do you mean by connect?? If you mean...can it interact with/control CM...absolutely. Does it have api level connection? no. but it uses everything we use to control cm..powershell, wmi, CM admin console, etc.

2

u/turboturbet 1d ago

Yes being used Claude and gemini with psadt v4 app packaging and task sequences like driver scripts, variables, front-end for naming etc and bios management

2

u/Tilt23Degrees 22h ago

anyone who isn't doing this at this point is going to be without a job in a year

2

u/eqtitan 16h ago edited 16h ago

Yes, daily, for about a year. Enterprise Windows environment: ConfigMgr + Intune co-management, PSADT, GPO/AD. Some of what it's helped with:

Infrastructure

  • Site server migration to Server 2025, plus several ConfigMgr version upgrades
  • Content library move to a NAS: one script with Discovery / DryRun / Production modes and dozens of pre-flight gates, live progress monitoring from distmgr.log, then a separate cleanup script for the old library
  • Tracked down a big gap in NAS storage that turned out to be snapshots holding old site DB backups
  • Cleaning up hundreds of source paths that still pointed at an old server
  • Retiring unused task sequences and apps, with an audit mode, safety gates and rollback built in

Packaging / deployment

  • Large multi-component workstation package (PSADT, with an on/off switch for each component) that cut cost and setup time
  • VPN client migration and several app upgrades, all PSADT with custom detection
  • PSADT v3 → v4 migration runbook
  • Supersedence and detection fixes for agents that update themselves (product-code detection breaks when they do)
  • Mass-reboot automation with dry-run by default and a device-count cap

Troubleshooting

  • OSD task sequence reliability review: parsing smsts/AppEnforce logs across failed builds turned up several unrelated root causes
  • Prep for a vendor support case: dump capture plan, plus log analysis to pin down the retry pattern
  • GPO inventory to plan a migration from a third-party policy tool to Intune

Run books / docs

  • Welcome packet for a new hire's first week
  • Guide to who has access to what
  • Notes kept live during a change
  • PSADT standards template
  • Change request drafts: purpose, risk, plan, backout, testing, validation
  • Downtime and all-clear emails, SOP updates

What makes it work

  • Read-only first. Every script starts in audit or dry-run mode and only changes things with an explicit switch
  • Everything logs, exports to CSV, and zips the run folder so I can feed the results back in
  • I run everything myself, without elevation unless it's needed
  • Nothing touches production without a change request and a backout plan
  • Custom skills for our stack and change process so I'm not re-explaining the environment every time
  • No sensitive data or credentials go into prompts

Biggest lesson: it's great at log parsing and building scripts with guardrails. Still review every line. It will confidently assume things about your environment until you correct it.

  • Thanks Claude (Pro) for creating it from. "Hey bud, there are some people that are part of our community that may be interested in the things that we've created. Can you create a response for this reddit post <link>"

2

u/siconic 9h ago

It's AMAZING for day to day SCCM and Powershell. You won't regret it. At $30/minth, I almost never cap out my tokens.

1

u/74Yo_Bee74 1d ago

What level Claude are you using.

1

u/Reaction-Consistent 1d ago

I'm on the basic $20 plan, perfect for what I do with it.

1

u/meesersloth 1d ago

It’s helpful for niche stuff I use.

1

u/Incrediblecodeman 1d ago

Can Claude connect to sccm or ?

1

u/bearded-beardie 1d ago

I use GitHub Copilot and Google Antigravity extensions to write code and scripts frequently. It's definitely sped up my workflow considerably as it can type a lot faster than I can. I've generally found the coding works best if you actually know what you're doing and can accurately describe what you need to do. Also need to know what you're doing so you can see when it's wrong. I spend a not insignificant amount of time arguing with the AI models why they're wrong, or why it has overcomplicated a script. Especially as I'm iterating and see it leave code in there that's not actually being used after changes.

I also find that almost every time I would logically add a parameter to powershell script it doesn't do it the first go, but it'll almost always add one when I don't care about having one.

ETA: the big benefit is I can multitask while it's writing the script. Or I can fire off quick edit prompts while in a meeting.

1

u/SevenandahalfBatmans 1d ago

heck yeah. Built a new front end for my task sequences to replace UI++ that lets me set the computername, the OU, the department (listing the software that will be installed because of it), and add any misc. software needed.

Also built a wrapper for the USMT tools that lets us remotely back up profile(s) and restore them to a new computer, along with custom XMLs for those weird edge cases.

Also built a web front end so techs could track the status of their task sequences and see if any steps failed. This one is admittedly the weakest of the three tools I've built so far, having a hard time with CM consistently returning the final status of the TS.

1

u/Usual-Chef1734 23h ago

Are you kidding? I have automated ALL of that category of work.

1

u/Duffield_Najuf 23h ago

The thing that worries me is not the model being wrong. it is that we approve these scripts in about the time it takes to skim them. A two hundred line baseline script that goes out to eleven thousand machines gets a yes because it looks like the last one

In sccm the blast radius is the whole estate and there is no undo, so i am fine with it reading logs, and i am not fine with it writing anything that runs on a machine it did not build in a lab first

1

u/globalrebel 17h ago

I've been using it only in a ask it a question read its output and make a decision situations.

I can provide logs from time to time, but I would never allow it access or give it control in any way shape or form. I just don't trust any agent at this point within the access in a corporate environment.

could just be me though.

1

u/absoluteczech 1d ago

Yes it’s great but I use it for personal stuff and vibe coding personal projects. I don’t use it at work though.

-8

u/h0serdude 1d ago

I built a better version of SCCM from scratch using Claude. It's basically the best parts of PDQ and SCCM combined. Agent based, handles inventory, ACME, software deployment, and lots of other useful things.

And no, I didn't so this recklessly. Started small, constantly testing security and hardening it as I went along adding features.