VMware Cloud Community
satheeshsatz
Enthusiast
Enthusiast

invoke-vmscript is not working to add Windows7 to domain using "add-computer script block"

i am using below command to change the windows7 desktop OS to domain, but it is not working.

$Domainchange = "Add-Computer -DomainName $domain -Credential $userid"

Invoke-VMScript -VM $vm -ScriptText $Domainchange -GuestUser gusername -GuestPassword gpwd -ScriptType Powershell

Regards, Satheesh
Tags (1)
0 Kudos
3 Replies
LucD
Leadership
Leadership

Is UAC enabled in that guest OS?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
satheeshsatz
Enthusiast
Enthusiast

yes, i have enabled UAC,

rest of my commands are working, like renaming and changing IP

Regards, Satheesh
0 Kudos
LucD
Leadership
Leadership

Could be, but this one requires UAC permission.
You can check by disabling UAC, and then testing your command again.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos