Tuesday, 19 September 2017

Deleting a computer from SCCM With Powershell Script

Summary

Do you have IT staff who need delete resource access to SCCM for re-imaging purposes (e.g. Task Sequences only available to Unknown computers), but don’t wish to grant any access to the SCCM Console Itself.

Prerequisites

  • Latest Console installed (That matches your current SCCM Infrastructure)
    • AdminConsole.msi
  • ConfigMgr2012PowerShellCmdlets.MSI Installed
  • Powershell 3.0 or newer
  • Must have a user profile for elevated account e.g. under       c:\users\SCCM.Admin.Matt.Swanston\
  • Permissions must be setup by our SCCM Administrator
  • SCCM RBAC access requirements:
    • Read, Modify Resource, Delete Resource
  • Import Reg Setting for Admin account
  • https://github.com/TheBeardySCCMGuy/Deleting-a-computer-from-SCCM-With-Powershell

RBAC control requirements











Installing Prerequisites (SCCM Console and PSShellCmdlets)
Download Prerequisites installers 

Copy and paste command lines from RemoveComputerFromSCCM\Installers\Install.txt      Into CMD.exe (with Admin Account)

AdminConsole.MSI TARGETDIR="%programfiles(x86)%\Microsoft Configuration Console" ENABLESQM=0 DEFAULTSITESERVERNAME=FQDN.DOMAIN.COM /q /l*v c:\TEMP\SCCM1610Console.log

ConfigMgr2012PowerShellCmdlets.MSI /qn /l*v c:\TEMP\ConfigMgr2012PowerShellCmdlets.log

Check Install logs for 
c:\temp\SCCM1610Console.log
c:\temp\ConfigMgr2012PowerShellCmdlets.log

Look for exit code 0 at the end of the log file.

Edit the Reg File 
Import ImportSCCM_Settings.REG Settings (With Admin rights)






Run Deletion PowerShell Script
Troubleshooting steps

No comments:

Post a Comment