VMware Cloud Community
sutter
Enthusiast
Enthusiast
Jump to solution

Add VM requester as local windows administrator issue

All,

I'm fairly new to vCAC and having trouble with something, looking for some help.  Users have the ability to log in and request a Windows 2008 R2 server, it joins to the domain fine but it won't place the user in the local administrator group as the build profile I setup is suppose to do.  When I try and run the command manually.  I don't think it should though.  For reference I'm using vCAC 6.1 and building out a Windows Server 2008 R2 server with the latest windows updates.

My build profile looks like this:

VirtualMachine.Admin.UseGuestAgenttrue
VirtualMachine.Customize.WaitCompletetrue
VirtualMachine.Software0.NameName Of Script To Add User To Local Admin Group
VirtualMachine.Software.ScriptPathc:\scripts\Name Of Script To Add User To Local Admin Group {Owner}
VMware.VirtualCenter.OperatingSystemwindows7Server64Guest

The script is fairly simple its just the below line:

net localgroup Administrators /add %1

This is pretty standard way of doing it from looking around the internet but it doesn't work for me for some reason. The VM never finished building because this gets hung up and never completes.  I don't see anything in the logs so I'm not sure what is failing.  This is a base build so it doesn't do much in the build process.  The Server 2008 R2 VM clones from template, syspreps, renames it and joins it to the domain. This all happens in the customization file.  Then this fails to complete.  Does anyone notice anything I'm missing?

Reply
0 Kudos
1 Solution

Accepted Solutions
rcporto
Leadership
Leadership
Jump to solution

Look for this line:

  • VirtualMachine.Software0.ScriptPath = C:\VRMGuestAgent\scripts\addusertoadmin.cmd {Owner}

The value {Owner} the vCAC will get will be passed as the variable "1" to the command net localgroup Administrators /add %1

The log of Guest Agent located at C:\Windows\System32\GuestAgent.log will have something like C:\VRMGuestAgent\scripts\addusertoadmin.cmd userid@domain.com

---

Richardson Porto
Senior Infrastructure Specialist
LinkedIn: http://linkedin.com/in/richardsonporto

View solution in original post

Reply
0 Kudos
8 Replies
rcporto
Leadership
Leadership
Jump to solution

Check if the scripts inside the C:\VRMGuestAgent aren't blocked, take a look: StorageGumbo: vCAC Windows Deployment Stuck at CustomizeOS State

---

Richardson Porto
Senior Infrastructure Specialist
LinkedIn: http://linkedin.com/in/richardsonporto
Reply
0 Kudos
sutter
Enthusiast
Enthusiast
Jump to solution

I'm not using the VRMGuestAgent, is this required to do what I'm trying to do? 

Reply
0 Kudos
rcporto
Leadership
Leadership
Jump to solution

Take a look at the first line of your custom property:

VirtualMachine.Admin.UseGuestAgenttrue
VirtualMachine.Customize.WaitCompletetrue
VirtualMachine.Software0.NameName Of Script To Add User To Local Admin Group
VirtualMachine.Software.ScriptPathc:\scripts\Name Of Script To Add User To Local Admin Group {Owner}
VMware.VirtualCenter.OperatingSystemwindows7Server64Guest

In this line you're telling vCAC to use the Guest Agent 🙂

You can too try run a script in vCenter Customization Spec, but the way you're trying to do you will need the vCAC Guest Agent installed on VM, since this is required for guest customization.

---

Richardson Porto
Senior Infrastructure Specialist
LinkedIn: http://linkedin.com/in/richardsonporto
Reply
0 Kudos
sutter
Enthusiast
Enthusiast
Jump to solution

Yeah, that makes a lot of sense.  Reading is fundamental, thanks.

Going to what you said about doing it through the customization file, is that possible?  The Guest Agent is how vCAC knows what %1 is right?  I'm not sure how the customization file would know who %1 is, wouldn't it just assume it was the VMware service account doing the deployment in vCenter and not the person that requested the VM in vCAC?

Reply
0 Kudos
rcporto
Leadership
Leadership
Jump to solution

Look for this line:

  • VirtualMachine.Software0.ScriptPath = C:\VRMGuestAgent\scripts\addusertoadmin.cmd {Owner}

The value {Owner} the vCAC will get will be passed as the variable "1" to the command net localgroup Administrators /add %1

The log of Guest Agent located at C:\Windows\System32\GuestAgent.log will have something like C:\VRMGuestAgent\scripts\addusertoadmin.cmd userid@domain.com

---

Richardson Porto
Senior Infrastructure Specialist
LinkedIn: http://linkedin.com/in/richardsonporto
Reply
0 Kudos
willonit
Hot Shot
Hot Shot
Jump to solution

If you do not want to use the guest agent you can follow this post Adding Local Admin Without the Guest Agent‌ to use orchestrator to add the user. The workflows are hosted on flowgrab if you would like to download and use. Guest agent is the easiest but there are use cases for doing it without as well.

Hope this helps.

Reply
0 Kudos
PriyankaKamdar
Enthusiast
Enthusiast
Jump to solution

Vrmguestagent is installed in template.

  • VirtualMachine.Software0.ScriptPath = C:\VRMGuestAgent\scripts\addusertoadmin.cmd {Owner}

The value {Owner} the vCAC will get will be passed as the variable "1" to the command net localgroup Administrators /add %1 is also correct.


But somehow script is not getting executed.

cert.pem file is also generated.


C:\Windows\System32\GuestAgent.log  is not present in my machine.


I obserevd log files in folder as

C:\VRMGuestagent/guestagent.txt.


and c:/VRMGuestagent/axis2/logs/gugent-axis.txt.


any suggestion pls ?


Also i see screen as attached.


Regards, Priyanka Kamdar
Reply
0 Kudos