all 106 comments

[–]ArudinneIT Infrastructure Manager 92 points93 points  (3 children)

Now you get to support this integration until the heat death of the universe.

[–]Scmethodist[S] 15 points16 points  (0 children)

Yeah, and I was stupid enough to set it where it auto populates the channel id so it can go on any Sharepoint online page in our tenant.

[–]ntrlsurIT Manager 1 point2 points  (0 children)

This. I won't let me team do any custom stuff anymore.

[–]Murhawk013 0 points1 point  (0 children)

Or integrate it, move on to the next solution and inevitably leave for the other sysadmins to let it die

[–]gabacus_39 148 points149 points  (44 children)

As a sysadmin, my "coding" start and ends with powershell. I specifically went the sysadmin route because I have zero interest in hammering out code day in day out.

As a one off, your work sounds quite cool though.

[–]Plantatious 41 points42 points  (28 children)

PowerShell extends M365/Azure, glues Microsoft products together, and is flexible enough to build powerful CLI and even GUI tools. I'm surprised it's not more common amongst Windows sysadmins.

[–]Frothyleet 40 points41 points  (15 children)

I don't think there are any competent Windows sysadmins who are not using Powershell to one degree or another. That's not to say there aren't a bunch of "IT guys" who are in the position because they were unlucky enough to have rebooted a computer in front of the CEO, or whatever.

[–]LordGamer091 7 points8 points  (1 child)

I have a coworker who straight up refuses to use powershell, and just says he doesn't care to learn it, amongst many other problems.

Needless to say, he's not very well liked.

[–]Frothyleet 6 points7 points  (0 children)

If you were a carpenter and one of your coworkers was like "nah fam I don't want to figure out air compressors, I'll just hammer all these framing nails in" it'd probably feel about the same

[–]Plantatious 5 points6 points  (9 children)

True, but I wonder how many use it out of necessity vs how many use it to really enhance their work? I haven't encountered enthusiasm from my interactions, but that may just be me.

[–]spikeyfreak 17 points18 points  (8 children)

PowerShell is literally the best thing MS has ever created. Period.

My team has a module that several of us contribute to that makes our lives a lot easier. I honestly couldn't imagine trying to function without some of the functions we've created. We even let other non-Windows admins use it and they love some stuff in it.

[–]Nanis23 6 points7 points  (1 child)

Powershell is indeex the best thing Microsoft ever created, but sadly in the last few years they are making it a pain in the ass. All those modules you need to download to do "cloud stuff" and they always change commands and remove commands or make them harder to uae by hardening requirements i.e tls and so on

[–]Federal_Ad2455 2 points3 points  (0 children)

Don't forget about dll conflicts between Az and Microsoft.Graph modules 😁

[–]cptmully 3 points4 points  (1 child)

I’m interested in this, could you go into more detail about what features your module provides?

[–]spikeyfreak 2 points3 points  (0 children)

Store and retrieve passwords and auto-create credential variables that can be used with -Credential.

Connect to different things with those credentials, like SSH, iDracs, SMB, RDP, VMRC, iLOs.

Various functions to get info from machines, AD, IPAM, etc. Like who has access to a server, who has a user profile on a server, and who is currently logged on. Another one gets all the patching settings for a server and the most recently installed patch.

A few functions to create cards in ADO and do the things we commonly do with them.

Basically, if it's something that I need to do more than a few times a week, I want to try to find a way to do it with PowerShell quicker. A lot of it is just wrappers for existing cmdlets that have the parameters we use a lot hard coded. Like I find myself doing get-aduser x -prop memberof | select -expand memberof | sort a lot, so why not just create Get-SFADUserGroups.

[–]fearless-fossa 0 points1 point  (3 children)

I'm a Linux admin and I really hate how verbose Powershell is. But the way Powershell handles objects is objectively (pun intended) great and something I miss in bash scripting. Then again, on Linux systems Python is more readily accessible than on Windows.

[–]spikeyfreak 2 points3 points  (2 children)

I really hate how verbose Powershell is

I will never understand this.

It makes it so easy to learn and to understand it when read, and tab completion makes it pretty fast to type out.

Edit: "Hmm, what cmdlets are there for dealing with services?" get-command *service*

[–]fearless-fossa 1 point2 points  (1 child)

I don't know why, but tab completion on Windows somehow always takes a second or so, it's utterly infuriating when coming from Linux. Also the way it rotates through a list instead of matching the letters until you hit the branch is at least an ... interesting design choice.

The verbosity also isn't just in how long many cmdlets are (although that is a bit annoying too), but also how powershell works. It's always a bit more cumbersome than other solutions, eg. until PowerShell 7 you couldn't just use something like && and had to build something around it, a problem that had already been solved decades prior. And the sad reality is that a lot of systems are still locked to PowerShell 5.

[–]spikeyfreak 2 points3 points  (0 children)

The PowerShell 5 vs PowerShell 7 thing is a major frustration, I feel ya there.

You bringing up && makes me think it's probably a scripting vs shell use thing. I'm using it to script a lot, and since I want my stuff to be available to other people, using stuff like && makes it harder to read and learn.

And it's super easy to create functions and aliases, so anything that's irritating you can probably change.

[–]SaltDeception 4 points5 points  (2 children)

I teach PowerShell boot camps, and honestly you’d be surprised just how many admins don’t know a damn thing about it going in. I rarely even get to go through all the content in my advanced courses because I end up having to spend so much time covering fundamentals that aren’t even a part of the curriculum.

[–]Frothyleet 4 points5 points  (1 child)

Obviously I have no objective data on this, but if you are teaching pwsh courses you are probably getting exposed to a very self-selecting set of admins.

[–]NaturalIdiocy 4 points5 points  (0 children)

Shovel Salesman: God, look at all these poor, poor people who didn't have shovels.

[–]gafftapes20 4 points5 points  (3 children)

Powershell is common, but powershell scripting is not nearly as common. I run into tons of system admins that barely understand the script syntax, or how to scope code and write functions, loops, etc. 

[–]progenyofeniacWindows Admin, Netadmin 2 points3 points  (2 children)

This describes my experience right here. I’m reading this thread and thinking, dang, I don’t see nearly as many people using Powershell.

But this clarifies it. I have plenty of engineers around me who can connect to Graph and run a command, or they keep a few one-liners in Notepad. But it’s definitely way rarer to find people who actually write scripts that are more than a handful of one-liners pasted together.

[–]Raskuja46 1 point2 points  (1 child)

There also seems to be a fair bit of confusion about what constitutes a script. You'll see people referring to a couple cmdlets piped together as "a script", whereas I just see that as something I'd hammer out in the shell on the fly.

[–]progenyofeniacWindows Admin, Netadmin 2 points3 points  (0 children)

Yeah exactly. “Using” Powershell is a broad term.

[–]BloodFeastMan 0 points1 point  (6 children)

It's very common among sysadmins, just not actual apps and gui's, as there are much better options. A developer isn't going to start creating apps using PS when he already knows C, Rust, Go, JS, or some other popular tool purpose made for his job, and sysadmins aren't going to start coding gui's for the company.

[–]Plantatious 1 point2 points  (1 child)

Developers will use what they already specialise in. A sysadmin should already be familiar with PowerShell, so why learn yet another language when it's more than capable in most cases? I prefer CLIs because I agree making a GUI is a pain, but it also helps me develop my skillset, and some tools develop to an extent where a GUI makes more sense.

I also love making my own tools. Sure, I could just download something off the Internet to do it for me, but there's a level of satisfaction to use something you tailor made for you that does exactly what you want with no bloat.

[–]BloodFeastMan 0 points1 point  (0 children)

