VMware Cloud Community
john23
Commander
Commander

Need script to create vm (all inputs read from SQL)


Hi,

We are in process of writing script, to read all the inputs from SQL database. I got the script where it  reads inputs from CSV file.

I am able to connect to SQL instance using powershell. If someone has script ( which can be shared) or guide me to read inputs from SQL database and create vm in powershell. It would be helpful.

Thanks

-A

Thanks -A Read my blogs: www.openwriteup.com
0 Kudos
3 Replies
LucD
Leadership
Leadership

You can find a decent intro on how to read data from a SQL table in How do I query a SQL Server DB using PowerShell, and how do I filter, format and output to a file?

Once you have the input parameters, the rest of the script should be the same as when you read the input from a CSV


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

john23
Commander
Commander

Thanks Lucd,

I have used system DSN for connectivity, and asp for frontend.

I will share the complete script...

Thanks -A Read my blogs: www.openwriteup.com
0 Kudos
john23
Commander
Commander

I have created system DNS & mapped using power shell.

From ASP to powershell communication used text file for the flow....

Thanks -A Read my blogs: www.openwriteup.com
0 Kudos