Live on Wire:
Phil Wiffen

Blogged: Connecting to multiple storage systems with the NetApp PowerShell Toolkit wp.me/p5ZiX-kc #NetApp #PowerShell


Featured Content

Here you always find a fun code snippet that gets you immediate results. Use it as-is, or dive deeper and learn more about it. Featured Content will change regularly. Take a look at the Articles menu to view other topics and articles, or simply enter one or more search terms into out search bar to browse our archives.

  

function Test-Admin
{
  $wid = [System.Security.Principal.WindowsIdentity]::GetCurrent()
  $prp = New-Object System.Security.Principal.WindowsPrincipal($wid)
  $adm = [System.Security.Principal.WindowsBuiltInRole]::Administrator
  $prp.IsInRole($adm)  
}

  Tests whether you currently have Admin privileges or not

Learn more



Latest Questions

Can you help out? Or would you like to ask a question yourself? To view answers, click the question headline. And to ask new questions, visit our Q&A section!

Votes Views Answers Question
1
vote
633
views
4
answers
asked 5 months ago by Andreas
2
votes
660
views
2
answers
asked 6 months ago by Dan Holme
1
vote
787
views
2
answers
asked 6 months ago by Hanswurst
  Ask your own questions and get great answers

Now Online

There are no users currently online

Recommended Reading

  • Killer Feature in PSv4: Desired State Configuration

    Most of the things found in PowerShell 4.0 is consolidation work, but there is one feature called Desired State Configuration (DSC) that really has the potential to become a killer feature. Desired St...

  • Deleting Registry Key Default Value

    Since PowerShell 1.0, there has been a bug in Remove-ItemProperty that prevented you from deleting a registry keys’ default value. This bug still exists in PowerShell 3.0.So if you must get rid of a d...

  • Displaying Message Box

    Here’s some very simple and straight-forward code to display a custom MsgBox in PowerShell.You can specify message text, header, default buttons, and icon to display. Your code can then respond to the...

  • “Spaces” resolve to current path

    When you use Test-Path to check whether a file or folder exists, be aware that spaces resolve to the current path. So this line always returns true: Test-Path ' ' In fact, it points to the curren...

  • Test Administrator Privileges

    Provides a function that will tell you whether or not full Administrative privileges are enabled. The function does not rely on group memberships. Instead, it checks the effective privileges in your access token, so it works with User Account Control.

  • Correctly Showing Balloon Tips

    There are multiple samples on how to show balloon tips. But often, they produce multiple taskbar tray icons or ghost images. So learn how to correctly display toolbar balloon tip windows, and how to get rid of them once you are done.

  • PowerShell Tips Monthly #2: All About Arrays

    The free PowerShell tips Monthly #2 is out! This edition deals with arrays and hashtables and is a very useful cheat sheet whenever you need to work with arrays. Grab it now! http://powershell.com/...

  • Override Execution Policy

    Execution policy controls whether you can run PowerShell scripts or not. It is not a mechanism to prevent evil hackers from running scripts. Instead, it is just a safety belt for your own security so ...