The System Center Configuration Manager 2012 R2 tool ClientPushGenerator.exe allows ConfigMgr admins to push the SCCM client to machines listed in a text file. There's some brief but good explanation in the "Generate CCR Tool" section at the end of this Microsoft article.
In my current project I used the tool successfully on the first system that I attempted to push the client to. However, any subsequent attempt would fail with the following code exception.
The SMS provider log reported the following:
"*** [23000][2627][Microsoft][SQL Server Native Client 11.0][SQL Server]Violation of UNIQUE KEY constraint 'ClientPushMachine_G_AK'. Cannot insert duplicate key in object 'dbo.ClientPushMachine_G'. The duplicate key value is (-2)."
I looked a the ClientPushMachine_G table and it had just one record. This record was for the computer that the tool was able to push the client to the very first time.
From the error in the SMS provider log and the table I could see that the tool was trying to use a MachineID of "-2" for subsequent push attempts but this value was already taken by the first record. The table has a key constraint that does not allow records with duplicate MachineID values.
Pushing to discovered clients from the console worked.
I called Microsoft support. The technician said he would research and get back to me. The next day he said that he was able to reproduce the problem on his lab. However, he explained to me that the ClientPushGenerator.exe tool has the same requirement as the manual client push where the record has to be discovered first. Indeed using the tool to push it to systems that had already been discovered worked.
Although I've always understood that one of the benefits of the tool is that you don't have to discover a system before pushing the client, I could not find any documentation stating this. Thankfully, a Microsoft Support Escalation Engineer got involved and indicated that there's a problem with the SQL Stored Procedure that the tool calls: sp_CP_GenerateCCRByName.
The escalation engineer provided an updated stored procedure that he put together, and this fixed the problem. There was little risk in modifying the stored procedure because it is only used by the ClientPushGenerator.exe tool.
The updated stored procedure will be included in the next version of SCCM. If you need it for the current version (SCCM 2012 R2), contact Microsoft support.
In my current project I used the tool successfully on the first system that I attempted to push the client to. However, any subsequent attempt would fail with the following code exception.
The SMS provider log reported the following:
"*** [23000][2627][Microsoft][SQL Server Native Client 11.0][SQL Server]Violation of UNIQUE KEY constraint 'ClientPushMachine_G_AK'. Cannot insert duplicate key in object 'dbo.ClientPushMachine_G'. The duplicate key value is (-2)."
I looked a the ClientPushMachine_G table and it had just one record. This record was for the computer that the tool was able to push the client to the very first time.
From the error in the SMS provider log and the table I could see that the tool was trying to use a MachineID of "-2" for subsequent push attempts but this value was already taken by the first record. The table has a key constraint that does not allow records with duplicate MachineID values.
Pushing to discovered clients from the console worked.
I called Microsoft support. The technician said he would research and get back to me. The next day he said that he was able to reproduce the problem on his lab. However, he explained to me that the ClientPushGenerator.exe tool has the same requirement as the manual client push where the record has to be discovered first. Indeed using the tool to push it to systems that had already been discovered worked.
Although I've always understood that one of the benefits of the tool is that you don't have to discover a system before pushing the client, I could not find any documentation stating this. Thankfully, a Microsoft Support Escalation Engineer got involved and indicated that there's a problem with the SQL Stored Procedure that the tool calls: sp_CP_GenerateCCRByName.
The escalation engineer provided an updated stored procedure that he put together, and this fixed the problem. There was little risk in modifying the stored procedure because it is only used by the ClientPushGenerator.exe tool.
The updated stored procedure will be included in the next version of SCCM. If you need it for the current version (SCCM 2012 R2), contact Microsoft support.