VMware Cloud Community
epaz1000
Contributor
Contributor

Invoke-VMScript authenticate issues

Hi,

I got an issue right now with powerCLI, I am running a PowerCLI script for one of my customers and get sometime an error of credentials. I want to understand the root cause of the issue. The script is:

Invoke-VMScript "ping $Server" -vm $EDRC -HostUser $HostUser -HostPassword $HostUserAdminPass -GuestUser $DomainUser -GuestPassword $DomainUserAdminPass -ScriptType "bat"

Sometimes work ok. Sometimes on the same target server I get:

Invoke-VMScript : 8/5/2015 12:13:32 AM Invoke-VMScript Failed to
Wed 8/5/2015 12:13:36 AM - authenticate with the guest operating system using the supplied credentials. 
Wed 8/5/2015 12:13:36 AM - At line:40 char:1
Wed 8/5/2015 12:13:36 AM - + Invoke-VMScript "ping localhost" -vm $vm -HostUser $HostUser -HostPassword
Wed 8/5/2015 12:13:36 AM - $Host ...
Wed 8/5/2015 12:13:36 AM - + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Wed 8/5/2015 12:13:36 AM - ~~~
Wed 8/5/2015 12:13:36 AM - + CategoryInfo : NotSpecified: (:) [Invoke-VMScript], InvalidGues
Wed 8/5/2015 12:13:36 AM - tLogin
Wed 8/5/2015 12:13:36 AM - + FullyQualifiedErrorId : Client20_VmGuestServiceImpl_RunScriptInGuest_ViE
Wed 8/5/2015 12:13:36 AM - rror,VMware.VimAutomation.ViCore.Cmdlets.Commands.InvokeVmScript
Wed 8/5/2015 12:13:36 AM - Invoke-VMScript : 8/5/2015 12:13:34 AM Invoke-VMScript Failed to
Wed 8/5/2015 12:13:36 AM - authenticate with the guest operating system using the supplied credentials. 
Wed 8/5/2015 12:13:36 AM - At line:41 char:1

Both source and target are in the same domain using a domain admin user.


Can you help solve this thing?

Thanks

0 Kudos
7 Replies
LucD
Leadership
Leadership

Could the content of the variables that hold the guest user and password have been changed in some situations ?

Does the password contain any special characters, and did you specify it between single quotes ?


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

0 Kudos
epaz1000
Contributor
Contributor

Hi

No the variables didn't change and the password is a simple one with quotes.

The strange thing is that if I log in with the user I am using for the invoke command to the target server, the script work fine for a week or two and then I get authentication issue again...

0 Kudos
LucD
Leadership
Leadership

Could it be that there is an issue with the VMware Tools on the target server ?

Are they sometimes stopped ?

Anything in the eventlogs ?


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

0 Kudos
epaz1000
Contributor
Contributor

Hi

I am running a script up front to check VMtools:

$toolsStatus = (Get-VM $vm | Get-View).Guest.ToolsStatus

I get : "toolsOk"

Then I run the invoke script.

In the script checking the VMtoold I am using the same credentials that fails in the Invok script.

Could it be related to the PowerCLI version? I am using version 5.1.0.4977

Thanks

0 Kudos
LucD
Leadership
Leadership

Could be, but then I would expect the issue to be there all the time, not sporadically after some time.


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

0 Kudos
epaz1000
Contributor
Contributor

I can add more information:

1. The target server is in isolated network (this is why I am using invoke).

2. It is part of a domain.

3. It does not got DC there.

4. The user I am using

5. the target VM is a live clone of a source VM in a network with DC. It should use cache credentials.

Can it be related to cache credentials policy from AD?

Thanks

0 Kudos
LucD
Leadership
Leadership

Could be, but that is by default 30 days.

Would that fit within your setup ?

When was the last time that server was able to contact a DC while the user logged on ?

If it is an isolated server, can't you use a local account ?


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

0 Kudos