{"id":7511,"date":"2023-11-30T01:03:42","date_gmt":"2023-11-30T01:03:42","guid":{"rendered":"https:\/\/pariswells.com\/blog\/?p=7511"},"modified":"2024-06-14T04:01:29","modified_gmt":"2024-06-14T04:01:29","slug":"powershell-script-to-bulk-approve-other-drivers-in-intune-driver-updates-for-windows-10-and-later","status":"publish","type":"post","link":"https:\/\/pariswells.com\/blog\/research\/powershell-script-to-bulk-approve-other-drivers-in-intune-driver-updates-for-windows-10-and-later","title":{"rendered":"Powershell script to Bulk Approve &#8220;Other Drivers&#8221; in Intune &#8220;Driver updates for Windows 10 and later&#8221;"},"content":{"rendered":"\n<p><strong>Fixed by Microsoft<\/strong> <strong>Now<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2024\/06\/image-7.png\"><img loading=\"lazy\" decoding=\"async\" width=\"870\" height=\"194\" src=\"https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2024\/06\/image-7.png\" alt=\"\" class=\"wp-image-8007 img-responsive\" srcset=\"https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2024\/06\/image-7.png 870w, https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2024\/06\/image-7-300x67.png 300w, https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2024\/06\/image-7-768x171.png 768w\" sizes=\"auto, (max-width: 870px) 100vw, 870px\" \/><\/a><\/figure>\n\n\n\n<p><strong>Powershell<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"powershell\" class=\"language-powershell\">if(-not (Get-Module Microsoft.Graph.Authentication -ListAvailable)){\nInstall-Module Microsoft.Graph.Authentication\n}\n\nif(-not (Get-Module Microsoft.Graph.Beta.DeviceManagement.Actions   -ListAvailable)){\nInstall-Module Microsoft.Graph.Beta.DeviceManagement.Actions\n}\n  \n# Import the necessary module  \nImport-Module Microsoft.Graph.Authentication  \nImport-Module Microsoft.Graph.Beta.DeviceManagement.Actions  \n  \n# Authenticate with an MFA enabled account  \nConnect-MgGraph -Scopes \"DeviceManagementConfiguration.ReadWrite.All\"  \n\n\n \n#get all the profile ids\n# Define the initial URL for the query  \n$url = \"https:\/\/graph.microsoft.com\/beta\/deviceManagement\/windowsDriverUpdateProfiles\/\"  \n\n\t# Use Invoke-MgGraphRequest to send a GET request to the specified URL and get the response  \n\t$response = Invoke-MgGraphRequest -Uri $url -Method GET  \n\n\n\n\t\tforeach ($driverprofile in $response.value) {  \n\t\t\t\t# Get the id for the current item  \n\t\t\t\t$driverprofileid = $driverprofile.id  \n\n\t\t\t# Define the initial URL for the query  \n\t\t\t$url = \"https:\/\/graph.microsoft.com\/beta\/deviceManagement\/windowsDriverUpdateProfiles\/$driverprofileid\/driverInventories?$filter=category+eq+'other'+and+approvalstatus+eq+'needsreview'\"  \n\t\t\t  \n\n\t\t\tdo {  \n\t\t\t\t# Use Invoke-MgGraphRequest to send a GET request to the specified URL and get the response  \n\t\t\t\t$response2 = Invoke-MgGraphRequest -Uri $url -Method GET  \n\t\t\t  \n\t\t\t\t# Loop through each item in the 'value' property of the response  \n\t\t\t\tforeach ($item in $response2.value) {  \n\t\t\t\t\t# Get the id for the current item  \n\t\t\t\t\t$id = $item.id  \n\t\t\t  \n\t\t\t\t\t# Define the parameters for the Invoke-MgBetaExecuteDeviceManagementWindowsDriverUpdateProfileAction command  \n\t\t\t\t\t$params = @{  \n\t\t\t\t\t\tactionName = \"Approve\"  \n\t\t\t\t\t\tdriverIds = @(  \n\t\t\t\t\t\t\t$id  \n\t\t\t\t\t\t)  \n\t\t\t\t\t\t#deploymentDate = [System.DateTime]::Parse(\"2023-11-30T23:00:00.000Z\")  \n\t\t\t\t\t\tdeploymentDate = Get-Date\n\t\t\t\t\t}  \n\t\t\t  \n\t\t\t\t\t# Invoke the command with the specified parameters  \n\t\t\t\t\tInvoke-MgBetaExecuteDeviceManagementWindowsDriverUpdateProfileAction -WindowsDriverUpdateProfileId $driverprofileid -BodyParameter $params  \n\t\t\t\t}  \n\t\t\t  \n\t\t\t\t# Get the next page link  \n\t\t\t\t$url = $response2.'@odata.nextLink'  \n\t\t\t} while ($null -ne $url) # Continue as long as there's a next page link\n\n\t\t}\n#Disconnect Graph \nDisconnect-Graph<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Fixed by Microsoft Now Powershell<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7511","post","type-post","status-publish","format-standard","hentry","category-research"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/7511","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/comments?post=7511"}],"version-history":[{"count":4,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/7511\/revisions"}],"predecessor-version":[{"id":8009,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/7511\/revisions\/8009"}],"wp:attachment":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/media?parent=7511"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/categories?post=7511"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/tags?post=7511"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}