Remove Computer from Collection after OSD

Benoit LecoursPowershell, SCCMLeave a Comment

This post is a step-by-step guide on how to remove computer from collection after OSD. If you’re using specific collections for your OSD deployments you certainly knows that the collections are not emptied automatically. After a couple of weeks, you’ll end up with a collection full of systems. The bad news is that there’s nothing built-in the product, the good new is that our friend PowerShell can do this dirty job. To run the script : The imported module needs to be trusted The script must run in x86 mode The computer account must have proper permission (SCCM and DCOM) … Read More

3 Useful Powershell Commands

Benoit LecoursPowershell, SCCMLeave a Comment

Here’s 3 useful Powershell commands that you can use to save time. #1 – Clear PXE Cache from your OSD Collection Who likes to clear the PXE cache of deployed computers ? Not me ! Instead of this :   Run this : Clear-CMPxeDeployment -DeviceCollectionId “YourCollectionID” #2 – Unlock an object Instead of this : ZzzzzZz (waiting) Run this : Unlock-CMObject -InputObject $(Get-CMApplication -Name “Application Name”) TIP : You can change “Get-CMApplication” for “Get-CMTaskSequence” if you want to unlock a Task Sequence for exemple. #3 – List which collection has Incremental update enabled Did you know Microsoft supports only 200 collection using … Read More

Send an Email when OSD Completes a Deployment

Benoit LecoursPowershell, SCCM30 Comments

Did you know that SCCM can take an action when a specific message is generated on the site server? SCCM records everything it does. You are probably familiar with the tons of logs files but SCCM also record everything on the site server itself. A quick look to the Status message shows that there’s tons of available information. Monitoring / System Status / Status Message Queries / All Status Message : As you can see, there’s lots of valuable information in there. Yeah great !… now what ? Using the power of PowerShell, I tell SCCM to send an email each … Read More

Add Server Requirement using Powershell

Benoit LecoursPowershell, SCCM1 Comment

SmsSwDistCacheDirDelete in ccmsetup.log 03

Before an installation of SCCM, you need to enable a couple of requirements in sccm 2012 server roles and features. You can add these using the server manager snap-in but since you are a good admin, you know that you can use Powershell ! Here’s the commands I use in the script to enable the required roles before my SCCM installations : Get-Module servermanager Install-WindowsFeature Web-Windows-Auth Install-WindowsFeature Web-ISAPI-Ext Install-WindowsFeature Web-Metabase Install-WindowsFeature Web-WMI Install-WindowsFeature BITS Install-WindowsFeature RDC Install-WindowsFeature NET-Framework-Features Install-WindowsFeature Web-Asp-Net Install-WindowsFeature Web-Asp-Net45 Install-WindowsFeature NET-HTTP-Activation Install-WindowsFeature NET-Non-HTTP-Activ Run it in a PowerShell prompt and get a coffee while the magic happens, you earn … Read More