Skip to content
From an earlier era of this site. Left here for the record.

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