Check whether the current user is an administrator

 

An extremely simple way to check whether the currently logged in user has administrative rights on the local machine;

Public Shared ReadOnly Property IsUserAdmin() As Boolean
    Get
        Return My.User.IsInRole(ApplicationServices.BuiltInRole.Administrator)
    End Get
End Property