aktueller stand
This commit is contained in:
@@ -1545,10 +1545,10 @@ namespace C4IT.DataHistoryProvider
|
||||
|
||||
var strUrl = string.Format(constMsGraphUserList, constMsGraphUserPaging);
|
||||
|
||||
if (!string.IsNullOrEmpty(Tenant.ScanFilter))
|
||||
strUrl += " and (" + Tenant.ScanFilter + ")";
|
||||
if (!string.IsNullOrEmpty(Tenant.ScanFilterUser))
|
||||
strUrl += " and (" + Tenant.ScanFilterUser + ")";
|
||||
|
||||
var Result = await MsGraph.RequestListAsync(strUrl, UseBeta: false, retryForbidden: false, loadPaged: true, ConsistencyLevelEventual: Tenant.UseConsistencyLevelEventual);
|
||||
var Result = await MsGraph.RequestListAsync(strUrl, UseBeta: Tenant.UseBetaUserFilter, retryForbidden: false, loadPaged: true, ConsistencyLevelEventual: Tenant.ConsistencyLevelEventualUserFilter);
|
||||
|
||||
var Count = 0;
|
||||
var Updated = 0;
|
||||
@@ -2058,7 +2058,7 @@ namespace C4IT.DataHistoryProvider
|
||||
try
|
||||
{
|
||||
List<cF4sdConnectorIds> Ids = await _collector.getConnectorIdList(ids.ToList(), token, null, 0);
|
||||
List<cF4sdApiSearchResultRelation> relations = await GetMobileDeviceAsync(Ids, token, null);
|
||||
List<cF4sdApiSearchResultRelation> relations = await GetUserMobileDevicesAsync(Ids, token, null);
|
||||
return new cF4sdStagedSearchResultRelations() { Relations = relations };
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -2505,7 +2505,7 @@ namespace C4IT.DataHistoryProvider
|
||||
return null;
|
||||
}
|
||||
|
||||
public async Task<List<cF4sdApiSearchResultRelation>> GetMobileDeviceAsync(List<cF4sdConnectorIds> UserId, CancellationToken Token, cF4sdWebRequestInfo requestInfo)
|
||||
public async Task<List<cF4sdApiSearchResultRelation>> GetUserMobileDevicesAsync(List<cF4sdConnectorIds> UserId, CancellationToken Token, cF4sdWebRequestInfo requestInfo)
|
||||
{
|
||||
MethodBase CM = null; if (cLogManager.DefaultLogger.IsDebug) { CM = MethodBase.GetCurrentMethod(); LogMethodBegin(CM); }
|
||||
try
|
||||
@@ -2513,34 +2513,23 @@ namespace C4IT.DataHistoryProvider
|
||||
string userIds = string.Join(",", UserId.Where(u => !string.IsNullOrWhiteSpace(u?.intuneId.ToString())).Select(u => u.intuneId));
|
||||
|
||||
var tenantId = UserId?.FirstOrDefault(u => u?.tenantId != Guid.Empty)?.tenantId ?? Guid.Empty;
|
||||
|
||||
var userId_str = "ef333f80-0ae1-40b3-826f-2dc69c80c1f0";
|
||||
var intuneId = new Guid(userId_str);
|
||||
var strUrl = string.Format(constMsGraphManagedMobileDeviceList, intuneId);
|
||||
|
||||
var strUrl = string.Format(constMsGraphManagedMobileDeviceList, userIds);
|
||||
|
||||
var MsGraph = await GetGraphForTenantAsync(tenantId, true);
|
||||
if (MsGraph == null)
|
||||
return null;
|
||||
|
||||
// Schritt 1: Abrufen der Recovery-Key IDs
|
||||
|
||||
var Result = await MsGraph.RequestListAsync(strUrl, UseBeta: false, retryForbidden: false);
|
||||
if (Result != null == Result.Count > 0)
|
||||
{
|
||||
var searchResult = new List<cF4sdApiSearchResultRelation>(Result.Count);
|
||||
//double _sumDuration = 0;
|
||||
|
||||
foreach (var Entry in Result)
|
||||
{
|
||||
var endDate = DateTime.MinValue;
|
||||
if (!DateTime.TryParse(Entry.Result.lastSyncDateTime?.ToString(), out endDate))
|
||||
endDate = DateTime.UtcNow;
|
||||
|
||||
//var startDate = DateTime.MinValue;
|
||||
//if (!DateTime.TryParse(Entry.Result.StartDate?.ToString(), out startDate))
|
||||
// startDate = DateTime.UtcNow;
|
||||
|
||||
//TimeSpan _duration = endDate - startDate;
|
||||
//_sumDuration += _duration.TotalSeconds;
|
||||
|
||||
|
||||
var searchInfo = new cF4sdApiSearchResultRelation()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user