I created a sequence task to remove a PC from our inventory, it reinstalls the PC, delete the BIOS password and uninstalls the MECM client.
But today I need to remove the autopilot pc.
I have a powershell script that works with api graph from my PC.
Except that from my TS, it doesn't work.
All messages ares :
PackageManagementInstall-Package : No match found for specified search criteria and name RunPowerShellScript 27/11/2023 13:38:14 5264 (0x1490)
of the WindowsAutopilotIntune module. Use Get-PSRepository to display all available registered RunPowerShellScript 27/11/2023 13:38:14 5264 (0x1490)
available repositories. RunPowerShellScript 27/11/2023 13:38:14 5264 (0x1490)
At character C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 : 21 RunPowerShellScript 27/11/2023 13:38:14 5264 (0x1490)
+ ... $null = PackageManagement\Install-Package @PSBoundParameters RunPowerShellScript 27/11/2023 13:38:14 5264 (0x1490)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RunPowerShellScript 27/11/2023 13:38:14 5264 (0x1490)
+ CategoryInfo : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Ex RunPowerShellScript 27/11/2023 13:38:14 5264 (0x1490)
ception RunPowerShellScript 27/11/2023 13:38:14 5264 (0x1490)
+ FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage RunPowerShellScript 27/11/2023 13:38:14 5264 (0x1490)
here is the beginning of the script :
Set-ExecutionPolicy Unrestricted -Force
Install-Module -Name Microsoft.Graph.DeviceManagement.Enrollment -Force
Import-Module -Name Microsoft.Graph.DeviceManagement.Enrollment
what do I have to do to make it work?
But today I need to remove the autopilot pc.
I have a powershell script that works with api graph from my PC.
Except that from my TS, it doesn't work.
All messages ares :
PackageManagementInstall-Package : No match found for specified search criteria and name RunPowerShellScript 27/11/2023 13:38:14 5264 (0x1490)
of the WindowsAutopilotIntune module. Use Get-PSRepository to display all available registered RunPowerShellScript 27/11/2023 13:38:14 5264 (0x1490)
available repositories. RunPowerShellScript 27/11/2023 13:38:14 5264 (0x1490)
At character C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 : 21 RunPowerShellScript 27/11/2023 13:38:14 5264 (0x1490)
+ ... $null = PackageManagement\Install-Package @PSBoundParameters RunPowerShellScript 27/11/2023 13:38:14 5264 (0x1490)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RunPowerShellScript 27/11/2023 13:38:14 5264 (0x1490)
+ CategoryInfo : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Ex RunPowerShellScript 27/11/2023 13:38:14 5264 (0x1490)
ception RunPowerShellScript 27/11/2023 13:38:14 5264 (0x1490)
+ FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage RunPowerShellScript 27/11/2023 13:38:14 5264 (0x1490)
here is the beginning of the script :
Set-ExecutionPolicy Unrestricted -Force
Install-Module -Name Microsoft.Graph.DeviceManagement.Enrollment -Force
Import-Module -Name Microsoft.Graph.DeviceManagement.Enrollment
what do I have to do to make it work?