Forums on Intune, SCCM, and Windows 11

Welcome to the forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your topics and posts, as well as connect with other members through your own private inbox!

SCCM/ConfigMgr SDMPackageXML - creating ID numbers (ResourceID, etc.) and icon data encoding

  • Thread starter Thread starter VBScab
  • Start date Start date
  • Replies Replies 0
  • Views Views 3K
  • Tags Tags
    sccm

VBScab

New Member
Messages
1
Reaction score
0
Points
1
For God knows how many years (yes, really!), I have been building a tool to automate adding applications to SCCM in a GUI.

For historical reasons, I am using VBScript in an HTA rather than Powershell. Please: I don't have the time to adapt all my code to PS, never mind rebuilding the UI in Windows Forms (or whatever) so can I respectfully ask that you do not reply with "Just do it in PS." I wasted weeks trying to emulate the behaviour that I get with hiding and revealing HTML elements on a page, depending on user choices.

So my pain is in just 3 parts of the creation of the SDMPackageXML data. The bulk of the resulting XML exactly matches the output I get when retrieving the SDMPackageXML from existing applications, so my code is good. I have two "issues", though.

Presently, I generate 10-digit random numbers to use for my ID numbers such as ResourceID. On some of my existing applications, however, the numbers are 9 digits in length. I suspect there is a query that can be run against the database to produce the number, as I strongly suspect that they are meant to be consecutive.

Next, I have failed at the hurdle of creating the ID stringfor the icon. The icon ID entry looks like this:

Icon Id="Icon_Q6ANSlI0LiNSq1eRJ9twgoJxhPmoVzwqy7pxsvVJhj8"

Any idea how that's generated? If you have an algorithm for it too, I'd be forever in your debt.

Lastly, how do I create the binary stream for the icon data? Most of what I've read suggests that it's Base-64 encoded but no matter whose code I use - including the method which uses the ADODB.Stream object - I end up with lines 72 characters long. Here are the first 2 lines from one:

TVrCkAAAAMWlA8W8AwAA6buc4KeC6buw4KeCBAAAAMW9A8aSA8uM4KeCIAAAAMWlA8aTAwAA 5YCs4Kq+5YGI4Kq+AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

whereas the line-length in an existing application's XML is 1025 (apart from the first which is 81 characters):

iVBORw0KGgoAAAANSUhEUgAAAUEAAAFGCAIAAAB7abreAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8Y QUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAkdEVYdENvbW1lbnQATEVBRCBUZWNobm9sb2dpZXMgSW5jLiBWMS4wMX7Qgw0AAD4/SURBVHhe7Z15fJTVvf/pLUJvQbgEKlIQWRSQTRBLgWKlIgrIolaWiuwESliVAqLCReoGKAJ14SIoqxSk7CICIiLrhSgkZU+JYQkIsmjbe3/3WvT3nvkM507JZJgkk2Se5Pv+47zOPPM855zv8jlLJpkUSTMMw8uYhg3D25iGDcPbmIYNw9uYhg3D25iGDcPbmIYNw9uYhg3D25iGDcPbmIYNw9uYhg3D25iGDcPbmIYNw9uYhg3D25iGDcPbmIYNw9uYhg3D25iGDcPbmIYNw9uYhg3D25iGDcPbmIYNw9uYhg3D25iGDcPbmIYNw9uYhg3D25iGDcPbmIYNw9uYhg3D25iGDcPbmIYNw9uYhg3D25iGDcPbmIYNw9uYhg3D25iGDcPbmIYNw9uYhg3D25iGDcPbmIYNw9uYhg3D25iGDcPbmIYNw9uYhg3D25iGDcPbmIYNw9uYhg3D25iGDcPbmIYNw9uYhg3D25iGDcPbmIYNw9uYhg3D25iGDcPbmIYNw9uYhg3D2xT54osvjh8/fvLkScrU1NRjx45R8gbXjXyEKACVEydOEA7iQp0w+aNmGP9HkZSUFOUHGhZc9SWRka8oFghYSL1Eyh81w/g/fOuw5nteKF0kY+WQkV8gWiAcxEIB4uKpU6d8QTOMIIpIt9RIlL/4IV10xchHEDARcQsvdcr09HS9NAxHEZIDxZIcSho0zFVeajUw8gvCQSAkXZZfrcCKjmEE49Mw6fLll1+ePXv29OnT5AoCPnPmjPLGyC+YWBUOluKUlBRtjtB2IG6GcYUiTO2HDx/+85//nJycTLl//37KpKQkXhr5yMGDBymJxdGjR5lnUbJ2TIG4GcYVivzud7/r16/fQw891LZt2/bt2z/sp0OHDr828pVOnTrdf//9PXr0mDNnDmKWjFmWA3

Also, the lead characters in each of the existing application's XML are always "iVBORw0KGgo" whereas mine never are.

Again, if you have an algorithm, so much the better.
 
Back
Top