SCCM SCUP WSUS Delete orphaned update with missing XML

Today I tried to expire old adobe reader and flash updates in SCUP, however some of updates failed to expire, most of them finished with success.
After publish I see only information that Publish Update failed.
What I tried:
1. use regular expire update – normal method
2. I skipped this because my issue was quite differed – https://blogs.technet.microsoft.com/jasonlewis/2010/06/16/how-to-remove-orphaned-scup-updates/

What I found:
1. SCUP trhows that expire update failed – no more errors. On SCUP.log I found:
PublishItem: --- Calling update server API to *expire* update 'Reader 11.0.01 Update (UpdateId:'e066fa50-eab2-4dba-bae2-0a36ca61c2fa' Vendor:'Adobe Systems, Inc.' Product:'Adobe Reader')' Updates Publisher 1601-01-01 00:00:00 11 (0x000B)
PublishItem: Exception occurred attempting to expire the update: The specified item could not be found in the database. Updates Publisher 1601-01-01 00:00:00 11 (0x000B)

This doesn’t give me more info…

2. I inspected WSUS Server log – %ProgramFiles%\Update Services\LogFiles\SoftwareDistribution.log
2016-07-20 07:59:28.569 UTC Warning w3wp.140 SoapExceptionProcessor.SerializeAndThrow Discarding stack trace for user ******\adam.hnat, IP Address ::1, exception Microsoft.UpdateServices.Administration.WsusObjectNotFoundException: The specified item could not be found in the database. ---> System.Data.SqlClient.SqlException: There is no SDP Xml for this Update
at Microsoft.UpdateServices.DatabaseAccess.DBConnection.DrainObsoleteConnections(SqlException e)
at Microsoft.UpdateServices.DatabaseAccess.DBConnection.ExecuteReader()
at Microsoft.UpdateServices.Internal.SingleResultSetSPHandler.ExecuteStoredProcedure(DBConnection connection)
at Microsoft.UpdateServices.Internal.GenericDataAccess.ExecuteSP(String spName, DBParameterCollection args, IExecuteSPHandler handler, Int32 queryTimeoutInSeconds)
at Microsoft.UpdateServices.Internal.GenericDataAccess.ExecuteSP(String spName, DBParameterCollection args, IExecuteSPHandler handler)
at Microsoft.UpdateServices.Internal.DatabaseAccess.CommonDataAccess.ExecuteSPSingleResultSet(String spName, DBParameterCollection args, Type resultType, Int32 queryTimeoutInSeconds)
at Microsoft.UpdateServices.Internal.DatabaseAccess.AdminDataAccess.ExecuteSPGetSdpXmlForUpdate(Guid updateId, Int32 revisionNumber)

It seems that SQL query returned “There is no SDP Xml for this Update”. Let’s check that!
I’ve exected query on SUSDB:
exec exec spGetSdpXmlForUpdate @updateID='E066FA50-EAB2-4DBA-BAE2-0A36CA61C2FA',@revisionNumber=2
and it returned: There is no SDP Xml for this Update

3. In this step I checked what is in spGetSdpXmlForUpdate procedure, check table contents and found that table tbUpdates is populated with Update ID, table tbXML contains UpdateID but doesn’t contain SDP XML for my update

4. [Solution] I was looking for method to fill in missing info based on updated XML avaliable in SCUP … but I was too lazy to write scripts that will fix that. Instead of that I’ve decided to remove update inforamtion from database, so I executed query on SUSDB:
exec dbo.spDeleteUpdateByUpdateID @updateID='dc3d262e-f15f-40b2-8436-ff43fb0cb0dd'
In my case issue was with “Reader 11.0.01 Update” to get updateID see below image:

SCUP update ID
SCUP update ID

5. After success delete in SCUP I pressed “reactivate” button on affected update – it published successfully!
6. I expired affected update, then published again – and success

I hope that if you face same issue this will be useful for you.

SCCM 2012 Wykrywanie metody połączenia klienta (Intranet Internet)

Komenda powershellu pozwalająca wykryć typ połączenia klienta (Internet czy Intranet)

$IsInternetClient = (Get-WmiObject -namespace root\ccm -query "select InInternet from ClientInfo").InInternet

$IsInternetclient przyjmuje wartość $true jeśli klient jest podłączony jako Internet
$IsInternetclient przyjmuje wartość $false jeśli klient jest podłączony jako Intarnet

SCCM 2012 Installation for lazy part 1 – SQL

In this post I will show you method of installation SCCM for lazy people (like I am). This can be useful for testing purposes as well it might be used in production. Main reason to develop those “scripts” was many dependencies that have to be meet before we install SCCM, like windows features, port configurations, optional product installation. In this article I will be base on Windows 2012 / Windows 2012 R2 with all commands, so let’s start.
Continue reading SCCM 2012 Installation for lazy part 1 – SQL

SCCM 2012 Installation for lazy part 2 – SCCM

Let’s go to Configuration Manager 2012  installation dependencies!

1. Install Windows feature dependencies at one big step

Run powershell, place windows CD/iso in cdrom drive (in my case D: )and type:

Continue reading SCCM 2012 Installation for lazy part 2 – SCCM