Yammer from the command line
Someone on our Yammer network at work had a simple question about how often we talk about certain topics. I thought the question deserved an answer and provided me an opportunity to brush up on my PowerShell scripting. After looking around I found PSYammer on CodePlex. To get started with this Snap-In, you’ll need to do the following.
Download the latest build.
Register a new application on Yammer. Once you save your settings, you will get an OAuth consumer key and consumer secret.
In the Visual Studio solution that you downloaded, change the key and secret in the settings file as well as the app.config. That’s two places. Get them both.
Build the solution. Make sure to note the Platform that the build is configured for (x86/x64/AnyCPU).
Run installutil to register the add-in with the PowerShell runtime. Make sure that the version of installutil (Framework vs Framework64) you run matches the Platform the binaries were built for and matches the version of PowerShell you plan to use.
If you use the console that comes from codeplex, the Snap in will automatically be loaded, otherwise call Add-PSSnapIn PSYammer.
The first time you use a new Yammer (OAuth) application, you will have to validate, so call Set-Yammer-Authorization, and you should get redirected to a page in Yammer warning you that that an application wants to use your credentials. Take the PIN presented in the web page and type it into the PowerShell prompt. At this point, the powershell cmdlet is setup and you can inject messages into Yammer by using Set-Yammer-Message.
And when we go to check our work …
More to come in another post …