Returns user account statistics for the specified time period.
AuthUserNameA StatInfoResult instance containing the results of the GetUserStats action.
In this sample, the number of message sent and received, in the last 7 days, for each user in the domain is returned.
using System;
using svcUserAdmin;
class svcUserAdminGetUserStats
{
static void Main()
{
string usr = "admin@domain.net";
string pss = "alskdjfhtt";
string dom = "domain.net";
DateTime e = DateTime.Today;
DateTime s = e.Subtract(new TimeSpan(TimeSpan.TicksPerDay * 7));
StatInfoResult stats;
svcUserAdmin admin = new svcUserAdmin();
UserInfoListResult domain = admin.GetUsers(usr, pss, dom);
if(domain.Result)
{
foreach(UserInfo user in domain.Users)
{
stats = admin.GetUserStats(usr, pss, user.UserName, s, e);
Console.WriteLine("Account Name: {0}\r\nDate Range: {1:d} - {2:d}\r\nSent: {3} Messages\r\nReceived: {4} Messages\r\n",
user.UserName,
s,
e,
stats.MessagesSent,
stats.MessagesReceived);
}
}else{
Console.WriteLine (domain.Message);
}
}
}
svcUserAdmin Class | svcUserAdmin Namespace