Skip to content

Main Navigation

     
pwshell.techPowershell all the things!
  • Home
  • One-Liners
  • Modules
  • About
  • Contact

Categories

  • Modules (1)
  • One-Liners (3)
  • Powershell (12)
  • QuickScript (1)

Join Us!

  • r/pwshell
  • Github Repo

Tags

$errorActive Directoryadcredentialscredsenter-pssessionerror handlingfile managerHyper-VInvoke-Commandinvoke-commandaslockoutsmoduleO365one-linerOUpress any keypromptingquick accessremotingsnippetsspeedtestwinrm

Category: One-Liners

Quick powershell online commands that do as much heavy lifting in one line of code.

One-Liner: Move Computer to new OU

November 9, 2020 (November 9, 2020) Chris

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 […]

One-LinersActive Directory, OU Leave a comment

One-Liner: Test-NetConnection Tweaked

November 6, 2020 (November 9, 2020) Chris

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-Liners Leave a comment

One-Liner: Get O365 User Licenses

November 5, 2020 (November 9, 2020) Chris

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 […]

One-LinersO365, one-liner Leave a comment

Recent Posts

  • Quick Script: Get AD Lockouts
  • Pin to Quick Access with Powershell
  • Save Credentials to a File
  • Module Highlight: Invoke-CommandAs
  • One-Liner: Move Computer to new OU

Archives

  • February 2021
  • November 2020
  • October 2020
  • Entries RSS
  • Comments RSS
©2020 pwshell.tech