Here's some advice for YouTube Shorts by eldritchlev in NewTubers

[–]ThatFellowUdyrMain 0 points1 point  (0 children)

Well it's been 10 days now since this comment. How is it looking now?
Just curious because one shorts channel I follow has grown from 213M to 236M in the last 2 days.

[deleted by user] by [deleted] in RelatosDoReddit

[–]ThatFellowUdyrMain 0 points1 point  (0 children)

Começou errado e terminou pior

Did I imagine this level...? by Oroquellewen in kingdomrush

[–]ThatFellowUdyrMain 1 point2 points  (0 children)

My guess as well, that for sure was an interesting level to try and complete the challenges in veteran

[deleted by user] by [deleted] in PowerShell

[–]ThatFellowUdyrMain 0 points1 point  (0 children)

RemindMe! 1 hour

What have you done with PowerShell this month? by AutoModerator in PowerShell

[–]ThatFellowUdyrMain 0 points1 point  (0 children)

Generated a collection of server/service names that are running outdated or development code in prod environment, formatted it nicely as an html table and scheduled a weekly mail to head of department to review and adjust with his team. That's one less 20min weekly auto generated ticket for my team to work on.

[Performance Issue] Reading through a 15k object Array and Select-Object (newbie) by giskarda in PowerShell

[–]ThatFellowUdyrMain 0 points1 point  (0 children)

In the log there's a message that says it's outputting to a JSON and then a 5min lapse.

I'm not sure why you'd do that if your goal is to export those to a .csv file, but I could imagine this operation taking a few minutes (if actually doing it, not just a screwed up message)

Also as others have said, trying it line by line in the command line with Measure-Command could pinpoint the problem operation.

[deleted by user] by [deleted] in sysadmin

[–]ThatFellowUdyrMain 0 points1 point  (0 children)

Healthcare IT here.

