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

  • Microsoft Xbox One 500GB Console - Gears of War: Ultimate Edition Bundle - 139.00
    Written by
    Microsoft Xbox One 500GB Console - Gears of War: Ultimate Edition Bundle - 139.00 That's not a typo folks. It's a re-furb unit but…
    Read more...
  • Windows Patch Cleaner
    Written by
    Windows Patch Cleaner This is one of those utilities I will be installing…
    Read more...
  • The Coolest Thing On Instagram I Have Ever Seen
    Written by
    The Coolest Thing On Instagram I Have Ever Seen Honestly, this might he coolest thing I have ever seen…
    Read more...
  • Retired Husband (Humor) WalMart is Involved.
    Written by
    Retired Husband (Humor) WalMart is Involved. It's been a REALLY crappy week so far and this…
    Read more...
  • Outlook known issues in the June 2017 security updates
    Written by
    Outlook known issues in the June 2017 security updates Well folks, these issues cover every version of Outlook back…
    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.