Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

PowerShell - Invoking an external script with multiple $servers

$
0
0

Greetings..

I am really enjoying vCO 5.5.2. Yet, still hard to figure out certain non vCenter API workflows etc..

 

If I would like to run the script listed below - which would remove SCOM 2012 agent from multiple servers, which is the best way to create the workflow so it prompts me for the servers I would like to run the "working" PS scripts again.


PS host is in tact and does one-liners via Invoke an external script from the PowerShell library..but I'm not sure I understand how to call a script to either a txt file with multiple servers or would I develop a workflow which for prompt me for the $servernames like the attached screen shot.. Is the "Arguements" field where one inputs the $servernames ?

 

The script I am trying to call, which does work locally from the server is -

 

FROM A SERVER OTHER THAN THE SERVER WITH THE AGENT INSTALLED - (provide name of server with agent to remove)

Invoke-Command -ComputerName XXXSERVER01 -Command {Import-Module 'C:\Program Files\Microsoft System Center 2012 R2\Operations Manager\Powershell\OperationsManager'; 'C:\Program Files\Microsoft System Center 2012 R2\Operations Manager\Powershell\OperationsManager\Functions.ps1'; 'C:\Program Files\Microsoft System Center 2012 R2\Operations Manager\Powershell\OperationsManager\Startup.ps1'; Get-SCOMAgent -DNSHostName %FQDN_OF_SERVER_TO_UNINSTALL% | Uninstall-SCOMAgent}

 

Please help me understand if you can and move forward.


Thank you..


Viewing all articles
Browse latest Browse all 6251

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>