You are browsing the archive for Azure.

Avatar of alkin

by alkin

part 2: Getting facebook status updates when something happens to my servers.

7:46 am in Azure, Powershell, SytemCenter by alkin

In my previous blogpost I explained how to install the powershell Facebook Module.

Today I’m going to show you how you can get Facebook status updates when something happens to your server. To simulate this I will create a new runbook that will shut down all the virtual machines in a certain cloud in Azure and then post a facebook status update with the name of the servers that have been shut downed.

To be able to do this I created the following Orchestrator runbook:

image

This workflow will get a list of the Cloud services running in Azure and then stop all the Virtual Machines in that Cloud. After that a status update will be posted on facebook saying which server has been turned off.

The first activity is the get Azure cloud service properties to retrieve cloud service properties

image

We can then use the output of the cloud service activity in the Virtual machine activity to stop all the VM’s in the discovered cloud.

image

The last activity is a .Net activity that will import the facebook module and post a new status update on facebook with the new-FBfeed command

image

The result will be something like this

image

Thanks,

Alexandre Verinderen

Avatar of alkin

by alkin

Part 1: How to manage your clouds with Facebook

6:18 am in Azure, Powershell, SytemCenter by alkin

At SystemCenter Universe Asia I showcased how you can manage your cloud from Facebook:

image

As I’m really a geek I’m following my servers as friends on Facebook.

So this will not be just one blogpost but will be a series of different posts covering the following:

  1. Part 1; Installing the Facebook Powershell module
  2. Part 2: Getting facebook status updates when something happens to my servers like a shutdown or start.
  3. Deploy a website in Azure from Facebook.
  4. Adding a new friend (or server) in the cloud
  5. Unfriending a “friend” (or server) from Azure

Let’s get started with installing the Facebook Powershell module!

First of all download the Facebook Powershell module from here: http://facebookpsmodule.codeplex.com/ . Facebook PowerShell Module is a PowerShell module for managing Facebook, developed in PowerShell script.

The most important functions are:

  • New-FBConnection: This command sets up the initial Facebook connection which you will need to use most other commands. You will only need to do this once, after that the connection will be cached in your Windows profile.
  • Get-FBFriend: This command retrieves the list of friends of the specified user. Note that default Facebook permissions do not permit Facebook applications to retrieve “friends of friends” lists, even though these are available from the Facebook GUI. This is a limitation of the Facebook API, not of FacebookPSModule.
  • Get-FBAlbum, Get-FBFeed, Get-FBGroup, Get-FBPhoto, Get-FBPost: These commands similarly retrieve other classes of information.
  • Get-FBEvent: This command retrieves the list of events of the specified user or group. Only “future” events will be retrieved, and only if the user has not explicitly responded “will not attend”.
  • Get-FBMember: Retrieves the list of members of a group.
  • Get-FBAssociation: This is a worker function for Get-FBFriends, Events and Feed, but it also provides access to other “Connections” offered by the Facebook Graph API for which specific commands are not yet available.
  • Get-FBObjectData: This retrieves data on a specific object. The object can be of any type. The –Fields parameter specifies the data to retrieve; if you do not specify this, Facebook will choose a default set of fields depending on the object type. Get-FBObjectData returns a single object with parameters corresponding to the requested fields. Individual fields may not be present on the return object if they are not specified for the Facebook object, or if you do not have permission to retrieve them. Note that most Get-FB* commands have a -Fields parameter; it is generally more efficient to retrieve them up front rather than make multiple calls to Get-FBObjectData.
  • Add-FBBulkPhotos: Copy multiple photos to a Facebook album
    *Read-FBBulkPhotos: Copy all the photos in a Facebook album to files, or all the photos in all Facebook albums.
  • New-FBPost: Creates a new post in the user or page feed.
  • New-FBEvent: This command creates a new Facebook event for the current user.
  • New-FBEventInvite: Invites users to an existing event.
  • New-FBPhoto: Upload a photo from your computer to a Facebook album.
  • Show-FBMessageDialog: This command helps send bulk Facebook messages. Facebook does not permit sending messages to be completely automated, but you can use this command to send messages with just a few clicks for each group of 50 recipients.

Once you have donwloaded the zip file run the “FacebookPsModule Aplha .msi”

A welcome window will be open “Click on Next”

The default folder to save the module file in “WindowsPowershell” located in My Document or Documents, Leave it as it is and click on “Next”

Installation starts.

Installation Complete , click on “Close”

Next open up powershell and import the Facebook module

Connect to your Facebook by typing: New-FBConnection

image

when you run the New-FBConnection cmdlet a Facebook login windows will open.

Now provide your Email ID and password and make sure that you checked on “Keep me logged in” and then click on “Log In”. Facebook will ask you to approve the “external” application.

After you clicked on allow, all is done and you will see this . that means connection with your Facebook account is successful.

In the next blog post I’m going to show how to get a facebook status update if something happens to one of my servers.

Thanks,

Alexandre Verkinderen

I want to thank Cameron Fuller for brainstorming with me on how this could be achieved.

Avatar of alkin

by alkin

Powershell Deployment Toolkit and WAP

2:50 pm in Azure, SytemCenter by alkin

The latest publicly available PDT version 2.5.270 now includes besides System Center 2012 R2 also Windows Azure Pack.

You can find the new WAP roles in the Variable.xml as shown below:

clip_image002

You will notice that a few roles are missing like the SMA role. You can easily include the SMA Roles

  • System Center 2012 R2 Service Management Automation Web Service Server
  • System Center 2012 R2 Service Management Automation PowerShell Module
  • System Center 2012 R2 Service Management Automation Runbook Worker Server

by just copying the missing roles from the workflow.xml into your variable.xm like this:

<Role Name="System Center 2012 R2 Service Management Automation Runbook Worker Server" Component="System Center 2012 R2 Service Management Automation">

image

Thanks to Rob Willis for pointing this out to me.

Alexandre Verkinderen

Avatar of alkin

by alkin

Join the next IT Camps on Windows 8 and Windows Azure!

11:24 am in Azure, it camps, Technet, Windows 8 by alkin

 

IT Camps

Microsoft IT Camps are free, hands-on technical trainings for IT professionals led by Microsoft experts. Don’t miss the opportunity to elevate your skills by learning more about Windows 8 and Windows Azure through our free IT Camps!
Register now for a Windows 8 IT Camp on

· February 25th in the morning or afternoon or evening in Kortrijk

· February 28th in the morning or afternoon or evening in Genk

Or dive deep into Windows Azure on

· February 26th in the morning or afternoon in Genk

· February 27th in the morning or afternoon in Kortrijk

· February 28th in the afternoon in Mons

Get started

Visit Us On TwitterVisit Us On Linkedin