Quick Local Admin Test

Determine whether the current user is a local administrator without checking Domain Group membership

Readers

December 21, 2008

1 Min Read
ITPro Today logo in a gray background | ITPro Today


Need to determine whether the current user is a local administrator? Here’s a way you can quickly make this determination without having to check Domain Group membership. All you need to do is run a script named LocalAdminTest.vbs on the user’s machine under that person’s credentials.

LocalAdminTest.vbs attempts to create a new registry key in a location (HKEY_ CURRENT_USERSoftwarePolicies) that’s normally forbidden to users unless they’re local administrators. If the script successfully creates that key, it displays a message box noting that the user has local administrator permissions, then deletes the key it just created. If the script is unsuccessful, it displays the message box that Figure 2 shows.

You can download LocalAdmin- Test.vbs by clicking the Download the Code Here button at the top of this page. You don’t have to make any modifications to the script before running it.
—Harry Verge, senior technology specialist, TELUS

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like