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
Check whether the current user is an administrator
Tagged on:

Leave a Reply

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