Sharepoint Client Object Model Check SharePoint Site Availability

To check SharePoint Site is available or not using client object model use below code .

#region “Validatre Sharepoint Site”
private bool ValidateSPSite(string SharepointSite)
using (ClientContext clientContext = new ClientContext(SharepointSite))
clientContext.Credentials = System.Net.CredentialCache.DefaultCredentials;

Microsoft.SharePoint.Client.Web web = clientContext.Web;

Microsoft.SharePoint.Client.Web site = clientContext.Web;



return true;
catch (Exception)
return false;


Parameter SharepointSite is the name of Sharepoint Site which we want to check that if it is exist or not.





Leave a Reply

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

You are commenting using your 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 )

Connecting to %s