Category Archives: Uncategorized

Generating a PKCS12 file with openSSL

  1. Generate the CSR
    1. openssl req -new -newkey rsa:2048 -nodes -keyout yourdomain.key -out yourdomain.csr
  2. Sign the CSR with your Certificate Authority
    1. Send the CSR (or text from the CSA) to VeriSign, GoDaddy, Digicert, internal CA, etc.
  3. Download the CRT
    1. Grab a copy of the signed certificate from your CA and place both the signed certificate and the CA chain certificate inside the same folder as your csr
  4. Create the PKCS#12 file (.pfx .p12)
    1. openssl pkcs12 -export -out nameofpkcsfilewearegoingtogenerate.pfx -inkey yourdomain.key -in publiccertfromCA.crt -certfile CAcertificatechain.crt
    2. Enter in a password that will be used to protect your PKCS file's private key

That's all that's to it!

Note: If you have multiple certificate authorities, you will have to create a certificate chain.  Use the following command for Step 4:

openssl.exe pkcs12 -export -in publiccertfromCA.crt -inkey yourdomain.key -name “MyCertYouCanChangeThisToWhateverItsAnAliasFriendlyName” -chain -CAfile certs.pem -passout pass:testpassword -out nameofpkcsfilewearegoingtogenerate.pfx

The certs.pem file will contain a list of your certificate authorities, starting from your intermediate authorities to the root authorities.

—–BEGIN CERTIFICATE—–
INTERMEDIATECERTIFICATEBASE64STUFFHERE.crt
—–END CERTIFICATE—–
—–BEGIN CERTIFICATE—–
ROOTCERTIFICATEBASE64STUFFHERE.crt
—–END CERTIFICATE—–

How do I use mySQL Workbench to backup a database?

  1. Open up mySQL Workbench
  2. Under "Server Administration", select an instance with the correct database privileges, otherwise create a New Server Instance with the correct privileges
    1. To create a new instance, click New Server Instance
    2. Select localhost if the mySQL service is installed on the local machine, otherwise select Remote Host
    3. Enter the username/password, click Next.
    4. Confirm your password and click OK
    5. Click Next on the Testing Database Connection step
    6. Click Next on the Set Windows configuration parameters for this machine step
    7. Click Next on the Testing Host Machine Settings step
    8. Click Continue if prompted for success on Reviewing your settings
    9. Type in a name to identify this instance... can be whatever; then click Finish
  3. Click on Data Export under DATA EXPORT / RESTORE
  4. Under the Object Select tab, select the backup method you would like to use "Export to Dump Project Folder" or "Export to Self-Contained File" and click the Start Export button.

How to remove print drivers in Windows 7

Inside of Windows 7, you will need to use the printui.exe utility. Before proceeding, I would recommend removing your printer from the Devices and Printers area to prevent issues from removing the driver itself.

  1. Open up a command prompt with Administrator privileges
  2. Execute: printui /s /t2
  3. Select the Drivers tab inside the Print Server Properties dialog box
  4. Select the print driver you would like to remove and click Remove...
  5. Check Remove driver and driver package.
  6. Click OK

You can now reinstall the printer successfully by using group policy (if you have you have a print server) or manually with the installation wizards.

How to export a VM from Amazon EC2 to VMware On-Premise

Here are the instructions on how to communicate with Amazon's API to export a VM from Amazon EC2 to a VMware image that gets put into S3 storage.  From that point, you can simply download the VMware image and import it into your VMware environment.

0. Open up a command prompt

1. Setup your java path (you can use JRE or JDK):
set JAVA_HOME="C:\Program Files\Java\jre6"

2. Verify your version with this command (you should see the java version number):
%JAVA_HOME%\bin\java -version

3. Add the bin directory that contains the java executable to your path before other versions of java
set PATH=%java_home%\bin;"%Path%"

4. Verify you can see the java version by executing the following command:
java -version

5. Set the EC2_HOME path
SET EC2_HOME=c:\ec2-api-tools-1.6.5.4

6. Verify the ec2_home using
dir %EC2_HOME%

7. Update the path
set PATH="%PATH%";%EC2_HOME%\bin

8. Setup access key environment variables
set AWS_ACCESS_KEY=XXXXXXXXXXXXXXXXXX
set AWS_SECRET_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

9. Verify the tools setup -- if setup correctly, we should be able to view our available regions.
ec2-describe-regions

10. Execute the following command:
ec2-create-instance-export-task i-EC2INSTANCENAME -e VMware -f VMDK -c ova -b S3STORAGEBUCKET

Once you have executed the command above, you can use the following commands to track/manage the cloning process.

  • Use ec2-describe-export-tasks to monitor the export progress
  • Use ec2-cancel-export-task to cancel an export task prior to completion

 

Notes: You could easily take steps 1-8 to setup an automated script to connect to amazon's services.  If you would like more information on these steps, here was a great article I ran across explaining everything in detail.

http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/SettingUp_CommandLine.html

 

How do I create a symbolic folder in windows?

1. Open up a command prompt (Start->cmd)
2. Navigate to the directory where you want your folder.
3. Execute the following command: mklink /D foldertoredirect C:\path\to\another\directory

That's all that is to it!

Note: This works for creating FTP directories that need to redirect to another.

Preventing Drive Letters From Changing During SysPrep

One thing that I found really annoying when doing a sysprep was my drive letters changing. In some environments, drive letters need to remain constant when the machine is being deployed/cloned. Unfortunately, I don't have too awful much experience with sysprep's new unattended.xml file and there doesn't seem to be any clear cut tutorials on how to do this, so I found a nice workaround.

To prevent the drive letters from chaning, use the following steps.
1. Open up the registry (Start->Run->regedit)
2. Navigate to HKEY_LOCAL_MACHINE\System\MountedDrives
3. Make a backup of this. File->Export (save to a place where you can access it soon).
4. Make sure you leave regedit open and run sysprep via command line. Use the /quit switch when running sysprep as we do not want to restart the machine yet.
5. Once sysprep finishes, go back to the registry editor.
6. Import your registry backup. File->Import
7. Restart/Shutdown the machine and deploy

Credit to this answer goes to jthiessn for finding this trick. Make sure to "up" his answer on the Microsoft forum for his fine work 🙂 http://social.technet.microsoft.com/forums/en-US/itprovistadeployment/thread/694daccd-a48d-4529-9aaa-555cda297038

Upgrading SolarWinds 10.3 to 10.4 With NetFlow 3.9 to 3.10

Earlier this week I decided to update NetFlow and came across some weird stuff. I updated NetFlow first, all went all. Updated NPM to 10.4 and all heck broke loose. The following messaged started to popup when going to the Netflow tab of SolarWinds:
"Error: NetFlowService inaccessible. Verify that service is 'Started'. » More Information"

I had tried restarting the SolarWinds Netflow service, rebooting the whole machine, running the repair option of Netflow via the installer, and creating a whole new database; neither of which prevailed.

Finally I opened up a ticket with SolarWinds and it turned out to be database connectivity issues. After troubleshooting with a tech for a few hours, eventually I had this escalated to the dev. team. Turns out that the database configuration file has issues reading "s and they have you replace the passwords with 's.

So the fix:

  1. Open c:\Program Files (x86)\SolarWinds\Orion
  2. Edit the SWNetPerfMon.db file using Notepad
  3. Replace all double quotes (") with single quotes (') around your passwords.
  4. Restart all Solarwinds services using the Orion Service Manager.

Wait a few minutes and you should now start to see the fancy NetFlow charts in SolarWinds 🙂

DNS name does not exist. - Windows Activiation

Issue:
When activating Windows (in this case Server 2008 R2), you receive the following dialog box:
"Code: 0x8007232B Description: DNS name does not exist."

Solution:

If you receive this error, you are more than likely using an ISO from the Microsoft Volume Licensing Center when in reality you want to just use your license key (the OS is looking for your KMS server (Key management services), and if you don't have one, then you receive this DNS failure).

How to:

  1. Click Start, click All Programs, click Accessories, and then right-click Command Prompt.
    1. Click Run as administrator.
  2. Execute the following command (where the X's are your license key :)):
    1. slmgr -ipk xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
  3. You should get a popup saying the key has successfully been installed after you execute the command (there is a delay).  Once you see that, go ahead and activate windows as you normally would.
    1. Start->right click properties on My Computer->Activate...

VMware View Composer Installation Error - Unknown Software Exception

When installing VMware View Composer, I was receiving the following error:
"Application Error, The exception unknown software exception (0x0000409) Occurred"

Turns out this was an issue with installation privileges. Rather than installing the software as a domain administrator, I simply logged into the local Administrator account on the machine and installed it.