PowerShell Script to Automate Running ContentLibraryCleanup.exe Against All DPs in SCCM Site

This is a rough script that automates the running of the content library cleanup tool available after SCCM Build 1702. The script will connect to a SCCM site to build a list of distribution points to run against. This needs to be ran on the primary site server under account with full admin rights in SCCM. It checks four possible locations for the PS module and the cleanup tool. The script prompts for the SCCM site code, the FQDN of the primary site server, and if you want the tool to delete orphaned content or just log to the tools default log location. Continue reading “PowerShell Script to Automate Running ContentLibraryCleanup.exe Against All DPs in SCCM Site”

PowerShell Script to Look for Installed KB

This is a basic PowerShell script that can be used to determine if a KB related update is installed. You can use it to check and run an uninstall command or as part of a SCCM Compliance Settings configuration item. Yes, you can add updates directly to configuration baselines, but I am still learning PowerShell and wanted to do it the hard way. Plus, you can add additional script to it look at other things besides the presence of a KB to include installed software, state of a service, or registry settings. The compliance can also be switched around where having the KB installed is not complaint and then a remediation script can be used to uninstall the KB. Continue reading “PowerShell Script to Look for Installed KB”

SCCM Compliance Settings Scripts to Alter Service State

Previously I showed how I used SCCM Compliance Settings and Boundary Groups to apply BITS settings. This time I have a discovery and remediation script that can be used with enforce a specific state on a service. If you want to make sure a client’s App-V service stays up or Windows Defender is disabled because you are using another security suite, this could be of help. The script uses variables so someone could easily set the state of the service and start type to what they want. Continue reading “SCCM Compliance Settings Scripts to Alter Service State”

Using ConfigMgr Compliance Settings and a Boundary Group to Apply BITS Settings

The solution here makes use of a boundary group to determine if a SCCM client should use BITS to control content transfers and compliance settings set the BITS settings.  With SCCM build 1610, the boundary group IDs a client is associated with are store in WMI.  Using PowerShell, we are able to look at the boundary group ID and use it to help set BITS settings.  Fair warning with this solution.  While the boundary group ID is currently stored in WMI, I have been informed by Microsoft that this information isn’t meant to be customer facing and may go away in future SCCM builds, but it is something that is current available. Continue reading “Using ConfigMgr Compliance Settings and a Boundary Group to Apply BITS Settings”