VMware Cloud Community
plscott
Contributor
Contributor

PowerShell CimException: Failed to get the zone information for domain.local on server dc.domain.local

I am running vRA 6.2.5 and have configured a catalog item to execute this PowerShell script.

Add-DnsServerResourceRecordA -Name "host24" -ZoneName "domain.local" -ComputerName "dc.domain.local" -AllowUpdateAny -IPv4Address "10.10.10.7" -TimeToLive 01:00:00

The script runs successfully on the IaaS server but I receive the following error executing it through vRA/vRO.  The IaaS server has been joined to the domain so no domain hopping (yet).  I have tried other PS scripts which execute successfully.  What am I missing?

[2017-01-19 14:21:02.716] [D] Invoke command in session 1fb44fbc-dbb6-485e-82d9-9ce7df3ddc1c

[2017-01-19 14:21:07.284] [I] PowerShellInvocationError: Errors found while executing script

Microsoft.Management.Infrastructure.CimException: Failed to get the zone information for domain.local on server dc.domain.local.

   at Microsoft.Management.Infrastructure.Internal.Operations.CimAsyncObserverProxyBase`1.ProcessNativeCallback(OperationCallbackProcessingContext callbackProcessingContext, T currentItem, Boolean moreResults, MiResult operationResult, String errorMessage, InstanceHandle errorDetailsHandle)

(Dynamic Script Module name : invokeScript#14)

3 Replies
DurgadeviN
Contributor
Contributor

I got the same issue,Then I have changed my code as following. and It works through vRO.

I have followed this nice article. Troubleshooting Tips: Orchestrator PowerShell Plug-in - VMware Blogs https://blogs.vmware.com/consulting/2016/05/troubleshooting-tips-orchestrator-powershell-plug-in.htm...

pastedImage_7.png

winrs -r:http://lan1dc1.vmware.com:5985 -ad -u:vmware\administrator -p:VMware1! powershell.exe Add-DnsServerResourceRecordA -Name "host24" -ZoneName "domain.local" -ComputerName "dc.domain.local" -AllowUpdateAny -IPv4Address "10.10.10.7" -TimeToLive 01:00:00

0 Kudos
DurgadeviN
Contributor
Contributor

Sorry guys, this is correct line of code.

winrs -r:http://lan1dc1.domain.local:5985 -ad -u:domain\administrator -p:VMware1! powershell.exe Add-DnsServerResourceRecordA -Name "hostname" -ZoneName "domain.local"  -AllowUpdateAny -IPv4Address "10.10.10.10" -TimeToLive 01:00:00

DurgadeviN
Contributor
Contributor

Here is vRO workflow with payload script.

0 Kudos