VMware Horizon Community
rsantos1
Contributor
Contributor

Populate local admin group

Hello folks,

I'm deploying persistent Windows7 destkops in my View 5 environment. I've gotten around the problem of adding VMs to the domain (I'm running a script from a custom spec) but I haven't yet figured out how to add a user to the local administrators group. I'm currently doing this by adding users to an AD group and adding that group to local admins in a GPO, but my colleagues don't like the fact that everyone in that group has local admin on all VMs. So, I need to find a way to add only the VM's owner to local admin.

Is there a way to do this without using a GPO?

Thanks!

Rob

Reply
0 Kudos
5 Replies
mittim12
Immortal
Immortal

May be possible to use Powershell to query View and find owner and then connect up and add user to local admin group. 

Reply
0 Kudos
rsantos1
Contributor
Contributor

Thanks for the reply. It is fairly easy to figure out who the user is (%username% variable, for instance), but you still have to run a script to add the user to local admins and this requires elevated privileges. If anyone has a suggestion on how to do this, I'm all ears.

Thanks,

Rob

Reply
0 Kudos
a_p_
Leadership
Leadership

Do you pre-assign the desktops to the users (http://kb.vmware.com/kb/1007526) or are the desktops assigned on first use? In case you pre-assign the desktops you could run a script which adds the user to the desktop's local Adminsitrators group at the same time you assign the desktop. This can be done by scripting or using a batch command like

psexec.exe \\desktop CMD /c net localgroup Administrators domain\username /add

(You can download psexec from MS.) If the desktop is assigned on first use, please report back to discuss possible solutions.

André

Message was edited by: a.p. - fixed the bach command

Reply
0 Kudos
rsantos1
Contributor
Contributor

I'm not pre-assigning desktops; they get assigned on 1st use. Also, our domain policy disables psexec.

It'd be great if there was a way to call a script the 1st time a user logs on.

Thanks!

Rob

Reply
0 Kudos
gunnarb
Expert
Expert

Isn't there a simple GP that sets the user as the local admin?  Is this not good enough?

Gunnar Berger http://www.gunnarberger.com http://www.endusercomputing.com
Reply
0 Kudos