VMware Cloud Community
DraK-KarD
Contributor
Contributor

Question regarding Invoke-VMScript

Hello all,

actually I'm trying to deploy VM Windows. And I'm stuck with some problems.

At first I couldn't connect to domain, flow were filtered, so I was using the option GuiRunOnce that was running some powershell commands. It was working well.

Now flow are opened, and GuiRunOnce is not working until I open session, but I don't want to do it, so I converted the command from GuiRunOnce to invoke-VMScript, one invoke for one command. But during the deployment, the Invoke seems not working nothing done on the VM, but if I run the same invoke from a powershell console it works. I must say that from the deployment script I update VMtools before calling the invoke.

Also, I have tryed to not join the domain at the OSCustomizationSpec, by setting domain to null the same for credential, but the deployment failed in this case.

Any idea, recommendation ?

Thanks in advance.

Ben

Reply
0 Kudos
2 Replies
LucD
Leadership
Leadership

When you connect via Invoke-VMScript to the Guest OS on a freshly installed Windows OS, the user's profile hasn't been created yet.
When you log on directly that will also create the profile, hence your code works.

There are some tricks to creating a user profile on a Windows box without the user actually logging on.
But you better ask that question in a Windows-related forum or search with Google/Bing



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

Reply
0 Kudos
DraK-KarD
Contributor
Contributor

Hello Luc,

thank you for your answer who pointed me to my idiotic way of doing thing.

In fact I can reset the administrator password in the OSCustomizationSpec,  use this account and normally I will not face the problem again.

I'll try it asap

Reply
0 Kudos