We help IT Professionals succeed at work.

How to add user to Power User group?

virzone
virzone asked
on
Anyone can assist me on how do i add all my network users to the default local power user group on their desktop with simplest and less administrative method?

Comment
Watch Question

no easy way.  The way I do it it

Deploy the Switch User utility to all desktops.  This will allow to to script the change using an account with admin rights.  Then using the SU service run this line in your logon script (the account needs to be a domain admin.


SU <account> "net localgroup "power users" "DOMAIN-NAME\domain users" /ADD" DOMAIN-NAME<\\server\share\password.txt

Use a logon Script to Do it...With tha ADSI Functions.
Put this Code in a .VBS File and call it as a Logon Script.


Dim wshNW
Dim pdcName, ComputerName,UserName
Set wshNw = WScript.CreateObject("Wscript.network")


PdcName = wshNW.UserDomain
ComputerName = wshNW.ComputerName
UserString = wshNW.UserName
GroupString = "Power Users"

Set GroupObj = GetObject("WinNT://" & ComputerName & "/" & GroupString)
GroupObj.Add ("WinNT://" & PdcName & "/" & UserString)
Set DomainObj = Nothing
Set GroupObj = Nothing


Commented:

Question: in what security context does your scheduler run. Default as SYSTEM or did you change it?
If it is either as local administrator or SYSTEM then you could add the "net localgroup" command to all computers in your network.
All Active copmuters will be stored in machines.txt. If you habe a list of all the computers then comment-out the "net view"-line.
Carefull, in the FOR line there are double spaces and double "%". They are needed... copy carefully.

Regards,
Eric


---- script 1 ----

@echo off
set MACHINES=c:\temp\machines.txt
set LOGFILE=c:\temp\logfile.txt
set ERRORLOG=c:\temp\errorlog.txt
net view >%MACHINES%
FOR /F "eol=  tokens=1 delims=\ " %%a IN (%MACHINES%) DO start /w AddUsers.cmd %%a >%LOGFILE% 2>%ERRORLOG

---- end script 1 -----

---- script 2 ----

@echo off
AT \\%1 HH:MM net localgroup Powerusers Domain\Username1 /add
AT \\%1 HH:MM net localgroup Powerusers Domain\Username2 /add
.....
.....

---- end script 1 -----

Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- PAQ'd and points removed

Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

PaShA
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange