Hi,
I want to execute a powershell command in a VM and use the output of this command. Is it possible?
I already know how to run powershell command in VM with Run Program guest workflow.
Thanks,
Idan
You can either use Guest Operations API (connects through vmware tools, no network connection between vRO and the target VM needed) or the Powershell Plugin (through VM network).
For the first, check out the Guest Script Manager Package: Leveraging the Guest Script Manager package
If you want to use the Powershell Plugin, the invokeScript() method returns the output of the script, so you can process it later in your workflow. Check out these examples:
Optimizing PowerShell workflows in vRealize Orchestrator - VMware Cloud Management - VMware Blogs
My First vCenter Orchestrator Workflow – Part 4 – A look at the Powershell Plug-in | mwpreston.net
Regards,
Joerg
Thanks!
I use the Guest Script Manager package, and now I receive the output to the orchestrator.
But how can I use it?
I run a powershell command which retrieve from my Domain Controller all the distribution groups with their mail Addresses.
I would like to prompt a list of mail addresses when the user run the workflow.
How can I do it?
Thanks!
JSON works really well to pass results from powershell to vRO. I recommed formatting the text return from powershell as a JSON object. Using JSON objects in vRO is easy - please reference this blog post. Creating json objects in Orchestrator