Example #1
0
        public async System.Threading.Tasks.Task <FileResult> DownloadDetectionScript(string Id)
        {
            GraphIntune graphIntune = new GraphIntune(null);
            Win32LobApp win32LobApp = await graphIntune.GetWin32MobileAppAsync(Id);

            Win32LobAppPowerShellScriptDetection script = await graphIntune.GetWin32MobileAppPowerShellDetectionRuleAsync(Id);

            string fileName = $"{FilenameHelper.ProcessFileName(win32LobApp.DisplayName)}_detect.ps1";

            return(File(Convert.FromBase64String(script.ScriptContent), "text/plain", fileName));
        }
Example #2
0
        public async Task <ActionResult> Win32AppPsDetectionScriptContent(string Id)
        {
            try
            {
                GraphIntune graphIntune = new GraphIntune(null);
                var         script      = await graphIntune.GetWin32MobileAppPowerShellDetectionRuleAsync(Id);

                string powerShellCode = Encoding.UTF8.GetString(Convert.FromBase64String(script.ScriptContent));
                return(PartialView("_PowerShellDetectionScriptContent", powerShellCode));
            }
            catch (ServiceException e)
            {
                Flash(e.Error.Message);
                return(RedirectToAction("Index", "Home"));
            }
        }
Example #3
0
        public async System.Threading.Tasks.Task <PartialViewResult> Win32AppPsDetectionScriptContent(string Id)
        {
            try
            {
                GraphIntune graphIntune = new GraphIntune(null);
                var         script      = await graphIntune.GetWin32MobileAppPowerShellDetectionRuleAsync(Id);

                string powerShellCode = Encoding.UTF8.GetString(Convert.FromBase64String(script.ScriptContent));
                return(PartialView("_PowerShellDetectionScriptContent", powerShellCode));
            }
            catch (Exception e)
            {
                Flash("Error getting DeviceManagementScripts" + e.Message.ToString());
                return(PartialView());
            }
        }
Example #4
0
        public async Task <ActionResult> DownloadDetectionScript(string Id)
        {
            try
            {
                GraphIntune graphIntune = new GraphIntune(null);
                Win32LobApp win32LobApp = await graphIntune.GetWin32MobileAppAsync(Id);

                Win32LobAppPowerShellScriptDetection script = await graphIntune.GetWin32MobileAppPowerShellDetectionRuleAsync(Id);

                string fileName = $"{FilenameHelper.ProcessFileName(win32LobApp.DisplayName)}_detect.ps1";
                return(File(Convert.FromBase64String(script.ScriptContent), "text/plain", fileName));
            }
            catch (ServiceException e)
            {
                Flash(e.Error.Message);
                return(RedirectToAction("Index", "Home"));
            }
        }