All posts by bsdman

Currently working as an IT Manager. Worked for an OIT company as a Network Engineer in 2011. Worked for a Medical IT company as the Network Administrator 2009-2011. Worked as the Senior Systems Administrator at a computer reseller from 2005-2009. Worked as a Computer Consultant for several small companies from 2007-2009. Worked as a Computer Technician at a computer reseller from 2002-2004.

Set Static IP Remotely

Because I rule, I decided to be able to change people’s IP addresses remotely. This usually requires a Domain Administrator account (which I have/am). Here’s the code for my remote script:

intValue = InputBox("Please enter a computer name:")
intValue2 = InputBox("Please enter an IP address:")
strComputer = intValue
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetAdapters = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
strGateway = Array("10.1.3.1")
strIPAddress = Array(intValue2)
strSubnetMask = Array("255.255.255.0")
strGatewayMetric = Array(1)
For Each objNetAdapter in colNetAdapters
arrDNSServers = Array("10.1.1.124", "10.1.1.241")
objNetAdapter.SetDNSServerSearchOrder(arrDNSServers)
errGateways = objNetAdapter.SetGateways(strGateway, strGatewaymetric)
errEnable = objNetAdapter.EnableStatic(strIPAddress, strSubnetMask)
If errEnable = 0 Then
WScript.Echo "The IP address has been changed."
Else
WScript.Echo "The IP address could not be changed."
End If
Next

Basically this script asks for the current computername (or IP address) and then the future IP address. I hardcoded the netmask and the DNS server IPs (as well as the default gateway) already because those never change for my needs. Obviously you should change the above numbers to what you require.

But then, after installing a new version of windows, I realized I was getting errors. The exact error is VBScript runtime error: 800A0046 Permission Denied: ‘GetObject’. Somehow I was being denied the ability to impersonate the local administrator using my script. I thought maybe it was a “new system” issue, so I tried it on an older machine (from my machine though) and it still failed. That narrowed it down to an issue on my machine.

It all boils down to DCOM not being enabled on the computer. DCOM, if disabled, makes for a more secure system (I’m basing that on all the trojans and viruses written to overflow the DCOM stack and take over systems – as well as all the patches written specifically to fix DCOM errors). However, DCOM is required by impersonation scripts like the one above.

Fix:
Open Control panels
Open Administrative Tools
Open Component Services
Navigate to Console Root >> Component Services >> Computers
Right Click My Computer and select Properties
Click on the Default Properties Tab
Click on Enable Distributed COM on this computer

Some people will require a reboot, but my script works just fine after clicking OK.

[EDIT]

It has come to my attention that a lot of people would like to do this remotely. And by a “lot of people” I mainly mean me.
Here’s how:
Open up regedit (start >> run >> regedit)
Navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\OLE
You will see a REG_SZ key with the name EnableDCOM
Change the value of the key to Y for yes, or N for no. Then reboot the remote system.

Vista Shutdown Button

One of the biggest problems with Vista I found was the “shutdown button” would always put the computer into hibernate mode. Who would ever use hibernate mode anyway? I mean, come on, it’d be better to use sleep mode at that point. Jerks!

So anyway, here’s the quick fix:
Go into Power Options control panel
Under advanced settings find the “Power buttons and lid” option
Then look for “Start menu power button”
Now you’ll have different options to choose from. I personally picked Shut down.

Mapi32.dll Is Corrupt Or The Wrong Version

The error of “Cannot start Microsoft Office Outlook. Mapi32.dll is corrupt or the wrong version. This could have been caused by installing other messaging software. Please re-install office.” is a painful reminder that not all software pieces work well together. Quick fix:

1.) Close outlook
2.) Navigate to C:\Program Files\Common Files\System\MSMAPI\1033
3.) Rename MSMAPI32.DLL to MSMAPI32.DLL.OLD
4.) Reopen outlook – outlook should then “fix” this dll file

Daylight Savings Time Windows 2000

