PKI – Autogenerate INF

email me

When submitting a cert request to a certificate authority, to automate this process, you’re going to need an INF. This is how you create that file

echo [NewRequest] > SCCM_WORKGROUP.INF
echo Subject=”CN=%computername%” >> SCCM_WORKGROUP.INF
echo Exportable=TRUE >> SCCM_WORKGROUP.INF
echo KeyLength=1024 >> SCCM_WORKGROUP.INF
echo KeySpec=1 >> SCCM_WORKGROUP.INF
echo KeyUsage=0xA0 >> SCCM_WORKGROUP.INF
echo ProviderName=”Microsoft RSA SChannel Cryptographic Provider” >> SCCM_WORKGROUP.INF
echo ProviderType=12 >> SCCM_WORKGROUP.INF
echo RequestType=PKCS10 >> SCCM_WORKGROUP.INF
echo MachineKeySet=TRUE >> SCCM_WORKGROUP.INF
echo [RequestAttributes] >> SCCM_WORKGROUP.INF
echo SAN=%computername% >> SCCM_WORKGROUP.INF

IDEA You can use PowerShell or another scripting language to create the INF. Just make sure the CN=EnvironmentalVariable for the computer name and SAN.

Notes

Batch – Return Serial Number of Certificate.cer File