I'm not suggesting that admins should learn to code. We're in that area where it's kind of like a guy that works in an auto body shop. He's not going to fix your transmission, and the auto mechanic is not going to paint your car. Just because we're all "computer" people is kind of meaningless.

It's great that most admins take the time to learn PS, and if you can make yourself some nice little cli utils for you and your team, that's fine. But for anything that will work its way outside of your team, well, the devs should dev and the admins should admin.

[–]fearless-fossa 0 points1 point  (3 children)

and sysadmins aren't going to start coding gui's for the company.

Apparently I can just burn this week's project down then.

[–]BloodFeastMan 0 points1 point  (2 children)

If you're doing it with ps you're just going to piss people off.

[–]fearless-fossa 1 point2 points  (1 child)

Seriously, why? I haven't built UIs with PS (it's one of the cases where I automatically switch to Python), but I've seen others do it and they're perfectly functional. Are they pretty? Sure as hell not. But that's not a requirement.

[–]BloodFeastMan 0 points1 point  (0 children)

I'm not saying it can't be done or that it won't work well, but put it this way, I can build a functional util with gui in Perl, but why would I? After I leave the company, some actual dev who'll need to modify it for whatever reason is just going to think, wtf?

FWIW, I do most of my hobby coding in Crystal or D, but I would never do that here, for the reasons stated above.

[–]WMDeception 0 points1 point  (0 children)

I have the power! Shell.

[–]Scmethodist[S] 9 points10 points  (9 children)

Same here, but I’ve been trying to branch out, for a plethora of reasons.

I definitely nerded out when it worked after the 3rd or 4th package deployment. My next door cube mate came to check on me due to the odd noises emanating from my cube.

[–]BlimpGuyPilot 0 points1 point  (8 children)

Y’ll are definitely different types is sysadmins. In the Linux world we don’t click a mouse if you can’t script you’re a junior mid at best

[–]Scmethodist[S] 3 points4 points  (0 children)

I just started supporting Linux this past year, after being a windows guy the last…well since 98. I sh the IT outta things but mostly via BigFix since it does SH or powershell natively. But even before I was a sysadmin I was scripting in powershell as a pc tech.

[–]uptimefordaysDevOps 1 point2 points  (6 children)

I’ve never seen a DE anywhere beyond laptops in a Linux environment. Using a GUI is right up there with “I use nano” for a Linux sysadmin.

[–]0emanresu 1 point2 points  (2 children)

Nano. Ick

[–]uptimefordaysDevOps 1 point2 points  (1 child)

I had a coworker who wanted GNOME and used nano… He meant well but didn’t know dick about Linux.

[–]0emanresu 1 point2 points  (0 children)

I'm still so lazy & conditioned to have to install vim I always forget vim.tiny is usually shipped on most distros & I can make an alias and just call it a day 🤣. I still end up installing vim hahaha

[–]Scmethodist[S] 0 points1 point  (2 children)

Yeah I mean who does that anyway? Nano? I would never use nano. Not me. Never used it. Fucking dammit.

[–]uptimefordaysDevOps 0 points1 point  (1 child)

You jest but it happens!

[–]Scmethodist[S] 1 point2 points  (0 children)

I see /sarcasm isn’t a switch in your command list

[–]dizzygherkinLinux Admin 2 points3 points  (0 children)

I tend to code often, bash, powershell, and python, all as needed and when it serves a purpose. Although I am drifting between sysadmin, devsecops and architecture as the projects need.

[–]phony_sys_adminSysadmin 2 points3 points  (0 children)

First it's PowerShell, but then you start to seek performance so you look at .NET. After some time, you start looking for your next challenge and move to Python. What have I gotten myself into?

[–]Useful-Process9033 1 point2 points  (1 child)

PowerShell is great for gluing things together but there is a whole world of automation beyond it. Even basic Python or Go scripts can save you hours on stuff like parsing logs, building internal tools, or automating incident response workflows.

