VMware Cloud Community
lmonaco
Hot Shot
Hot Shot
Jump to solution

vCAC 6: Workflow with PowerShell Error

Trying to call a simple PowerShell script that adds a DNS record after the machine is provisioned.

The script runs fine when I run it from the server, but I get the following error when I call it from vCAC.


Workflow "WFStubMachineProvisioned" failed with the following exception:

The term 'Add-DnsServerResourceRecordA' is not recognized as the name of a cmdlet, function, script file, or operable program.

Check the spelling of the name, or if a path was included, verify that the path is correct and try again.



Tags (1)
Reply
0 Kudos
1 Solution

Accepted Solutions
harkamal
Expert
Expert
Jump to solution

Make sure the module or snapin in is available on dem server

Sent from my iPhone

View solution in original post

Reply
0 Kudos
5 Replies
harkamal
Expert
Expert
Jump to solution

You got add the snapin before you run the cmdlets

Sent from my iPhone

Reply
0 Kudos
lmonaco
Hot Shot
Hot Shot
Jump to solution

I have this in the script: Import-Module DNSServer

Do I need to load something else?

Reply
0 Kudos
harkamal
Expert
Expert
Jump to solution

Make sure the module or snapin in is available on dem server

Sent from my iPhone

Reply
0 Kudos
lmonaco
Hot Shot
Hot Shot
Jump to solution

That might be an issue. To my understanding, that cmdlet is only available on Win2012/Win8.

The scripts and designer are on a 2012 R2 box.

The DEM server is 2008 R2.

When you install DNS Server Tools on 2012, you get both dnscmd and the PowerShell Module for DNS server.

When you install DNS Server Tools on 2008, you only get dnscmd.

I guess my next step is to test the following:

I'll install dnscmd on the DEM server and change the PowerShell script to use dnscmd instead of Add-DnsServerResourceRecordA.

Thanks for your input.

Reply
0 Kudos
harkamal
Expert
Expert
Jump to solution

Welcome !

You might trying DNS snapin and powershell support might get installed with it.

Sent from my iPhone

Reply
0 Kudos