How to get Dynamics CRM Version number using CRM SDK and C# Console Application?

Use the below code to get the Dynamics CRM Version number using CRM SDK and Console Application C#.

RetrieveVersionRequest request = new RetrieveVersionRequest();

RetrieveVersionResponse response = (RetrieveVersionResponse)organizationService.Execute(request);
Version version = new Version(response.Version);
and include the above code to check the result.
Final code looks like the below.
Retrieve Version Request and Response
Output:
Retrieve Version Request and Response - Output
Note:
This feature was released in Microsoft Dynamics CRM 2015 Online Update 1
(v7.1) and will work perfectly in the below CRM versions
Dynamics 365 (online), Dynamics 365 (on-premises), Dynamics CRM 2016,
Dynamics CRM Online

How to get users details under Teams using SQL query in CRM?

Run the below query to get all the users details under all the Teams available in CRMS.

Select
Team.name [Team Name],
SysUser.Fullname [User Name],
SysUser.mobilephone [Mobile Phone],
SysUser.internalemailaddress [Primary Email]
from
dbo.FilteredSystemUser SysUser
inner Join
dbo.FilteredTeamMembership TeamMem
on SysUser.Systemuserid = TeamMem.Systemuserid
Inner join dbo.FilteredTeam Team
on Team.TeamID = TeamMem.TeamID
–where Team.name in –Uncomment this where condition to specify the required Team names
–(
–Sales Person
–)
order by Team.NAME