Ackles
asked on
Powershell delete computer from SCCM
Hello,
I need help to user Powershell to delete a computer from SCCM by providing the name only.
However, before deleting it should capture the UUID & MAC ADDRESS for reference.
Any help is appreciated.
Regards,
A
I need help to user Powershell to delete a computer from SCCM by providing the name only.
However, before deleting it should capture the UUID & MAC ADDRESS for reference.
Any help is appreciated.
Regards,
A
Here you go
$DeviceName = Read-Host -prompt "Please Enter Device Name"
$DeviceDetails = Get-CMDevice -Name $DeviceName
$DeviceDetails = $DeviceDetails | Select-Object -Property Name, MACAddresses, SMBIOSGUID
$DeviceDetails | Export-Csv -Path "c:\Temp\SCCMRemovedDevices.csv" -NoTypeInformation
Remove-CMDevice -Name $DeviceName -Force
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi,
Have you been able to test this?
Have you been able to test this?
ASKER
Hi There,
Sorry yesterday was crazy.... will let you know today.
Sorry yesterday was crazy.... will let you know today.
ASKER
Excellent!
Thanks!
Thanks!
Perfect, glad it worked
Didn't see you logged it :) I added this code to the other one as well.
Open in new window
I am adding the remove now