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
        Return My.User.IsInRole(ApplicationServices.BuiltInRole.Administrator)
    End Get
End Property

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.