Procedure_to_shutdown_and_start_VM_using_CMD.docx<\/a> (216 KB)<\/p>","upvoteCount":6,"datePublished":"2015-09-28T08:39:03.000Z","url":"https://community.spiceworks.com/t/script-to-stop-and-start-the-azure-vms/438950/1","author":{"@type":"Person","name":"sunilkatke9881","url":"https://community.spiceworks.com/u/sunilkatke9881"}},{"@type":"Answer","text":"Hi,<\/p>\n
What error you are facing?<\/p>\n
You say you want to schedule it, does that means that your actual procedure works line per line but not when you create a .ps1 file with multiple commands inside?<\/p>\n
If so, then it can be an execution policy issue.<\/p>\n
Open a PS console on the computer that executes the scheduled taks, then type<\/p>\n
set-executionpolicy unrestricted\n<\/code><\/pre>\nTry again, and it will work.<\/p>\n
If that’s not the issue, could you please give us the details of the error you are facing?<\/p>","upvoteCount":0,"datePublished":"2015-09-28T09:29:32.000Z","url":"https://community.spiceworks.com/t/script-to-stop-and-start-the-azure-vms/438950/2","author":{"@type":"Person","name":"nicolaslang","url":"https://community.spiceworks.com/u/nicolaslang"}},{"@type":"Answer","text":"
Azure has functionality for this named “Automation”, now I’m not certain if you’re registered for this, but it handles this just fine according to the documentation.<\/p>\n
Now maybe you’re looking to do this without having to pay for the additional feature of “Automation” but I would consider using that.<\/p>","upvoteCount":0,"datePublished":"2015-09-28T09:31:42.000Z","url":"https://community.spiceworks.com/t/script-to-stop-and-start-the-azure-vms/438950/3","author":{"@type":"Person","name":"dbeuerlein","url":"https://community.spiceworks.com/u/dbeuerlein"}},{"@type":"Answer","text":"
I don’t have any unrestricted policy. i’m not getting any error. I need a script so i can stop and start the VM with one click.<\/p>\n
I have not created any .ps1<\/p>\n
<\/p>","upvoteCount":0,"datePublished":"2015-09-28T10:13:39.000Z","url":"https://community.spiceworks.com/t/script-to-stop-and-start-the-azure-vms/438950/4","author":{"@type":"Person","name":"sunilkatke9881","url":"https://community.spiceworks.com/u/sunilkatke9881"}},{"@type":"Answer","text":"
Thanks Team, i tried the Automation and it worked, i’m able to start and stop the VM’s using a Script.<\/p>\n
You can close this.<\/p>","upvoteCount":0,"datePublished":"2015-10-08T15:45:50.000Z","url":"https://community.spiceworks.com/t/script-to-stop-and-start-the-azure-vms/438950/6","author":{"@type":"Person","name":"sunilkatke9881","url":"https://community.spiceworks.com/u/sunilkatke9881"}}]}}