Dec 29

BackupRouters-TelnetToLocal.pl

 

Dec 29

Perl Show Current Script Name

If you ever needed to show the currently running Perl script name, here are the examples you need.  I personally like using the following to name log files based on the script name by replacing the extension:

 

Dec 28

Recover Private Key for SSL Certificates in IIS

Problem:

Your SSL Certificate is installed but missing the private key. At the time of this writing, this applies to:

  • IIS5
  • IIS6
  • IIS7

Causes:

There can be multiple causes from deleting the original SSL certificate to your server crashing and not having a backup of the private key.

Resolution:

  1.  Log on to the computer that issued the certificate request by using an account that has administrative permissions.
  2. Click Start, click Run, type mmc, and then click OK.
  3. On the File menu, click Add/Remove Snap-in.
  4. In the Add/Remove Snap-in dialog box, click Add.
  5. Click Certificates, and then click Add.
  6. In the Certificates snap-in dialog box, click Computer account, and then click Next.
  7. In the Select Computer dialog box, click Local computer: (the computer this console is running on), and then click Finish.
  8. Click Close, and then click OK.
  9. In the Certificates snap-in, expand Certificates, right-click the Personal folder, point to All Tasks, and then click Import.
  10. On the Welcome to the Certificate Import Wizard page, click Next.
  11. On the File to Import page, click Browse.
  12. In the Open dialog box, click the new certificate, click Open, and then click Next.
  13. On the Certificate Store page, click Place all certificates in the following store, and then click Browse.
  14. In the Select Certificate Store dialog box, click Personal, click OK, click Next, and then click Finish.
  15. In the Certificates snap-in, double-click the imported certificate that is in the Personal folder.
  16. In the Certificate dialog box, click the Details tab.
  17. Click Serial Number in the Field column of the Details tab, highlight the serial number, and then write down the serial number.
  18. Click Start, click Run, type cmd, and then click OK.
  19. At the command prompt, type the following:
    1. certutil -repairstore my “SerialNumber”
    2. NOTE: SerialNumber is the serial number that you wrote down in step 17.
  20. In the Certificates snap-in, right-click Certificates, and then click Refresh.

 

The certificate now has an associated private key, and you can assign to a website in IIS.  When completed, you should see the private key on the certificate as below:

SSL Certificate with a Private Key

Dec 21

ListRunningScripts.vbs

 

Dec 08

IDK.vbs

 

Dec 07

Cannot Connect to Windows 7 SMB Shares from XP/2003

If you’ve ever tried connecting to a Windows 7 SMB share from a Windows XP or 2003 computer, you may notice you cannot connect to the server. Being the savvy person you are, you:

  1. Check the share and NTFS permissions on the Windows 7 Share
  2. Run gpresult on your XP/2003 machine and confirm you are a member of the correct groups
  3. Try connecting through start->Search and enter \\windows7 and get an error
    1. What! You cannot even see the server and it’s shares???
  4. You check the Windows 7 firewall and ensure file/print sharing is allowed
    1. It’s even enabled on the connected network (domain/home/public)
    2. Your IP subnet is even allowed
  5. You break out the command line and run net use z: \\windows7\share but get a System Error 58

WHAT GIVES!!!

The problem is Windows 7 uses NTLMv2 and XP/2003 use LM & NTLM.  To resolve this issue, do the following on the Windows 7 computer:

  1. Run GPedit.msc
  2. Expand Computer Configuration->Windows Settings->Security Settings->Local Policies->Security Options
  3. Open the properties for Network security: LAN Manager authentication level
    1. Set the value to: Send LM & NTLM – use NTLMv2 session if negotiated
  4. Run Services.msc
    1. Restart the Server service

You can now map your drive from your XP/2003 box to your Windows 7 computer!