Hi Everyone ,
Hope you are doing great! Today i am writing about an scenario which talks about automating SCCM record removal through Orchestrator .
The runbook once created will look like the following :
You can use the following Powershell script to remove the record from the database :
$error.clear()
powershell{
cd “D:\Program Files\Microsoft Configuration Manager\AdminConsole\bin”;
import-module .\configurationmanager.psd1;
set-location \`d.T.~Ed/{7FD7AB41-87F7-4E8C-9218-BEE9ACC188E9}.{DEB5CFDE-44C0-474E-87D6-0AD6A68EF1A9}\`d.T.~Ed/:
remove-cmdevice -devicename “\`d.T.~Ed/{7FD7AB41-87F7-4E8C-9218-BEE9ACC188E9}.{4219AE46-A6F0-4C74-8F07-B159A362E39B}\`d.T.~Ed/” -force -ErrorAction SilentlyContinue
}
if ($error.count -gt 0) {
$result=$error[0].exception
} else {
$result=”success”
}
You can change the path of the configuration manager console accordingly .
Please let me know if you face any issues implementing the same .
Leave a Reply