MicrosoftDocs / sccm-docs-powershell-ref

Configuration Manager PowerShell documentation public repo
https://docs.microsoft.com/powershell/sccm/configurationmanager/
Creative Commons Attribution 4.0 International
26 stars 61 forks source link

Unable to create second deployment type for existing application while reusing detectionchecks #200

Closed AndrzejWojtowicz closed 3 years ago

AndrzejWojtowicz commented 3 years ago

I have existing $SCCMDetectionChecks ArrayList where I am storing all detection clauses.

Then I am running Add-CMScriptDeploymentType -ApplicationName $SCCMApplicationName -AddDetectionClause $SCCMDetectionChecks

and it works fine. However while trying to add second deployment type to existing application SCCM i get the below error:

ConfigMgr Error Object:
instance of SMS_ExtendedStatus
{
    Description = "The digest is not valid";
    ErrorCode = 1078462235;
    File = "..\\sspconfigurationitem.cpp";
    Line = 1981;
    Operation = "PutInstance";
    ParameterInfo = "";
    ProviderName = "ExtnProv";
    SQLMessage = "[42000][3998][Microsoft][SQL Server Native Client 11.0][SQL Server]Uncommittable transaction is detected at the end of the batch. The transaction is rolled back.";
    SQLSeverity = 16;
    SQLStatus = 3998;
    StatusCode = 2147749889;
};

I have found some info on the internet that reusing existing detection clause objects might be causing this but was unable to narrow down the issue or find a workaround.

Any ideas?

AndrzejWojtowicz commented 3 years ago

I have found a workaround - re-instantiate detection clause objects and then it works. This is still not a permanent solution though.

aczechowski commented 3 years ago

Thanks @AndrzejWojtowicz for taking the time to share this with the Configuration Manager documentation team. I’m sorry that you’re having problems, and I want to make sure it gets to the right people that can help. There are a couple of options available to provide the best level of support for this: