VBScript code: View CPU usage for a process name

So you need a VB script to check for a process or set of processes CPU usage? Let’s say I want to see all “svchost.exe” process PID’s and the amount of CPU each process is using? see in line 6 and 7 the name of the process your looking for? Just edit the name of the process and run the script. It will print out the PID and the CPU

So you need a VB script to check for a process or set of processes CPU usage? Let’s say I want to see all “svchost.exe” process PID’s and the amount of CPU each process is using? see in line 6 and 7 the name of the process your looking for? Just edit the name of the process and run the script. It will print out the PID and the CPU usage for each process it finds that matches the Process Name provided.

Then I would copy the code below to a .vbs file and run it in a the CLI.


DIM MyPID(20), objProcess, objItems, objitem
DIM XX, I
XX = -1
set objService = getobject("winmgmts:")
for each Process in objService.InstancesOf("Win32_process")
if Process.Name = "svchost.exe" Then XX = XX + 1
if Process.Name = "svchost.exe" Then MyPID(XX) = Process.processid
Next
For I = 0 To 20
Set objProcess = GetObject("winmgmts:{impersonationLevel=impersonate}//localhost")
Set objItems = objProcess.ExecQuery("Select PercentProcessorTime from Win32_PerfFormattedData_PerfProc_Process where IDProcess=" &MyPID(I)& "")
for each objItem in objItems
Wscript.Echo MyPID(I) & " = " & objItem.PercentProcessorTime

Next
Next

There was a problem starting oobefldr.dll The specified module could not be found

After installing Windows 2008 R2 and then running the updates you start getting “There was a problem starting oobefldr.dll The specified module could not be found” being displayed as a error pop up when logging in to the desktop?

Just remove…
/HKCU/Software/Microsoft/Windows/Currentversion/Run/WindowsWelcomeCenter
Log off and back on and and messages are now gone!

Enjoy

After installing Windows 2008 R2 and then running the updates you start getting “There was a problem starting oobefldr.dll The specified module could not be found” being displayed as a error pop up when logging in to the desktop?

Just remove…

/HKCU/Software/Microsoft/Windows/Currentversion/Run/WindowsWelcomeCenter

Log off and back on and and messages are now gone!

Enjoy

Error during the configuration of the host: Failed to update disk partition information

VMware ESX 4 -> Failed to update disk partition information.

After creating a new LUN on a Dell MD3000i, I wanted to add the new iSCSI LUN to my ESXi server. Everything went fine, the LUN was presented and the Add storage wizard has found the new LUN. But when i wanted to complete the wizard, the following error came up:

VMware ESX 4 -> Failed to update disk partition information.

After creating a new LUN on a Dell MD3000i, I wanted to add the new iSCSI LUN to my ESXi server. Everything went fine, the LUN was presented and the Add storage wizard has found the new LUN. But when i wanted to complete the wizard, the following error came up:

Now if you go on the Internet a search around you will find several references to this issue. Most if not all of them tell you to:

1. Use fdisk on the /dev/sd[a-z]* device. Create a partition with type 0xfb.
2. Format the VMFS datastore using
vmkfstools -C vmfs3 vmhbaI:T:L:P
In this example, I corresponds to the initiator of the VMware host bus adapter, T corresponds to the target number of the disk, L is the LUN number, and P is the partition number of the newly created partition.

3. Reboot ESX server

This is not always required, It may be just a hickup in your ISCSI registration on the ESX servers. Here is how I fixed mine and it worked with out any reboots or major adjustments.

Steps to take first before following the CLI instructions:

  1. Go create another 5Gb LUN on Power Vault.
  2. Set the access group assigned to new LUN to allow ESX servers
  3. On ESX Host GUI go back to configuration menu and select Storage Adapters menu
  4. Select your ISCSI Software Adapter from Storage Adapter list and select “Rescan” (even if you see your LUN)
  5. Go back to the Storage menu and select add storage, select Disk/LUN and follow through the menus to mount and format the 5gb LUN and it should go through now.
  6. Remove the 5gb LUN from the ESX Storage menu.
  7. Remove the 5gb LUN from Dell Vault.
  8. Go back to your ESX and rescan HBAs and make sure the 5gb LUN is gone and you see your original LUN you want to mount.
  9. Go back to the Storage menu and select add storage, select Disk/LUN and follow through the menus to mount and format the  LUN and it should go through now.

If this does not work then change the access to the LUN on the vault to a new access group. Rescan for LUN on ESX then go reset the LUN back to the original access group you want to use and then rescan again from ESX.  Try to remount LUN and format. This should now connect and no errors should appear. If you still are getting errors then you may have other issues and you can now try the CLI method or call in support.

Good Luck, I hope  this helps a few of you out there from dealing with production systems and not wanting to spend all day VMotioning, reboots and such.

Enjoy

HP LaserJet 1020-1022 Print Spooler dies repeatedly

 Do you have a HP LaserJet 10-1022 printers and everytime someone prints a PDF file it kills the print spooler?

 The SDhp1020.dll was build by 2 different companies, Zenographics Inc, and by Marvell Semiconductor. The Marvell version of the drivers crash when printing some PDF  files. Of course the Marvell version is also the current / latest version so your likely to get this driver if you download from HP web site.

So

 Do you have a HP LaserJet 10-1022 printers and everytime someone prints a PDF file it kills the print spooler?

Based on research from sources including GameAddict, The SDhp1020.dll was build by 2 different companies, Zenographics Inc, and by Marvell Semiconductor. The Marvell version of the drivers crash when printing some PDF  files. Of course the Marvell version is also the current / latest version so your likely to get this driver if you download from HP web site.

So here is how to fix the HP LJ 1020 Spooler susbsystem error.

Download the HP Driver files here ->  HP-LJ1020-fix

Extract the files then the files need to be copied into: C:\windows\system32\spool\drivers\w32×86\3

Zip includes:

  • SDhp1020.DLL ->  as part of the original driver package
  • SDDM32.DLL -> Zenographics Inc  (original)
  • ZTAG32.DLL ->  Zenographics Inc  (original)
  • ZGDI32.DLL ->  Zenographics Inc  (original)

The zip also has the rest of the HP driver package in it. You do not need to copy the entire driver folder, just SDhp1020.DLL. But if you want the entire package it is supplied  as well.

#Foot Note  added (2/1/2012)#

I had one of my techs use these instructions and he could not understand why it still failed afterwards. The reason was clear that the system he placed DLL on was a 64 bit Windows 7 box. You will need to place DLL  into: C:\windows\system32\spool\drivers\x64\3 overwriting the DLL that is already there. The key here is your replacing a DLL version so if you do not overwrite a DLL then your not in the right place.

 

Enjoy

Outlook Express “Compact Messages” pop-up

I have a user who every time they log in they get a pop up notice that Outlook Express needs to be compacted. They don’t use Outlook Express so why would it need to be compacted?

The short answer is that it does not. There is a issues with Windows Search indexing.

So here is the fix!

If you’re using Windows Search, right click the System Tray

I have a user who every time they log in they get a pop up notice that Outlook Express needs to be compacted. They don’t use Outlook Express so why would it need to be compacted?

The short answer is that it does not. There is a issues with Windows Search indexing.

So here is the fix!

If you’re using Windows Search, right click the System Tray icon, select Windows Search Options.  When the Indexing Options dialog box appears, click the Modify button at the bottom.  Find Microsoft Outlook Express in the list, clear the check box, click OK.  Microsoft Outlook Express should no longer appear in the “Index these locations:” list.  Close the dialog box.

After changing Windows Search Options, you may still have to reset the OE count.

Edit the registry manually to reset the counter manually:

1. Close Outlook Express and all message windows.
2. Click Start, click Run and type without quotes “regedit”.
3. Navigate to this key

HKEY_CURRENT_USER\Identities\{GUID}\Software\Microsoft\Outlook Express\5.0

where GUID is the long number used for your Identity.
4. In the right-hand pane, double-click “Compact Check Count”, then change the value to zero.
5. Close regedit and restart your computer.

Enjoy!!

Mac OSX Leopard Guest Setup under VirtualBox

MAC on Windows

How to install and run a MAC on a windows or Linux systems virtually has been made easy with the tools and instructions available for download. 

Download EmpireEFI and Full Pdf Manual here –>  MAC-Leopard_Vbox-VM

With just a little effort you can run MAC OSX 10 Snow Leopard on your windows system or linux system. You can buy OSX at BestBuy for about $30 and get for free

MAC on Windows

How to install and run a MAC on a windows or Linux systems virtually has been made easy with the tools and instructions available for download. 

Download EmpireEFI and Full Pdf Manual here –>  MAC-Leopard_Vbox-VM

With just a little effort you can run MAC OSX 10 Snow Leopard on your windows system or linux system. You can buy OSX at BestBuy for about $30 and get for free Vbox from the Web here at http://www.virtualbox.org/  . Then download the zip package above which includes the EmpireEFI ISO and the complete instructions on how to install into a VM using Vbox.

FYI

Intel hardware works better than AMD

Enjoy

APC NetBotz 200 Cacti Temp and Humidity Graphs

How to Graph the APC NetBotz 200 Environment Monitor

Get the data templates ->  cacti-apc-netbotz200-data-templates

Cacti Temp and Humidity Graphs for the APC NETBOTZ 200 is different from the NETBotz 400 and 600 models.

The APC Netbotz200 has 8 sensor inputs on the device so each input has a OID associatedwith it. What I did was scan the MIBs available and found where the Temp and Humidity

How to Graph the APC NetBotz 200 Environment Monitor

Get the data templates ->  cacti-apc-netbotz200-data-templates

Cacti Temp and Humidity Graphs for the APC NETBOTZ 200 is different from the NETBotz 400 and 600 models.

The APC Netbotz200 has 8 sensor inputs on the device so each input has a OID associatedwith it. What I did was scan the MIBs available and found where the Temp and Humidity values were stored. They are not stored in the same OID as the NetBotz 400 and 600 models.

To scan your Netbotz 200:

Sensor #1
(name)
snmpwalk -v1 -c public [IP address of Netbotz] 1.3.6.1.4.1.318.1.1.10.4.2.3.1.3.0.1  
(temp)
snmpwalk -v1 -c public [IP address of Netbotz] 1.3.6.1.4.1.318.1.1.10.4.2.3.1.5.0.1
(humidity)
snmpwalk -v1 -c public [IP address of Netbotz] 1.3.6.1.4.1.318.1.1.10.4.2.3.1.6.0.1

Sensor #8 (name)
snmpwalk -v1 -c public [IP Address of Netbotzs] 1.3.6.1.4.1.318.1.1.10.4.2.3.1.3.0.14
(temp)
snmpwalk -v1 -c public [IP address of Netbotz] 1.3.6.1.4.1.318.1.1.10.4.2.3.1.5.0.14
(humidity)
snmpwalk -v1 -c public [IP address of Netbotz] 1.3.6.1.4.1.318.1.1.10.4.2.3.1.6.0.14

The last period in the OID starts at 1 and goes to 14. Each one in succession is another sensor on the Netbotz 200. Using snmpwalk to walk the OID’s will show you what is labeled. Walk this OID to see all sensor names (1.3.6.1.4.1.318.1.1.10.4.2.3.1).

In Cacti add a host with the correct IP and SNMP community (Version 1) then apply the templates provided above to pickup sensor #1 If you need more sensors then duplicate the templates and update the OID in them for the next sensor OID #.

Your graphs should look like..

Party on!!

Florida Beach Shark Buddy

This video was shot in Melbourne Beach Florida and the man in this video is Charlie “The Bisket” McDuffie, a life time local of Brevard County. He is the sharkyest, scruffy beach rodder on the East Coast and known well by many at any bait shop or watering hole Melbourne has to offer. Here he debates whether to keep his new found 7 foot shark or push him back in

This video was shot in Melbourne Beach Florida and the man in this video is Charlie “The Bisket” McDuffie, a life time local of Brevard County. He is the sharkyest, scruffy beach rodder on the East Coast and known well by many at any bait shop or watering hole Melbourne has to offer. Here he debates whether to keep his new found 7 foot shark or push him back in to the surf for another day. It’s worse to regret then to let go.

Charlie has hunted sharks up and down the East Coast of Florida for nearly 40 years. Since a small child he has spent time each spring hunting sharks. Today’s video is Charlie letting his little buddy go.. But wait! Wait! I didn’t get my $20 bucks worth of leader, swivels and hook..  The last thing old Bisket does if you watch for it as in true Florida  Cracker style he fires his nose canon.

Florida Beach Shark Buddy – The Full unedited MPEG

As the video nears the end you see a large bolt of lighting strike just off to the south and it starts to rain.

All is well that ends well!

Your other buddy Cubert..

Keep the big ones coming!

The ordinal 3719 could not be located in the dynamic link library LIBEAY32.dll

JailBreaking Iphone 3.1.3 on Windows XP

If your using the new Spirit.exe on windows you may get a error or 2. Not a big issue at all. Here is how to fix the 2 most common errors

You may get the error code displayed by Spirit  “error code: c0000138″

To solve the problem, copy the file c:\Program Files\Common Files\Apple\Mobile Device Support\bin\libeay32.dl

 to c:\Windows\System32\

Then run

JailBreaking Iphone 3.1.3 on Windows XP

If your using the new Spirit.exe on windows you may get a error or 2. Not a big issue at all. Here is how to fix the 2 most common errors

You may get the error code displayed by Spirit  “error code: c0000138″

To solve the problem, copy the file c:\Program Files\Common Files\Apple\Mobile Device Support\bin\libeay32.dl

 to c:\Windows\System32\

Then run Spirit.exe again

To get Spirit.exe for Windows to jailbreak your Iphone, Ipod, or Ipad

goto SpiritJB.com 
Make sure your iPhone is on, in normal mode, and connected to the computer via your USB cable. Open Spirit – it will see your device and show it’s ready.

Select JailBreak

WINDOWS  7 FOLKS: If you’re getting error code c0000005, apparently setting compatibility mode to Windows 98 allows Spirit to work.
Your iPhone will show a “Restore Complete” screen (don’t worry, it’s not deleting any of your info/content), and Spirit will show Jailbreak Complete.

 

Allow it to reboot and run through its installer, once complete you will see your slider bar and you can access your phone. I suggest you look for and run the Cydia and install any updates with your WiFi turned on.

Spirit

Cleaning Up the Exchange 2003 Server’s SMTP Queues after NDR attacks

Warning: This process will delete all email that is due to go to external recipients. Internal messages are not affected, neither are new inbound messages from the Internet unless they are from the spammer continuing to try and abuse your server.

Capturing the Messages Into a Single Queue

This process requires an SMTP connector for all addresses. If you don’t already have one (with a * on the

Warning: This process will delete all email that is due to go to external recipients. Internal messages are not affected, neither are new inbound messages from the Internet unless they are from the spammer continuing to try and abuse your server.

Capturing the Messages Into a Single Queue

This process requires an SMTP connector for all addresses. If you don’t already have one (with a * on the namespace tab) then you need to create one using the instructions below. 
If you already have an SMTP Connector with a * on the namespace tab, then you can use it for this process. You will need to adjust the settings as appropriate. You may wish to just make a note of the settings, delete the connector and create a new one for this process. When complete recreate your live connector.

  1. In ESM, Connectors.
  2. Find default SMTP connector, select properties and then select “Address Space” Edit the SMTP entry and make it a cost of 2.
  3. Right click on connectors and choose New, SMTP Connector.
  4. On the “General Tab” type a name for the connector. “Spam Cleanup” or similar.
  5. Click the “Add” button under “Local Bridgeheads” and choose your Exchange server.
  6. Click on the “Address Space” tab.
  7. Click “Add” and choose SMTP. Leave each setting (* and cost of 1) and press ok.
    If all the spam is to one domain, then you could remove the * and enter the domain that the messages are being sent to. This should leave legitimate messages in the queue.
  8. Click on the General tab again. Change the option in the centre from DNS to “Forward all mail through this connector to the following smart hosts”.
  9. Enter an invalid IP address in square brackets:  [99.99.99.99].
  10. Click on the “Delivery Options” tab and ensure that “Specify when messages are sent through this connector” is selected.
  11. Change the option to 11pm. (If it is close to 11pm when you are doing this, use a much earlier time – 6am or similar. The time doesn’t matter as long as it is not close).
  12. Press Apply/OK to close the SMTP Connector dialogue.
  13. Restart SMTP Virtual Server.
    1. Expand Servers, <your server>, Protocols, SMTP.
    2. Right click on the “Default SMTP Virtual Server”
    3. Choose “Stop”. This may take a few minutes.
    4. Once it has stopped, right click again and choose “Start”.

The Exchange SMTP virtual server is now processing all the messages and placing them in to a single queue for your SMTP connector. This can take some time. You may want to wait until the number of messages in the queue stays constant before attempting the next stage.

Exchange 2000: The queues can be found in Servers, <your server>, Protocols, SMTP.

Exchange 2003: The queues can be found in Servers, <your server>, Queues.

Deleting the Messages

Now that the messages are in one queue, it is quite easy to delete them

Exchange 2003

  1. Right click on this connector and choose “Find Messages”.
  2. In the drop down box select the number of messages to be listed in the search.
  3. Click “Find Now”.
  4. Once the search is complete, select all of the messages (use the shift-page down key combination)
  5. Then click “Delete all Messages (No NDR).

Exchange 2000

  1. Right click on this connector and choose “Delete All Message (No NDR)”
  2. Select Yes when asked if you want to delete all the messages in the queue.

Once the messages have been deleted, which could take some time, refresh the queues to ensure that they don’t continue to build. If they do then Exchange is still processing the messages. You will need to repeat the procedure to delete more messages until the queues are completely clear and stay at zero.

Once you have flushed out the messages, undo the changes that you have made.

If it was a new SMTP connector, delete it.
If you adjusted an existing connector, put the settings back how they were. Don’t forget the time on the “Delivery Options” tab. it should be “Always Run”.

Finally restart SMTP virtual server to get Exchange to start using the new settings.