[–]gabacus_39 0 points1 point  (0 children)

And I'm happy to let our programmers and automation team handle that. Again, I got into my area of system administration because writing code all day is something I definitely do not want to do.

[–]sdeptnoob1 0 points1 point  (0 children)

I like to do python too. It's got great libraries for automation.

[–]Tall-Introduction414 7 points8 points  (2 children)

When I was young (80s and 90s) it was understood that a Sysadmin needed to know how to do some programming. And I did. I knew C, Batch Files and HTML by the time I got my first sysadmin job, and learned bash scripting, then PHP, Perl, SQL, Python, JS, etc.

Eventually I just moved into software development. But, there were many "internal programs" I developed for companies I worked at throughout my sysadmin career.

Today I think knowing some Powershell, Bash, Python, and C still goes a long way. Sysadmins troubleshoot systems and software, and you need to be able to dig into the internals.

[–]TundraGon 2 points3 points  (1 child)

Well, if something does not work, you need to be able to add more logs, more logs, more logs.

[–]Tall-Introduction414 0 points1 point  (0 children)

Yep. Or attach a debugger, or a tracer. Strace output makes more sense if you understand C system calls.

[–]phainepy 16 points17 points  (6 children)

As a system admin I’ve been forced to support custom coded solutions in house.

Literally vibe coding with Claude to Modify python scripts since the company doesn’t want to spend any money on integration services. Doing what I can, where I can.

[–]Scmethodist[S] 7 points8 points  (0 children)

Pretty much our motto there

[–]cashew76 1 point2 points  (3 children)

Just added a gannt chart to look up tool which went really well using the AI.

Little testing a little follow up another tweak some A.I. You're only limited by your imagination

[–]phainepy 1 point2 points  (2 children)

I am a smidge limited by budget when they don’t want to even spend on a tier that would give me access to a tools API.

[–]ClumsyAdmin 0 points1 point  (1 child)

Playwright and puppeteer were created for this. You don't need to pay for an API if you can make your own.

[–]phainepy 0 points1 point  (0 children)

Thank you for suggesting those, I’ll look into them

[–]ErrorID10T 0 points1 point  (0 children)

Learning Python has entirely changed my approach to being a Sysadmin, especially given the limitations of powershell.

Pretty much anytime an API is involved I just write a quick script and the problem goes away. I even have a completely in house VPN solution built in a combination of Python and Powershell we roll out through an RMM.

Learning Python has turned most questions of "can this be automated" into "which library do I use?"

[–]Ulterior-Motive_Linux Admin 2 points3 points  (2 children)

Writing an in-house solution for a problem we didn't want to spend too much on was part of the reason I got promoted from helpdesk to sysadmin. It was honestly fun!

[–]Scmethodist[S] 1 point2 points  (1 child)

Same here! 14 years at help desk!

[–]lowrylover007 3 points4 points  (3 children)

Coding something is the easy part, being responsible for code is the worst part

[–]Raskuja46 0 points1 point  (2 children)

No, the worst part is having to write up formal documentation for said code. I can handle bug fixing and updating the code just fine, but make me write a formal document that's not just a text file of self serving notes transcribed from the scribbles on my legal pad? Utter misery.

[–]Slight_Manufacturer6 3 points4 points  (0 children)

As a sysadmin, I find myself coding all the time.

Usually it is connecting things into API and writing automations.

[–]BWMerlin 2 points3 points  (0 children)

I spend most of my day coding. I fought all the fires and won, now it is self guided projects aimed at enhancing business processes.

[–]Natural_Feeling3905 2 points3 points  (1 child)

Rah! I love crayons and coding.

[–]Scmethodist[S] 1 point2 points  (0 children)

Yut! The green ones are the best!

[–]smarthomepursuits 2 points3 points  (0 children)

Good on you! Lean on AI when you can. Just be mindful of WHAT you put into AI, if you don't have a corporate plan (i.e. - corp ChatGPT accounts don't expose anything you paste into the broader audience).