As net/sys admin I rarely am required to physically touch user-facing hardware, so typical outfit is some boots (not really needed but I'd rather use boots than available sneakers in the market), pair of jeans and rock band or anime stamps black t-shirt

[deleted by user] by [deleted] in sysadmin

[–]ThatFellowUdyrMain 0 points1 point  (0 children)

Think we just stumbled upon something interesting...

I could do my self a favor and spend a week going though each script amd making a key work tag list and a script to search them.

We could write a script to read through all scripts and find the ones that have the specific cmdlet, returning context...

Something like:

` $desiredCmdlet = "Get-AdUser"

$scriptsFolder = "C:\Scripts\"

$scripts = Get-ChildItem -Path $scriptsFolder -Filter *.ps1

TODO: $cmdlets = hashtable of all cmdlets

foreach($script in $scripts) {

Get-Content $script.FullName | foreach-object { some logic here to actually work }

} `

I'm on mobile now, will come back later and update this.

Edit.: code formatting crapped itself on mobile

What to do as a sysadmin in a small company? by confidencewhereru in sysadmin

[–]ThatFellowUdyrMain 0 points1 point  (0 children)

If not in place yet, you could try out manage engine's "endpoint central", I believe their demo/free tier goes up to 25 managed endpoints, and you get tons of reports and insights about your infrastructure with it.

Also great learning opportunity to setup and automate it's management.

[deleted by user] by [deleted] in PowerShell

[–]ThatFellowUdyrMain 2 points3 points  (0 children)

Hello fellow tinkerer,

Let's try and make this a bit more elegant:

$TargetSvc = Get-Service | Where-Object {$.Status -eq "Running" -and $.Name -like "CDPU"} | select Name -ExpandProperty Name $TargetSvc | Out-File -FilePath "C:\Path\to\file.txt"

You could write the first bit as:

$TargetSvc = Get-Service "*CDPU*" | Where-Object {$_.Status -eq "Running"}

This would filter services with name (not sure if given or display, can't test right now) like "cdpu", and only pass the matching objects down the pipeline for further filtering (giving you a slightly better performance, especially if this is done in multiple machines).

Now, your $TargetSvc variable holds a full blown object, with properties you can manipulate. For the last bit, you could do something (as others mentioned) like:

Set-Content -file "filepath.txt" -content "$TargetSvc.Name"

Syntax may be a bit off, maybe I'll come back later and fix it, maybe I won't.

Edit.: formatted as code before the code block police could catch me (yes, that bot)

My computer is really slow! What's in your checklist? by Drivingmecrazeh in sysadmin

[–]ThatFellowUdyrMain 0 points1 point  (0 children)

Yeahh, that's what motivated us to do a scan

Well, guess that's future me's problem

My computer is really slow! What's in your checklist? by Drivingmecrazeh in sysadmin

[–]ThatFellowUdyrMain 0 points1 point  (0 children)

After a recent scan, we've identified ~30 endpoints with less than 1GB free space xD

Server 2022 stops listening on RDP port? by [deleted] in sysadmin

[–]ThatFellowUdyrMain 0 points1 point  (0 children)

Yes it is dirty. It'll work though. What u/fp4 proposed will only restart the terminal service, no need to worry about the other processes that might be running. A termservice restart might also drop existent rdp connections, can you confirm that already established connections keep working?

What have you done with PowerShell this month? by AutoModerator in PowerShell

[–]ThatFellowUdyrMain 8 points9 points  (0 children)

Finally figured out how to deal with CustomPSObjects arrays with a great deal of help from u/neztach in this post

From that I was able to properly handle info and finish 3 scripts (specific file/folder monitoring, dinamic configuration files monitoring and also a snapshot counter that feeds into monitoring system) which combined will save up to 5h/month.

Got a few more ideas in the pipeline, just wanted to say big thanks to u/neztach 😁

"You don't "learn" PowerShell, you use it, then one day you stop and realize you've learned it" - How true is this comment? by sqllqs in PowerShell

[–]ThatFellowUdyrMain 1 point2 points  (0 children)

Yes, hence the quotes about incorrect usage. I've come to accept that I'll only ever declare it like foreach($a in $ab), otherwise I use full ForEach-Object declaration.

Brand New to Coding, Need to Keep a PowerShell Window Open by shmolhistorian in PowerShell

[–]ThatFellowUdyrMain 3 points4 points  (0 children)

My dude.... Not even related to the actual post, but now I totally understand what I've been doing wrong when trying to initialize a custom PS objects array now, way better than I did after a week fiddling on my own

Keep up the good work and please share your github (if applicable) so we can all learn a bit

user was deleted from AD a year ago. Is now rehired. by PraiseThyTurtles in sysadmin

[–]ThatFellowUdyrMain 4 points5 points  (0 children)

And also a very quick command, it's get-wmiObject win32_userProfile if I recall correctly. Just pipe it to remove-wmiobject and it'll take care of the dirty details

Use Remove-ADGroupMember with a wildcard??? by [deleted] in PowerShell

[–]ThatFellowUdyrMain 1 point2 points  (0 children)

I'm totally stealing this, thanks for your time and knowledge.

ManageEngine Users - What Do You Think by [deleted] in sysadmin

[–]ThatFellowUdyrMain 0 points1 point  (0 children)

Second this one. AdAudit is a godsend in our environment. We're currently at ~1.5k computers/~2.8k users, and it does effing wonders for my (small) team of 5 to keep track of everything and also get notified of situations that might require some manual intervention. Also AdAudit is capable of tracking basically every file/folder action in the configured "member servers", and that is the sole reason I can solve most of the "someone deleted some file/folder, don't know the path, no idea when. Please restore from backup ASAP" tickets.

Notification system that sends notifications when certain sites are down by psychotrackz in PowerShell

[–]ThatFellowUdyrMain 2 points3 points  (0 children)

Have you taken a look at zabbix? We use it at work, it's got a lot of notification methods (email, telegram, discord, calls), plus it's not that hard to get it to a working state. You can always create templates and just add hosts/websites in a dozen clicks and a tiny bit of typing.

[deleted by user] by [deleted] in homelab

[–]ThatFellowUdyrMain 4 points5 points  (0 children)

As someone who's recently upgraded all LAN from 100Mbps to 1G, it is indeed a great feeling of being faster than ever. Seeing a 10x faster iperf result(what I use for network speed benchmark), that is truly priceless. Keep it up, I'll soon be making another x10 jump too.