ローカルの管理者権限の有無をnet.exeを使って確認します。

[gist]https://gist.github.com/2716207[/gist]

元ネタはこちらです。

- [PowerShell: ◆ローカルのAdministrator権限が有るか確認する](http://mtgpowershell.blogspot.jp/2012/05/administrator.html)
- [2012 Scripting Games Commentary: Those Who Forget The Past... - Don Jones - Powershell.com – Powershell Scripts, Tips and Resources](http://powershell.com/cs/blogs/donjones/archive/2012/04/19/2012-scripting-games-commentary-those-who-forget-the-past.aspx)

ただし、元ネタだとドメインユーザーがローカル管理者権限を持っているときにそれを判定できなかったのでその部分のロジックを追加しました。