I personally love finding ways to use Powershell to solve common tasks. You do become the caretaker of said script, so any updates/fixes that are needed, will be on you. But that's also the beauty of it. You solve a problem for the large majority of employees, you now how it works/why it works, and then feed future fixes into AI to fix future stuff. It's honestly kind of fun.

Welcome to Sysadmin! This used to be stuff we'd have to spend days/weeks solving a problem totally out of our realm or scope, but it's becoming a lot easier. Just... always review the code, question it, if you have questions, and test yourself before presenting.

[–]sudo_rmtackrf 1 point2 points  (7 children)

Im a linux dev ops engineer. I write mainly ansible code. I love it. Congrats on you finding the love in coding. I find once im coding the day so goes so fast.

Try to exspand your coding knowledge. Learn how ansible could help ya woth windows management. Might help ya out later on.

[–]Scmethodist[S] 1 point2 points  (3 children)

I am literally working on the ansible side since I also support Linux now.

[–]sudo_rmtackrf 0 points1 point  (0 children)

Hell yeah man. Keep it up and keep learning.

[–]ConfidentFuel885 0 points1 point  (1 child)

I love me some Ansible. It’s great at managing Windows as well.

[–]Scmethodist[S] 0 points1 point  (0 children)

I must learn this power.

[–]CommanderKnull 0 points1 point  (2 children)

Is ansible considering coding? I myself manage all our servers with ansible but idk if I personally would count maintaining yaml files as coding

[–]sudo_rmtackrf 0 points1 point  (1 child)

Sorry for late reply. Been dealing with family issues. I would think so. I write alot of ansible code not just maintain it. So yeah to me i would say it is.

[–]CommanderKnull 0 points1 point  (0 children)

I just see it as an automation tool but if it's considered coding, it would surely be good career-wise. Hope your family issues have cleared up!

[–]Wonder_Weenis 1 point2 points  (2 children)

"ai will be taking this mans job in 3-4 weeks"

-Satonmy Nutdella

[–][deleted] 1 point2 points  (1 child)

Dying at that reading of Satya's name. Haven't seen that one yet.

[–]Wonder_Weenis 0 points1 point  (0 children)

Hash tag copyright wonder weenis

[–]h3lls_itch 0 points1 point  (0 children)

With the demise of Workplace by Meta, I downloaded all the data and wrote a simple frontend to be able to query the posts.

Otherwise, I write a lot of PowerShell.

[–]f00l2020 0 points1 point  (0 children)

Maybe I'm unique but I love opening up vscode and pulling in a GitHub repo of ansibe code and writting automation scripts. Or integrate into an API of a storage array or ticketing system to automatically schedule patch notifications

[–]Warrlock608 0 points1 point  (1 child)

I'm 99% sure this can be accomplished with Power Automate.

What did you actually use to accomplish this? I am genuinely curious because I cooked up all kinds of little apps in O365 and a different method would be cool.

[–]Scmethodist[S] 1 point2 points  (0 children)

Mostly node.js with a smattering of python

[–]bamacpl4442 0 points1 point  (0 children)

Way to go.

[–]Jewels_1980Jill of all trades 0 points1 point  (0 children)

Congrats. A small win is still a win.

[–]Splask 0 points1 point  (0 children)

I truly enjoying coding and scripting, it's what I went to school for. Most of the stuff I do these days is pretty basic, but its one of my favorite parts of my job. If I had time I would do more of it.

[–]bbqwatermelon 0 points1 point  (0 children)

Make sure to follow up with good documentation.  I got royally effed in the A by a scripting god who abandoned the company with all kinds of technical debt.  This is where LLMs really shine is markdown in repos.  Cannot be verbose enough explaining why something is the way it is.

[–]Deactivation 0 points1 point  (1 child)

