Software Architecture – Office 365 – Single sigin-in/synchronization – Directory Federation Services 2.0 server failed due to invalid credentials

Software world is changing and growing for new dimensions. Cloud is one the direction which is supposed to be growing a lot in next few years.
Last few months in my office, I have been working on automation of office 365 administrative tasks via power shell commands in C#, a really new learning curve and I enjoyed it.
I made some good social networking with Office 365 experts / MVPs on net. I hit my head with Office 365 support forums for many things. …:)
A small module for office 365 automation is complete and one of the challenging task was a POC to configure Single sigin-in/synchronization for office 365. While working on it, I really realize that it is challenging task.
Problem domain:
Office 365 Enterprise programming via power shell commands via c#
Problem:
While following steps for single sign-in at:
http://onlinehelp.microsoft.com/en-us/office365-enterprises/ff652560.aspxwhen I followed “3. Set up a trust by adding or converting a domain for single sign-on” and ran “MsolAdfscontext” command, I got following error.

Set-MsolADFSContext : The connection to * Active
 Directory Federation Services 2.0 server failed due to invalid credentials.
At line:1 char:20
+ Set-MsolAdfscontext <<<<  -Computer  **
    + CategoryInfo          : InvalidOperation: (:) [Set-MsolADFSContext], Fed
   erationException
    + FullyQualifiedErrorId : ConnectionToGenevaServerFailed,Microsoft.Online.
   Identity.Federation.Powershell.ContextCredentialsCommand

The screen looked like as below:

After some googling I came to know that problem lies in “Installation and Configuration for Windows Remote Management”. According to MSDN:

If Windows Remote Management (WinRM) is not installed and configured, WinRM scripts do not run and the Winrm command-line tool cannot perform data operations. The Windows Remote Shell command-line tool, Winrs, event forwarding, and Windows PowerShell 2.0 remoting also depend on WinRM configuration.

So solution is to run command as “Winrm quickconfig” , so the output will be as:

For details visit:
http://msdn.microsoft.com/en-us/library/aa384372(v=vs.85).aspx
Happy coding for office 365.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: