Office 365 Network

In case you are not aware, but the Office 365 Network on Yammer is moving to a new platform, here is the official announcement. Come checkout Office 365 Network Preview and get your profile set up and start monitoring that platform.  It looks pretty good.  Based on the Yammer pin board messages, the network is moving in September.

I am actually excited because at my company the Yammer SSO was very cumbersome and now this will be a thing of the past as the new platform, built on top of Lithium social platform, allows open search and collaboration via open identity providers i.e. Live Id or O365 Identity.

Now, I still think that the best platform for answering the technical support questions is the Microsoft Office Community forum site which, unfortunately, I am only able to monitor scarcely these days.  This new platform is more towards socializing with the developer team and other thought leaders for

Go and explore it now!

Advertisements

Check for Group existence in SharePoint Site

In SharePoint 2013 server side object model (SSOM), it appears that the Method overloads of the SPGroupCollection such as GetByName() or indexer all throw an exception when the group is not found.  However, you can still use reflection to get non throwing version of the methods. In my project I ended up creating an extension method that wraps the reflection based function call.

public static class SPGroupCollectionExtensions
{
  public static SPGroup GetByNameNoThrow(this SPGroupCollection group, string groupName)
  {
    var method = group.GetType().GetMethod("GetByNameNoThrow", BindingFlags.Instance | BindingFlags.NonPublic);
var parameters = new object[] {groupName};
    return (SPGroup)method.Invoke(group, parameters);
   }
}

User Profile Synchronization Service won’t start due to PowerShell profile

Recently, I had been asked by the colleague to help them troubleshoot the issue where User Profile Synchronization service would hang during the attempt start.

There were no error logs except that it would return to Stopped state. We found out that if the account that you login is the same account that you run the User Profile Synchornization Service and that account has a powershell profile, then it causes the issue. It appears that during the start process of the UPS Synch service, it runs the PowerShell runspace with the default shell as opposed to creating its custom shell, so default profiles in your documents folder would be loaded. Thus, the issue.

Best way to resolve is to ensure that even in your dev environment, you must make sure that you’re not running your interactive shell with the account that’s running SharePoint services processes.

View SharePoint Deployment Progress

In the past, I have blogged that when a developer deploys the a WSP package through PowerShell, it’s nice to see if the deployment job succeeds before moving on to the next step.

In the past, this is the command I have used:

Get-SPSolution -Identity SomeSolution.wsp | Select Last* | fl

And waited until all servers in the farm are reporting that deployment is successful.  However, at times the job is still running.  A more robust approach I use now is to look for JobExists property and ensure that it’s false.  Therefore updated command I use now:

Get-SPSolution -Identity SomeSolution.wsp | Select Last*, JobExists | fl

Deleting TFS Work Item

I was creating a number of user stories and associating the Tasks to users, and quickly realized that the TFS 2013 still does not have a way to delete a task.  Woooaahhh!!!

There is a way to do it via command line, via witadmin tool:

witadmin destroywi /Collection:<TFS Collection URL> /id:<id of the task>

Resetting the DNS server list to static in Azure

The SharePoint 2013 development environment in Azure that i maintain contains a fully fledged AD/DNS infrastructure. To keep things lean, i did not want to maintain a separate infrastructure VM and just combine the roles. However, every time the machine is restarted, the IP interface settings needs to be adjusted. I need to ensure that the Azure provided DNS server needs to be come secondary DNS server in the list while loopback address stays as primary. I have not fully automated this just yet, but here is the command-line methods to get it done.

netsh interface ip "Ethernet 8" add dnsserver 127.0.0.1 primary
netsh interface ip add dnsserver "Ethernet 8" 100.112.12.40 index=2

To update the DNS services forwarder to the new server ip address:

import-module DnsServer
Set-DnsServerForwarder -IPAddress 100.112.12.40

Managing Azure dev environment from PowerShell

Recently, I’ve been spending some time prototyping the new SharePoint 2013 App Model in my Azure provision SP2013 development environment.  I wanted to make sure that i can shut it down or start it up quickly.  So PowerShell is of course the answer here.

Small assumption is that the Azure Service Name matches the Virtual Machines. It is possible to have multiple virtual machines provisioned under the same service Name

First, ensure that the valid Azure subscription is attached to the Azure command line session:

Get-AzureAccount

If that returns no subscriptions, then use Add-AzureAccount commandlet to add an active subscription.
To start/stop the Azure Virtual Machines I use these commands:

Get-AzureVM -ServiceName <ServiceName> | Start-AzureVM
Get-AzureVM -ServiceName <ServiceName> | Stop-AzureVM -Force:$true

I’ll add more commands as i start doing more complex things with Azure dev boxes as I go along.