Quick tip ! Azure Automation

November 19, 2014

Hello,

Want to save some money on your cloud infra ? Make sure to put it off when you’re not using it.

And now you have the ability to use some automation features for this.

Compare it to orchestrator here : http://msdn.microsoft.com/en-us/library/azure/dn643629.aspx

 

Log on to the azure management portal and open automation

 


 

Create an account

 


Fill in accountname and select region

 


Ok now we can create a new runbook . You can create one from scratch or use an existing runbook.

 


In this case we want to shut down the environment.

 

You can review the script presented.

 


And modify the name, account or subscription.

 


 

Ok now go to the runbook and modify the required parameters.

Use the author command.

 


 

Test the runbook

 


 

And verify the result

 

 


 

As you can see we need to create a connection Asset. So back to to the runbooks -> Assets.

Additional information about the assets can be found here http://azure.microsoft.com/blog/2014/07/29/getting-started-with-azure-automation-automation-assets-2/


And add a setting. Make sure to copy your subscription ID before starting the wizard !


 

Select a connection, Azure, give it a name.

 


And create a cert and paste your subscription id.

 

 

Now create a self signed certificate for uploading to Azure.

Use server 2012 R2 web services.

 

Open IIS -> Server certificates

 


 

Create a self signed certificate

 


 

Modify name and leave it in personal store

 

 

 

Click view details and copy to file

 


 

Export once as cer without private key.

 


And once as .pfx with the private key.

 


 

Now add the .cer file to Azure management certificates.

 


 

Now back to Azure Automation and create an additional credential asset.

 


 

Next up browse for your .pfx file and enter your password.

 


 

 

Now go to the runbook and modify the parameters using the author tool.

 


 

$MyConnection -> This your Automation connection created in the assets section

$MyCert = This is the name of the new imported credential in the assets section

 

Also correct the Azure subscription name hardcoded in the script.

 

 


 

Save , test and verify result.


 

Haleluja ! Success !

Now all we need to do is add a schedule and that’s it.

Publish.


 

Now create a new schedule

 


Name it.

 


In this case set to Friday , 19:00 each 7 days.

 


That’s it , imagine the possibilities.

 

Enjoy.

Gino D

Additional info can be found here : http://blogs.technet.com/b/keithmayer/archive/2014/04/04/step-by-step-getting-started-with-windows-azure-automation.aspx

 



Application Approval Request Notification from Configuration Manager 2012 using Powershell

May 27, 2014

Hi all,

 

Today I was working at a customer and configuring the Application Catalog using Configuration Manager 2012 R2. The customer was interested in the application approval process but was a little disappointed that out-of-the-box it’s not possible to receive notifications when an approval request arrives in Configuration Manager.

As the customer only has Configuration Manager it’s not possible to use any other System Center product like Orchestrator or Service Manager to get things going.

I created an alternative under the form of a Powershell script that runs on a specific schedule (eg. Once every day) to gather all application requests that have a pending approval. This report is emailed to the IT mailbox of the customer. This also makes sure that an administrator doesn’t have to check every now and then in the approval request section of the Configuration Manager console to see if anything new has arrived.

What the script does is basically the following:

  • Reading all data from the WMI class SMS_UserApplicationRequest
  • Filtering all requests which have a current state of 1 ( which means requested)
  • Creating an HTML document which displays a table with all pending requests
  • Sending an email to the IT mailbox with the table as contents. The table contains per request: username, application name, comments and last modified date

The report looks as follows

Application_request_27052014_1

Anyone that might be interested in this script can comment below and I’ll be happy to help.

Cheers,

B