0

How to check status of profile synchronization service using C#, Can we do this using C#.

0

Try this

foreach (SPService srv in SPFarm.Local.Services)
{
    if (srv.Name.Equals("profile synchronization service name"))
    {
        foreach (SPServiceApplication srvApp in srv.Applications)
        {
           var status = srvApp.Status;
        }
    }
}

You can also check all SPServiceApplication members here

  • 1
    Please, that kind of comment is not needed on all of your answers. Give users some time to test and verify your solution before posting a reminder-comment – Robert Lindgren Jul 28 '16 at 10:26
  • Thanks M.Qassas , Let me try with this.. I will let you know the thing i will do. – G.Srinivas Jul 28 '16 at 10:50
  • Dear @G.Srinivas takes your time my bro, I hope it helps you. I also here if you need any help or clarification :) – Mohamed El-Qassas MVP Jul 28 '16 at 19:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.