Exporting a user certificate as NSData blob in Windows, for .mobileconfig
It is the format the Apple "documentation" states are the syntax for the Exchange Payload IdentityData.
I'm trying to completely automate the creation of .mobileconfig configuration profiles.
I got it all down, except adding the user certificate to the Exchange ActiveSync payload. I simple don't know how to get a usercertificate, either from my CurrentUser My (Personal) store, or from a PFX.
I'm not using iPCU Scripting but PowerShell, basically because it doesn't really work (from what I've tried, I'll explain later) and because I don't know C#.
I've generated a base .mobileconfig, in which I have replaced all the parts that needs to be changed or needs to be unique, with @KeyWords@ that can easily be searched and replaced. Simple stuff.
That mobileconfig I currently have to open in iPCU and manually add the usercertificate from my personal store and then export the profile. Annoying stuff.
You can view my PowerShell code here:
http://pastebin.com/a7hGCix6
The reason I don't use iPCU are:
The automation part should be run on a server. I don't want iPCU installed on my servers.
From trying with iPCU (on a client) I've found that it doesn't really work, at least not to fully automate the process.
I don't know C#, except that I can read the code and more or less figure out what it does and do some minor changes. Using the example provided by Apple and a bit of information gleaned on these forums, I made this:
http://pastebin.com/fkZMncyB
However, it ofcourse requires iPCU, which I don't want installed on my Terminal Server, and as I've noted in the comments of the C# samle, it doesn't work. Fails at exporting, as noted in the comments.
n/a, Other OS, n/a