Howto Remove ConfigMgr_SiteCode.Old.0 Folders in SCCM Reporting Services

Reporting service Point in SCCM can be really handy sometimes, when you need to lookup something in a AD domain. Specially when you will see how an deployment has been running.

I discover something strange on a customer’s reporting services. The SSRP Service has been created Loads of Folders with name ConfigMgr_SiteCode.OLD.0 And when I tried to Select every folders and remove them, the internet explorer hanged itself.

Before:

old reports

So I created this powershell script to remove all OLD folders.

<#
.SYNOPSIS
Remove SCCM Reporting Services Folders ConfigMgr_SiteCode.OLD.*

.DESCRIPTION
This Script will help us to remove SCCM Reporting Services folder, that has name ConfigMgr_SiteCode.OLD.*

.EXAMPLE
.\RemoveOldReportingServicesFolders.ps1

Enter the ConfigMgr Site Server Name:

Enter the Sitecode:

.NOTES

.LINK
#>

# Get data
$ConfigMgrServerName = Read-Host("Enter the ConfigMgr Site Server Name")
$ConfigMgrSiteCode = Read-Host("Enter the sitecode")

# Connect to Reporting Services
$URL = ("http://" + $ConfigMgrServerName + "/ReportServer/ReportService2005.asmx?WSDL")
$ConnectToReportService = New-WebServiceProxy -Uri $URL -UseDefaultCredential

# Get all report folders
$RemoveOldReportFolders = $ConnectToReportService.ListChildren("/", $True)

# Remove all Folder with name ConfigMgr_SiteCode.OLD.*
$RemoveOldReportFolders | Where-Object {$_.Name -like ("ConfigMgr_" + $ConfigMgrSiteCode + ".OLD.*")} | ForEach-Object {$ConnectToReportService.DeleteItem($_.Path); "Deleted Folder: " + $_.Name}


The Result:
old reports after

1 thought on “Howto Remove ConfigMgr_SiteCode.Old.0 Folders in SCCM Reporting Services”

  1. BOFHXX skriver:

    Thanks for this. Saved me a lot of time (Working on SCCM 2012R2)

Lämna ett svar

E-postadressen publiceras inte. Obligatoriska fält är märkta *

System Center Technical Preview

Along with the Technical Previews of Windows 10 and Windows Server, Microsoft has made the Microsoft System Center Technical Preview available for download. The Microsoft System Center Technical Preview delivers

System Center 2012 R2 and Windows Server 2012 R2 is now available at MSDN

You can now download All Products in System Center 2012 R2 and Windows Server 2012 R2 at MSDN. http://msdn.microsoft.com/en-us/subscriptions/downloads

PXE-boota en dator som redan finns i SCCM-databasen

Många organisationer har ett behov av att kunna PXE-boota datorer som redan finns med i SCCM-databasen det vill säga när en dator redan finns med i SCCM så går det