I know, I know… why would anyone still be using Windows 2000? You’d be surprised at that answer. At my place of business, all of our servers are Windows 2003 or Linux based with the exception of one key group: the Cisco Call Managers group.

DST changed a year or so ago, and all major operating systems were already patched by then. Unfortunately, Microsoft has labeled Windows 2000 under its EOL (end of life) software suite. Unless there’s a major security patch, all hot fixes are only for paying customers.

But Microsoft has a program called “TZEDIT.EXE” (found here) that allows you to manually edit the Time Zone configuration files.

1.) download the TZEDIT.EXE application
2.) Run the application, it will extract to C:\program files\tzedit
3.) Run the application in the \tzedit folder
4.) Click on your time zone and then hit the Edit button
5.) Starts 2nd Sunday of March @ 2 AM, Ends 1st Sunday of November @ 2 AM
6.) Now, double click on your time clock/calendar
7.) Select a different time zone and hit apply
8.) Select your edited time zone and hit apply
9.) All set!

Unmountable_boot_volume

Usually when you receive this error it means your HD is going bad. If your computer keeps rebooting and then asks to start in safe mode, that’s a good sign. Keep hitting the usual F8 button at startup to deselect the option of reboot on system failure. We don’t like that option anyway. Endless loops of reboots help no one.

If then on the giant blue screen of death you see this message:
“STOP 0x000000ED UNMOUNTABLE_BOOT_VOLUME”, then try this simple repair step before calling it a day.

1.) Put in your Windows XP CD
2.) Boot off your Windows XP CD (usually hit F12 to bring up the boot menu)
3.) When the Welcome to Setup screen appears, press the “R” key to start the recovery console
4.) If you’re prompted, enter the administrator password (on Home edition it’s usually blank)
5.) At the command prompt type “chkdsk /r” and press enter – this will find and repair most issues found
6.) After Checkdisk has finished running, you can type “exit” and hit enter to reboot the machine

Adobe Flash Crashes IE

I had a fellow employee at my work complain that every now and then his IE would crash. After several failed attempts to figure out when this was happening (and why), he finally told me it was an error with Flash. The error is as follows:
Flash Error

So I was looking around trying to figure out why this was happening. I know – the easiest way to find out how to stop it would be to have the fellow employee let me know what site he was at when it was happening. But I digress, here’s how I “fixed” it.

1.) Go to \windows\system32\macromed\flash\
2.) Duplicate flash9b.ocx (Copy/Paste)
3.) Rename the file flash9b.ocx to flash9b.ocx.old
4.) Rename the file Copy of flash9b.ocx to flash9b.ocx
5.) Duplicate flash9b.ocx (Copy/Paste)
6.) Rename flash.ocx to flash.ocx.old
7.) Rename the file Copy of flash9b.ocx to flash.ocx
8.) Duplicate flash9b.ocx (Copy/Paste)
9.) Rename the file Copy of flash9b.ocx to flash9.ocx

You will need to close out of all active IE windows to make the changes stick. You may also need to reboot just to be sure. This seems to only affect flash 9b.ocx files when the system also has ATI video drivers.

Eggdrop Bot Installation on Ubuntu

Since I’m being lazy this post is mostly for me. Here’s a good starting place:
Egghelp.org
After you’ve downloaded the tar.gz file, uploaded it to your server, and pretty much gone to ./configure, then come back here.

If you can go to ./configure and everything runs peachy, you’re a better system setup guy than I am. Otherwise Eggdrop requires TCL to be installed and compiled (you should get some sort of compiler error saying it can’t create executables if not installed).

apt-get install gcc
apt-get install tcl8.4
apt-get install tcl8.4-dev

That’s it. Go and run that ./configure again.

Unless you’re on Ubuntu 14.04…
./configure --with-tclinc=/usr/include/tcl8.6/tcl.h --with-tcllib=/usr/lib/x86_64-linux-gnu/libtcl8.6.so