Rewritten Check-Admin function

The Check-Admin function was rewritten for Powershell 3 compatibility.