This code i made to be able to make a cleanup task for PC’s no longer in use. This script remove computers from domain when running WinPE.
This was one of the steps that was done. Another step deleted objects in McAfee EPO and SCCM.
To be able to delete a PC within a domain from a non-domain PC you need to install ADSI on the WinPE image.
SCCM
Change from BIOS to UEFI during SCCM Task Sequence (Lenovo PC’s) with Powershell
When you need to change the UEFI settings like SecureBoot – or other settings – with PowerShell, this script here can be handy. You define the settings for your needs in the $ DesiredSettings variable