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.UseGuestAgent | true | |
VirtualMachine.Customize.WaitComplete | true | |
VirtualMachine.Software0.Name | Name Of Script To Add User To Local Admin Group | |
VirtualMachine.Software.ScriptPath | c:\scripts\Name Of Script To Add User To Local Admin Group {Owner} | |
VMware.VirtualCenter.OperatingSystem | windows7Server64Guest |
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?
Look for this line:
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
Check if the scripts inside the C:\VRMGuestAgent aren't blocked, take a look: StorageGumbo: vCAC Windows Deployment Stuck at CustomizeOS State
I'm not using the VRMGuestAgent, is this required to do what I'm trying to do?
Take a look at the first line of your custom property:
VirtualMachine.Admin.UseGuestAgent | true | |
VirtualMachine.Customize.WaitComplete | true | |
VirtualMachine.Software0.Name | Name Of Script To Add User To Local Admin Group | |
VirtualMachine.Software.ScriptPath | c:\scripts\Name Of Script To Add User To Local Admin Group {Owner} | |
VMware.VirtualCenter.OperatingSystem | windows7Server64Guest |
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.
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?
Look for this line:
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
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.
Vrmguestagent is installed in template.
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.