Created
November 6, 2014 10:48
-
-
Save jrgcubano/3d2966a92d59b0eabc97 to your computer and use it in GitHub Desktop.
Create and delete cert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create Cert : (bat) | |
------------------------------------ | |
echo off | |
set SERVER_NAME=localhost | |
echo --------------------------------------------------------------------- | |
echo cleaning up the certificates from previous run | |
certmgr.exe -del -r CurrentUser -s TrustedPeople -c -n %SERVER_NAME% | |
certmgr.exe -del -r LocalMachine -s My -c -n %SERVER_NAME% | |
echo --------------------------------------------------------------------- | |
echo Server cert setup starting | |
echo for server: %SERVER_NAME% | |
echo making server cert | |
makecert.exe -sr LocalMachine -ss MY -a sha1 -n CN=%SERVER_NAME% -sky exchange -pe | |
echo copying server cert to client's CurrentUser store | |
certmgr.exe -add -r LocalMachine -s My -c -n %SERVER_NAME% -r CurrentUser -s TrustedPeople | |
echo --------------------------------------------------------------------- | |
Delete Cert | |
------------------ | |
echo off | |
set SERVER_NAME=localhost | |
echo --------------------------------------------------------------------- | |
echo cleaning up the certificates from previous run | |
certmgr.exe -del -r CurrentUser -s TrustedPeople -c -n %SERVER_NAME% | |
certmgr.exe -del -r LocalMachine -s My -c -n %SERVER_NAME% | |
echo cleanup completed | |
echo --------------------------------------------------------------------- | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment