Periodically, I scan our Active Directory (AD) for machines that haven’t contacted AD in 60+ days. So one thing I like to do is stage them in an OU called “Obsolete”, and then wait another 60+ days to remove them from AD. Our turnover is generally not to high, but it’s enough that moving/removing the […]
Category: One-Liners
Quick powershell online commands that do as much heavy lifting in one line of code.
One-Liner: Test-NetConnection Tweaked
Test-Connection is a great tool, but sometimes I would like to ping a list of IPs periodically. Here’s a little one-liner that will do exactly that: Just point it to a text file formatted like so: And here’s the output: Enjoy! ChrisBy day, I’m a systems admin for a medium size company in the Pacific […]
One-Liner: Get O365 User Licenses
Here’s a great one liner I use all the time to run a report get our user’s O365 licenses. This should go without saying, but make sure you’ve installed the MSOnline module. Then connect with Connect-MSOLService. You should get an output similar to this: You could add a Export-Csv or Convertto-JSON | Out-file .\filename.json if […]