Beispiel #1
0
        public async Task <ActionResult> Win32AppDetectionScripts()
        {
            try
            {
                GraphIntune graphIntune = new GraphIntune(null);
                var         apps        = await graphIntune.GetWin32MobileAppsAsync();

                List <Win32LobApp> win32LobApps = new List <Win32LobApp>();

                foreach (Win32LobApp app in apps)
                {
                    var details = await graphIntune.GetWin32MobileAppAsync(app.Id);

                    if (details.DetectionRules.Any(d => d is Win32LobAppPowerShellScriptDetection))
                    {
                        win32LobApps.Add(details);
                    }
                }

                return(View(win32LobApps));
            }
            catch (ServiceException e)
            {
                Flash(e.Error.Message);
                return(RedirectToAction("Index", "Home"));
            }
        }
Beispiel #2
0
        public async System.Threading.Tasks.Task <ViewResult> Win32AppDetectionScripts()
        {
            try
            {
                GraphIntune graphIntune = new GraphIntune(null);
                var         apps        = await graphIntune.GetWin32MobileAppsAsync();

                List <Win32LobApp> win32LobApps = new List <Win32LobApp>();

                foreach (Win32LobApp app in apps)
                {
                    var details = await graphIntune.GetWin32MobileAppAsync(app.Id);

                    if (details.DetectionRules.Any(d => d is Win32LobAppPowerShellScriptDetection))
                    {
                        win32LobApps.Add(details);
                    }
                }

                return(View(win32LobApps));
            }
            catch (Exception e)
            {
                Flash("Error " + e.Message.ToString());
                return(View());
            }
        }