S
S
snekers12015-10-20 11:08:42
Windows
snekers1, 2015-10-20 11:08:42

How to write a VBScript that checks for admin rights?

In the company, administrator rights are given as follows:
1. The global group "CP-LOCALADMIN-computername" is created
2. This group is added to the group of local administrators of the computer
3. The user is added to the group "CP-LOCALADMIN-computername"
I wanted to write a simple script that checks the user has administrator rights and displays a list of groups (CP-LOCALADMIN-*) in which the user is a member, but there was not enough knowledge.
OS used: Windows 7, 8, 8.1

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
NRinat, 2015-10-20
@NRinat

Good afternoon!
Colleague, excuse me, of course, but why did you choose VB? Are you taking coursework? Or do you want to solve a specific problem in the system?
If it's a coursework, then it's clear, if the task is for a production environment, then it's better to use Powershell.
If it's not difficult, describe the problem in full. What do you want to get as an output? It seems to me that it will be easier to implement all this with the help of Restricted Policy.

S
snekers1, 2015-10-20
@snekers1

Hey!
PowerShell cannot be used, because execution of .ps1 for unknown reasons is prohibited on the computer. companies.
The script must check for the presence of the "CP-LOCALADMIN-computername" group in AD and the presence of a user in this group.
At the output, I want to get something like: Administrative access GRANTED or DENIED and a list of groups (starting with CP-LOCALADMIN-*) in which the user is a member.
Because our people are lazy, the authorities set the task: "Double click, after that the result of the check"

S
Sergey SA, 2015-10-21
@resetsa

you can start here
stackoverflow.com/questions/1090336/querying-activ...
If
it doesn't work, I can help for a modest fee. )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question