Using the username, I want to find a way to check if that user is an administrator for a given remote server.
I found the following function online but it only checks if the user is an admin for the local machine.
Any help is appreciated!
function Test-Administrator
{
$user = [Security.Principal.WindowsIdentity]::GetCurrent();
(New-Object Security.Principal.WindowsPrincipal $user).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
}