You can use a RetrieveOrganizationsRequest on the Discovery web service. Each OrganizationDetail is the response includes the version number of the Organization, and the major part of this version will match the CRM version (5.x = CRM 2011, 6.x = CRM 2013,
7.x = CRM 2015, 8.0 / 8.1 = CRM 2016 and 8.2 = Dynamics 365)
Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk