Dear Powershell Nuts...this one is for you.

Holy Cow! This is some cool code folks and one I KNOW the Admi's and PS folks would love to have in the old Power Shell Kit.

I just built a tool for a team of consultants to use, and some of the commands require elevation. Rather than relying on telling them it needs to be elevated, I wanted to be able to exit immediately if the session wasn’t so precious time wasn’t wasted.

First, we need to figure out who the user is. To do that, you can use the [System.Security.Principal.WindowsIdentity]::GetCurrent() method and save it to a variable. 

Read more and see the code here.

Last modified on Saturday, 03 December 2016 18:27

Da Boss!

Website: www.digitalsmind.com Email: This email address is being protected from spambots. You need JavaScript enabled to view it.

Latest Content

  • Slip your head into a huge noise-isolating helmet
    Written by

    Da Boss!

    Slip your head into a huge noise-isolating helmet Huh...so the Flintstones Gazoo helmet is now available to purchase.…
    Read more...
  • Consumer Reports stops recommending Microsoft Surface PCs over reliability concerns
    Written by

    Da Boss!

    Consumer Reports stops recommending Microsoft Surface PCs over reliability concerns I have to laugh a little at this. What do…
    Read more...
  • Microsoft reveals new Windows 10 Workstations edition for power users
    Written by

    Da Boss!

    Microsoft reveals new Windows 10 Workstations edition for power users Well, it's about damn time!
    Read more...
  • Alienware Area-51 Ryzen Threadripper Edition Hands-On With Benchmark Annihilation
    Written by

    Da Boss!

    Alienware Area-51 Ryzen Threadripper Edition Hands-On With Benchmark Annihilation Um...DAMN! Threadripper is no slouch that's for sure! WOW! Sure, this…
    Read more...
  • Fecal Bacteria Found In Drinks Sold By Major Fast Food Restaurants Like McDonald's
    Written by
    Fecal Bacteria Found In Drinks Sold By Major Fast Food Restaurants Like McDonald's Welp, there goes the "yes" when I am asked if…

Visit the Digitalsmind Video YouTube Page!

Did you know we have a video page on YouTube? 

Well... WE DO! 

Check us out! 

- Our Video page.