{"id":28775,"date":"2022-05-17T13:23:25","date_gmt":"2022-05-17T13:23:25","guid":{"rendered":"https:\/\/endusersupports.com\/?p=28775"},"modified":"2022-06-06T11:04:07","modified_gmt":"2022-06-06T11:04:07","slug":"how-to-deploy-powershell-script-in-intune","status":"publish","type":"post","link":"https:\/\/endusersupports.com\/index.php\/2022\/05\/17\/how-to-deploy-powershell-script-in-intune\/","title":{"rendered":"How to Deploy PowerShell Script in Intune"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"28775\" class=\"elementor elementor-28775\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-3e6028a elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"3e6028a\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-97b90f5\" data-id=\"97b90f5\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-c2ddc04 elementor-widget elementor-widget-text-editor\" data-id=\"c2ddc04\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p id=\"prerequisites\" class=\"heading-anchor\"><span style=\"color: #ffffff;\"><strong>How to Deploy PowerShell Script in Intune<\/strong><\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-4bd14a5 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"4bd14a5\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-170f290\" data-id=\"170f290\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-476aac3 elementor-widget elementor-widget-text-editor\" data-id=\"476aac3\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Login to MEM(Microsoft Endpoint Manager) console and click on Devices then click on scripts as highlighted in below screen.<\/p><p><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter wp-image-28788\" src=\"http:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-1.jpg\" alt=\"\" width=\"900\" height=\"413\" srcset=\"https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-1.jpg 1097w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-1-300x138.jpg 300w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-1-1024x470.jpg 1024w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-1-768x352.jpg 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/p><p>Click on Add button then select <strong>Windows 10 and later.<\/strong><\/p><p><img decoding=\"async\" class=\"aligncenter wp-image-28789\" src=\"http:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-2.jpg\" alt=\"\" width=\"900\" height=\"516\" srcset=\"https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-2.jpg 972w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-2-300x172.jpg 300w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-2-768x440.jpg 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/p><p>Fill the Script Name and Description then click on Next.<\/p><p><img decoding=\"async\" class=\"aligncenter wp-image-28790\" src=\"http:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-3.jpg\" alt=\"\" width=\"700\" height=\"814\" srcset=\"https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-3.jpg 709w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-3-258x300.jpg 258w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p><p>Click on browse in Script Location then select the PowerShell script file that we want to deploy on Device.\u00a0<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-28792\" src=\"http:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-4.jpg\" alt=\"\" width=\"700\" height=\"800\" srcset=\"https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-4.jpg 714w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-4-263x300.jpg 263w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/>Select the PowerShell file then click on Open.<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-28793\" src=\"http:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-5.jpg\" alt=\"\" width=\"900\" height=\"488\" srcset=\"https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-5.jpg 1722w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-5-300x163.jpg 300w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-5-1024x555.jpg 1024w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-5-768x416.jpg 768w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-5-1536x832.jpg 1536w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/p><p>Click on Next.<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-28794\" src=\"http:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-6.jpg\" alt=\"\" width=\"700\" height=\"803\" srcset=\"https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-6.jpg 713w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-6-261x300.jpg 261w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p><p>Click on Add Group under Included group to deploy script on Devices.\u00a0\u00a0<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-28795\" src=\"http:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-7.jpg\" alt=\"\" width=\"900\" height=\"495\" srcset=\"https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-7.jpg 1525w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-7-300x165.jpg 300w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-7-1024x563.jpg 1024w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-7-768x423.jpg 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/p><p>Click on Next.<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-28796\" src=\"http:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-8.jpg\" alt=\"\" width=\"700\" height=\"884\" srcset=\"https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-8.jpg 655w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-8-238x300.jpg 238w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p><p>Here you can see the Review, If you want to modify something click on Previous and modify, otherwise click on Add.<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-28797\" src=\"http:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-9.jpg\" alt=\"\" width=\"700\" height=\"1083\" srcset=\"https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-9.jpg 536w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-9-194x300.jpg 194w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p><p>Can see the script name here that were created. Click on script name to view the deployment status.<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-28798\" src=\"http:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-10.jpg\" alt=\"\" width=\"900\" height=\"363\" srcset=\"https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-10.jpg 1336w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-10-300x121.jpg 300w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-10-1024x413.jpg 1024w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-10-768x310.jpg 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/p><p>Here you can see Assigned status :Yes,\u00a0<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-28799\" src=\"http:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-11.jpg\" alt=\"\" width=\"900\" height=\"732\" srcset=\"https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-11.jpg 1042w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-11-300x244.jpg 300w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-11-1024x832.jpg 1024w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-11-768x624.jpg 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/p><p>Login to Device if you want to test script immediate, Login to Company Portal and then click on Settings.<\/p><p>Click on Sync button to get latest policy from Intune.<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-28800\" src=\"http:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-12.jpg\" alt=\"\" width=\"900\" height=\"1020\" srcset=\"https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-12.jpg 688w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-12-265x300.jpg 265w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/p><p>Open the <strong>IntuneManagementExtentsion.log<\/strong> file from this location.<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-28801\" src=\"http:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-13.jpg\" alt=\"\" width=\"900\" height=\"442\" srcset=\"https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-13.jpg 750w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-13-300x147.jpg 300w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/p><p>Check the logs file that client received policy.<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-28802\" src=\"http:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-14.jpg\" alt=\"\" width=\"900\" height=\"539\" srcset=\"https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-14.jpg 1308w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-14-300x180.jpg 300w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-14-1024x614.jpg 1024w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-14-768x460.jpg 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/p><p>Press F3 and Type\u00a0 [PowerShell] to filter PowerShell related logs.<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-28803\" src=\"http:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-15.jpg\" alt=\"\" width=\"900\" height=\"487\" srcset=\"https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-15.jpg 1307w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-15-300x162.jpg 300w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-15-1024x554.jpg 1024w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-15-768x415.jpg 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/p><p>Check the PowerShell Body and validate PowerShell script.<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-28804\" src=\"http:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-16.jpg\" alt=\"\" width=\"900\" height=\"539\" srcset=\"https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-16.jpg 1270w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-16-300x180.jpg 300w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-16-1024x614.jpg 1024w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-16-768x460.jpg 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/p><p>Here you can see the Folder has been created.<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-28805\" src=\"http:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-17.jpg\" alt=\"\" width=\"900\" height=\"518\" srcset=\"https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-17.jpg 798w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-17-300x173.jpg 300w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-17-768x442.jpg 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/p><p>Go to the MEM console and select the deployed\u00a0 script the got the Device status tab to check script status.<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-28806\" src=\"http:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-18.jpg\" alt=\"\" width=\"900\" height=\"303\" srcset=\"https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-18.jpg 1157w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-18-300x101.jpg 300w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-18-1024x344.jpg 1024w, https:\/\/endusersupports.com\/wp-content\/uploads\/2022\/05\/Script_Deployment-18-768x258.jpg 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>How to Deploy PowerShell Script in Intune Login to MEM(Microsoft Endpoint Manager) console and click on Devices then click on scripts as highlighted in below screen. Click on Add button then select Windows 10 and later. Fill the Script Name and Description then click on Next. Click on browse in Script Location then select the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":28821,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[14],"tags":[],"class_list":["post-28775","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mem"],"views":855,"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/endusersupports.com\/index.php\/wp-json\/wp\/v2\/posts\/28775","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/endusersupports.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/endusersupports.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/endusersupports.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/endusersupports.com\/index.php\/wp-json\/wp\/v2\/comments?post=28775"}],"version-history":[{"count":24,"href":"https:\/\/endusersupports.com\/index.php\/wp-json\/wp\/v2\/posts\/28775\/revisions"}],"predecessor-version":[{"id":29067,"href":"https:\/\/endusersupports.com\/index.php\/wp-json\/wp\/v2\/posts\/28775\/revisions\/29067"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/endusersupports.com\/index.php\/wp-json\/wp\/v2\/media\/28821"}],"wp:attachment":[{"href":"https:\/\/endusersupports.com\/index.php\/wp-json\/wp\/v2\/media?parent=28775"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/endusersupports.com\/index.php\/wp-json\/wp\/v2\/categories?post=28775"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/endusersupports.com\/index.php\/wp-json\/wp\/v2\/tags?post=28775"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}