0% found this document useful (0 votes)
24 views1 page

Add User To Group

This VBScript file adds a new user to an experimental users group on the local computer. It gets objects for the target group and user, then adds the user to the group by specifying the user's ADsPath. The script outputs a message confirming the user was added to the group and then ends.

Uploaded by

radutari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views1 page

Add User To Group

This VBScript file adds a new user to an experimental users group on the local computer. It gets objects for the target group and user, then adds the user to the group by specifying the user's ADsPath. The script outputs a message confirming the user was added to the group and then ends.

Uploaded by

radutari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

D:\Codigo Fuente\Windows Scripting Hosting\AddUserToGroup.

VBS

mircoles, 15 de junio de 2016 10:05 a.m.

'************************************************
' File:
AddUserToGroup.vbs (WSH sample in VBScript)
' Autor: G. Born
'
' Add a user to a group
'************************************************
Option Explicit
Dim oGroup, objUser, user, domain, group
domain = "."
group = "_Usuarios_Experimentales"
user = "_Usuario_Nuevo"
' Bind to a group
Set oGroup = GetObject("WinNT://" & domain & "/" & group)
Set objUser = GetObject("WinNT://" & domain & "/" & user)
'oGroup.Add objUser.ADsPath
oGroup.Add "WinNT://" & Domain & "/" & user
Set oGroup = Nothing
WScript.Echo "User " & user & " added to group " & group
WScript.Quit
' End

-1-

You might also like