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.
Make sure the module or snapin in is available on dem server
Sent from my iPhone
You got add the snapin before you run the cmdlets
Sent from my iPhone
I have this in the script: Import-Module DNSServer
Do I need to load something else?
Make sure the module or snapin in is available on dem server
Sent from my iPhone
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.
Welcome !
You might trying DNS snapin and powershell support might get installed with it.
Sent from my iPhone