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

Month: November 2020

Pin to Quick Access with Powershell

November 23, 2020 (February 9, 2021) Chris

So here’s a fun one that saved me buckets of time the other day. We needed to give our not so tech savvy users easy access to a folder without having to provide directions to them to navigate to the folder. Now, just like with everything else, there were multiple ways to tackle this problem, […]

Powershellfile manager, quick access Leave a comment

Save Credentials to a File

November 13, 2020 (November 13, 2020) Chris

We’ve all been guilty of it once in awhile. You know what I’m talking about. Saving plain text credentials into a script. It’s great for testing in certain situations. I’ve even been guilty of saving a script and keeping it for awhile on my laptop with the credentials in plain text. It’s just to convenient […]

Powershellcredentials, creds Leave a comment

Module Highlight: Invoke-CommandAs

November 10, 2020 (November 10, 2020) Chris

Invoke-Command is a great tool in the powershell arsenal, but what if you need a little more than what the standard Invoke-Command has to offer? For example, I have a funky batch script that does some SQL juju that needs to be run as the SYSTEM user on demand. Or, what if I’m running into […]

ModulesInvoke-Command, invoke-commandas, module 1 Comment

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

Press any key to continue……powershell style.

November 3, 2020 (November 3, 2020) Chris

Such a simple thing really, but so handy if you want to pause somewhere in a script to read some sort of output before continuing. One of the most common ways to pause a script is to use the Read-Host command like this: 1 Read-Host -Prompt "Press enter to continue"Read-Host -Prompt "Press enter to continue" […]

Powershellpress any key, prompting Leave a comment

Errors? What errors? Oh…..that $error.

November 3, 2020 (November 3, 2020) Chris

We all hate it when your script throws an error. I mean they’re great when you’re writing the script. They help you figure out what’s wrong, but what if you need to keep a log of any errors after you’ve deployed the script? Recently, I was putting a script together to a script to alert […]

Powershell$error, error handling 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