Auto Diskpart and stale entry delete from SCCM during Imaging process

I know many of the build administrators are deploying the Task Sequence on unknown device collection. I purpose and the idea behind it is to do not deploy the task sequence on a production device and prevent accidental data loss.

If the machine is in SCCM collection and we want to run the task sequence on it, we must SCCM Console and do a manual deletion job and wait for a couple of minutes to restart the imaging on the target machine

This is a time-consuming and repetitive task for us. Can we create a way to do this in an automotive way? Like, create the PowerShell Script, which will automatically read the machine's MAC Address and connect to the SCCM database from the WinPE environment for getting all the hostnames to hold by that mac address and delete each.

Also, can we do a diskpart at the same time to avoid further imaging failure? Yes we can create the PowerShell Script and integrate it with Boot Image, which will automatically check whether the machine having an internal storage device attached or not, and based on the results script will perform Diskpart operation, if the internal storage device is faulty or not connected in BIOS, the script will prompt the error.

Provide Hostname and delete Machines from SCCM console - PowerShell automation

Hello Friends,

Suppose, if I have 200 machines hostname and each hostname having 2-3 machines in the SCCM console and you want to delete each machine from the console. you will be irritated doing this job manually. the reason behind it, its time-consuming activity and repetitive task.

why you are not doing smart work? how?

Let's say we have a scenario like above and you have one PowerShell script in which you added all the machines hostname into it and just run the script and it deleted all the desired machines from the console while you finish a cup of tea 😉

Yes, We can create the PowerShell script like this using ConfigurationManager.psd1 SCCM PS module.

Import the PowerShell module first and then connect to the Primary Site Server. To get the hostname of the machine from a file, we have to create one input file named "hostnameinput.txt" in the same directory where we have created and kept the PowerShell script. Once you create the input text file paste all the machines hostname into the file and runs the below script with SCCM admin privileges.

Provide MAC address and delete Machines from SCCM console

Hello Friends,

If I have 200 machines MAC Addresses and each MAC address having 2-3 machines in the SCCM console and you want to delete each machine from the console. you will be irritated doing this job manually. the reason behind it, its time-consuming activity and repetitive task.

why you are not doing smart work? how?

Let's say we have a scenario like above and you have one PowerShell script in which you added all the MAC addresses into it and just run the script and it deleted all the desired machines from the console while you finish a cup of tea 😉

Yes, We can create the PowerShell script like this using ConfigurationManager.psd1 SCCM PS module.

Import the PowerShell module first and then connect to the Primary Site Server. To get the MAC Addresses from a file, we have to create one input file named "macaddressinpput.txt" in the script root directory where we have created and kept the PowerShell script. Once you create the input text file paste all the MAC Addresses into the file and runs the below script with SCCM admin privileges.