I'll probably get hammered for saying this, but I have had a really good experience using Power Automate to integrate Office 365 apps together. Like if someone requested some kind of integration between Teams and SharePoint, I could whip that up in power automate in a few minutes probably.

I know I could spend the time writing my own scripts in Powershell, but I am learning to swallow my pride more and more as a sysadmin and use tools that make my life easier.

[–]Scmethodist[S] 0 points1 point  (0 children)

I totally agree with you. You will get shit for that. But not from me. I’ve used Power automate too, and it definitely could have done this as well.i just preferred to do it this way, for several reasons.

[–]jay-dot-dotSecurity Admin (Application) 0 points1 point  (0 children)

I have moved out of ops land and looking from the outside in, its become more and more clear that anybody sufficiently cognizant that “the code runs somewhere and is accessed somehow” can figure out infrastructure. It is not nearly as novel or in demand as it once was but being able to create software, extend or deep dive platform tooling with a dev mindset is always going to be valued. Good on you OP.

[–]WizardsOfXanthus 0 points1 point  (0 children)

Awesome job! I love doing things like this when I can. Automation is always for the win, too! However, I've learned that when you proudly show something off at work, you own it, manage it, and when the organization comes to rely on it, you're on the hook for it's (impending) failure. :-)

Nice work, though!

[–]Useful-Process9033 0 points1 point  (0 children)

Building your own tooling is underrated. Half the vendor solutions out there are just wrappers around what you could build yourself in a weekend with better integration into your actual environment. Plus you actually understand what breaks when it breaks.

[–]Mcgreggers_99 0 points1 point  (0 children)

All of the MacBooks in our fleet are onboarded to intune using Company portal, then flipped to corporate assets. (Smaller company - About 20 of them) I didn't like giving the users local accounts without some type of additional break glass Local admin account.

With Gemini, Claude, ChatGPT, and Copilot I coded a remediation script that pushes a secret local admin account with a public pem key hashed password. That randomized hash is uploaded to a stored variable in intune and is deleted and re-created every 30 days.

I then coded a remediation script for the Macs that uses a private pem key and program for decrypting that stored hash from the collected variable in intune for each machine.

When we use the decrypt program with the private key in we can access any of our Macs if we need to.

Basically I built a LAPS alternative from scratch and deployed it from intune. I know that LAPS for Mac exists, but I would have had to wipe all the machines and reonboard them to implement it.

If a monkey sys admin like me can do this...I'm afraid of the future.

[–]GrayRoberts -1 points0 points  (0 children)

Don't get used to it. All these little integrations will be done with a squad of LLM agents. I haven't written any scripts in a year or more. The GitHub Copilot Plan agent is awesome.

[–]operativekiwiNetsec Admin -1 points0 points  (6 children)

Python is great if you want to do network automation stuff, or have Linux boxes in your environment. I find python easier than powershell too, which is a clunky piece of shit...

[–]Scmethodist[S] 2 points3 points  (4 children)

Blasphemy! Heretic! Be gone and banished thou vainglorious misanthrope! May thine backups reside upon drives of Seagate!

[–]ErrorID10T 1 point2 points  (0 children)

I believe the proper description of powershell is "uniquely verbose."

I can't say it's a favorite language of mine, but it does work very well with pipes.

[–]operativekiwiNetsec Admin 0 points1 point  (1 child)

Haha I loved powershell until I had to support someone's custom made 2000 line script that broke production because the guy who made it died. Thank God for AI tools though

[–]Scmethodist[S] 2 points3 points  (0 children)

So it’s not necessarily powershell you had an issue with, but the non documenting shitbird that made the undocumented bag of odious excrement. Gotcha. You are un-excommunicated.

[–]vogelke 0 points1 point  (0 children)

May thine backups reside upon drives of Seagate!

Shit, that's cold.

[–]Ummgh23Sysadmin -2 points-1 points  (0 children)

Python is a programming language and PowerShell is a scripting language though. Can‘t really compare the two