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

Calling a PowerShell script to prompt for $servername or text file

$
0
0

I have this script working on 2008 R2 servers when run remotely with domain admin user: It creates a local user and then adds that user to local Administrators account.

 

$cn = [ADSI]"WinNT://$servername.com"

 

 

$user = $cn.Create("User","_decommission")

 

 

$user.SetPassword("P@ssword1")

 

 

$user.setinfo()

 

 

$user.Description = "Test user"

 

 

Invoke-command -computername $servername.com -scriptblock {net localgroup Administrators /add $servername\_decom}

 

How do I utilize vCO to call this script to where I have it prompt me for the $servername and/or to point to a text file with the list of servers??

 

Please help..


Viewing all articles
Browse latest Browse all 6251

Trending Articles



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