Good bye Escalation Engineer, Hello Developer Evangelist

Hello all,   I recently changed to another department within Microsoft. I am not an Escalation Engineer working with Windows SDK in general and Crypto in particular anymore. No. Now I am a Developer Evangelist fully dedicated to Windows 8 and Windows Phone development in Spain. So what does this mean to this blog? Well, I…

2

.NET and the XAdES standard

Hi all,   You may know already that SignedXml class in .NET doesn’t support the XML Advanced Electronic Signatures (XAdES) standard (more info here: Which standards does SignedXml support?) Fortunatelly my colleagues in Microsoft France developed a XAdES library for .NET (Microsoft.Xades.dll) that they published on this French site: Kit de démarrage « Signature avancée (XAdES) pour Microsoft .NET…

28

How to remove a certificate from a certificate store programmatically (PowerShell)

Hi all, The following sample will remove a certificate from MY certificate store of the local machine after locating it by serial number: # Pass Serial Number of the cert you want to remove param ($serialNumber = $(throw “Please pass a certificate’s serial number to the script”)) # Access MY store of Local Machine profile…

2

How to get all certificates in the Server Certificates section of IIS Manager programmatically (PowerShell)

Hi all, The certificates in the Server Certificates section of IIS Manager (inetmgr.exe) are certificates located in MY certificate store of the local machine, and their Enhanced Key Usage is Server Authentication. The following sample gets those certs: # Get all certs in MY store of Local Machine profile $store = New-Object System.Security.Cryptography.X509Certificates.X509Store(“My”,”LocalMachine”) $store.Open(“ReadOnly”) $store.Certificates…

3

How to install the response from a CA programmatically (PowerShell)

Hi all,   The other day a customer of mine was creating a SSL certificate request with IIS Manager (inetmgr.exe) with “Create Certificate Request…” action in the Server Certificates section. He was sending that request to a Certificate Authority, and he wanted to programmatically install the .cer file with the response from the CA the…

1

How to export issued certificates from a CA programatically (PowerShell)

Hi all,   The following sample is a conversion of How to export issued certificates from a CA programatically (C#) sample to PowerShell. It will get all the issued certs in the CA database and copy them to a folder:   #Params $strServer = “myserver”; $strCAName = “myserver-CA”; $strPathForCerts = “c:\test\”; # Constants $CV_OUT_BASE64HEADER = 0;…

4

How to export issued certificates from a CA programatically (C#)

Hi all,   The following sample is a simplification of How to get info from client certificates issued by a CA (C#), and gets all the issued certs in the CA database and copies them to a folder:   using System; using System.Windows.Forms; using System.IO; using CERTADMINLib; … // Parameters string strServer = “myserver”; string…

1

How to get info from client certificates issued by a CA (C#, VS 2010)

Hi all,   I developed this sample some time ago: How to get info from client certificates issued by a CA (C#). The other day I tried it on a new machine with Windows 7, Visual Studio 2010 and .NET Framework 4.0, and it didn’t even compile. I had to do the following to make…

3

Why is my process in a Job if I didn’t put it there?

Hi all, The other day a customer of mine was having this issue on Windows 7: CreateProcessAsUser fails with error 5 (Access Denied) when using Jobs. So he had a Windows service running as System in Session 0, that service created a process running as System in Session 0 too, and this process tried to…

1

CreateProcessAsUser fails with error 5 (Access Denied) when using Jobs

Hi all, The other day I worked on a support case where a Windows service running as System in Session 0 was creating a process also running as System in Session 0, and this new process failed to create another process in the logged-on user’s session (Session 2 in this particular case). And it failed because…

2