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

  • Snag-It 2018 - Best Screen Capture Tool - PERIOD!
    Written by

    Da Boss!

    Snag-It 2018 - Best Screen Capture Tool - PERIOD! Well, it's almost here but I was graced by the…
    Read more...
  • Windows 10 Fall Creators Update: Lots of small changes—and maybe the revolution
    Written by

    Da Boss!

    Windows 10 Fall Creators Update: Lots of small changes—and maybe the revolution Hopefully this one will go a little smoother than the…
    Read more...
  • VirtualBox 5.1.30
    Written by

    Da Boss!

    VirtualBox 5.1.30 If you are looking for a VM program\utility that can…
    Read more...
  • Microsoft employees can now work from tree houses
    Written by

    Da Boss!

    Microsoft employees can now work from tree houses Damn...can't seem to find my resume. How freaking cool would…
    Read more...
  • US CERT advisory: severe flaw in popular WiFi security protocol WPA2 leaves WiFi traffic open to eavesdropping, connection hijacking, and malicious injection
    Written by

    Da Boss!

    US CERT advisory: severe flaw in popular WiFi security protocol WPA2 leaves WiFi traffic open to eavesdropping, connection hijacking, and malicious injection And I haven't even finished my first cup of coffee…
    Read more...

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.