Need to delete specific 200 devices from Intune
Question
Hi Experts ,
I need to delete specific windows devices from Intune , Can you please help me with the PowerShell script to perform this activity.
Example : We will give the device name in the csv and then script will help us to delete the device.
Thanks,
Ketan
Answers ( 2 )
Issue Solved : Used script from link :
https://smsagent.blog/2020/03/17/delete-device-records-in-ad-aad-intune-autopilot-configmgr-with-powershell/
— Ran the script with below modification m given list of devices with below script :
$computer_list = Import-Csv “C:\temp\Script_test.csv”
foreach ($computer in $computer_list)
{
.\Delete-AutopilotedDeviceRecords.ps1 -ComputerName $($computer.ComputerName) -Intune
}
Ketan Kamble,
Could you share your script.. I have looked at: https://smsagent.blog/2020/03/17/delete-device-records-in-ad-aad-intune-autopilot-configmgr-with-powershell/
but I am unsure exactly where to use:
$computer_list = Import-Csv “C:\temp\Script_test.csv”
foreach ($computer in $computer_list)
{
.\Delete-AutopilotedDeviceRecords.ps1 -ComputerName $($computer.ComputerName) -Intune
}
As I also wish to delete AAD devices I would look to use the command:
Remove-AzureADDevice -ComputerName $($computer.ComputerName)
your expertese would be greatly appreciated