• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Clatent

Technology | Fitness | Food

  • About
  • Resources
  • Contact

Windows

One-Liner Wednesday March 29, 2023

March 29, 2023 by ClaytonT 2 Comments

Can you believe it’s Wednesday already? I can’t either, week is flying by. Could it be the excitement of the PowerShell + Devops Global Summit coming up in a few weeks? Quite possibly! If you haven’t gotten your ticket yet, I highly recommend it. With that said, these next 3 weeks I’ll be highlighting speakers and topics from the summit.

Today’s one-liner is a great one for troubleshooting from Jeff Hicks. He will be heading the Onramp program for attendees who are just getting into IT. It is such a great program and wished it was around when I was getting into IT!

Get-WinEvent -FilterHashtable @{Logname = 'System';Level=1} -MaxEvents 10 | sort-Object ProviderName,TimeCreated

What this one-liner does is searches the System Event Log for the last 10 “Critical” events. Then sorts them by the Provider name and date/time. You could change the level for “lesser” events if needed. Also if you need to check on a remote computer you can add the -ComputerName parameter, but remember that it only takes 1 computer at a time. If you need to connect to multiple computers, you can use ForEach to reach out to all computers needed.

Hope this one-liner helps you out and hope to see you at the PowerShell + DevOps Summit!

Jeff Hicks:
Blog

PowerShell + DevOps Global Summit:
Global Summit

Microsoft Learn:
Get-WinEvent

Tagged With: Automation, Event Log, One Liner Wednesday, PowerShell, Reporting, Windows, Windows Server

One-Liner Wednesday March 15, 2023

March 15, 2023 by ClaytonT Leave a Comment

Today’s one-liner may not be a direct PowerShell command, but it can be run inside the PowerShell terminal. Are you using Intune, or looking into using Intune? If your already using it, you know by default when you add a user it sets them as a local administrator(I’m not sure exactly why, but that can be a topic for another blog post), and of course we don’t want our users to be local administrators on their computers. To resolve this issue, all you need to do is remove them from the local administrators group like below.

net localgroup administrators azuread\user@domain.com /delete

The only change needed is changing “User@domain.com” to their login address. I’d recommend adding this to your new device script, and if you do not have a new device script, I’d start one now, so you can keep adding and automating things to save you time and have consistent deployments.

Also, take a look at Azure Functions to see how you can deploy code and automate things on a bigger scale.

Tagged With: AzureAD, Intune, One Liner Wednesday, PowerShell, Windows

Module Monday January 9, 2023

January 9, 2023 by ClaytonT Leave a Comment

It’s another Module Monday, but this time it isn’t really a module, but a script, that I think in the future could be turned into a module with even more functionality. I came across this script when I was looking for a quick way to download Window ISOs easily. I mean, who isn’t tired of going through all the clicks just to get a Window’s ISO from Microsoft?

This script finds Windows 11 ISOs and goes all the way back to Windows 7, but hoping you don’t need those for your own sanity. It does only cover home, business, and education, but that is becauase those are the most common.

It’s so nice just type in .\fido.ps1 win 11 -rel latest and this will download the latest version of Windows 11 for you? Why not put it in a scheduled task, so you don’t have to worry about downloading the latest version? Or if you or someone on your team needs a certain version you can just type in -win 10 -rel 21H1 and you know you have the right one? It also downloads very quickly as well.

Hope this saves you as much time as it has for me!

GitHub:
Fido

Tagged With: Automation, ISO, Module Monday, PowerShell, Windows

Primary Sidebar

Clayton Tyger

Tech enthusiast dad who has lost 100lbs and now sometimes has crazy running/biking ideas. Read More…

Find Me On

  • Email
  • GitHub
  • Instagram
  • LinkedIn
  • Twitter

Recent Posts

  • New Feature Announcement for 365AutomatedLab
  • How ChatGPT saved our company $1500 in less than 15 minutes
  • Read-Only Friday August 4, 2023 End Of Life Server 2012R2 and managing EOL
  • One-Liner Wednesday August 2, 2023
  • Module Monday July 31, 2023

Categories

  • 365
  • Active Directory
  • AI
  • AzureAD
  • Cim
  • Dashboards
  • Documentation
  • Get-WMI
  • Learning
  • Module Monday
  • Nutanix
  • One Liner Wednesday
  • Passwords
  • PDF
  • PowerShell
  • Read-Only Friday
  • Reporting
  • Security
  • Windows
  • WSUS

© 2023 Clatent