Loading

Subscribe via RSS

Subscribe by Email

Your email:

Do You Tweet Tech?

Are your tweets technology related? If so then we want to follow!
 

Admin Arsenal Blog

Current Articles | RSS Feed RSS Feed

Know Thy Exit Code

  | Share on Twitter Twitter | Share on Facebook Facebook | Submit to Digg digg it |  Add to delicious  delicious |  Submit to StumbleUpon StumbleUpon | Submit to Reddit reddit 

I was deploying some custom software today and discovered that even though the application was encountering errors and failing, it was not sending a non-zero exit code. It was just ending with zero. This can be a real pain when deploying software. Sometimes (and by sometimes I mean always) you need to know if the software was successfully deployed.

I explained to the developer what I was looking for and I realized that I shouldn't just ask for a non-zero code. (Zero is the default code for saying that 'the [program|function|script] completed successfully'.) So I decided to do a little homework.

Here are some standard exit codes that are useful for troubleshooting, or in my case, alerting the developer of which exit code would be appropriate.

The error that we needed wasn't specifically provided, but codes 50 or 1003 were pretty good. When all else fails you can send a code 1. The important thing is to know what to do when the error code is received.

One of the most frustrating errors is 1603. It's kind of a generic fail-safe error that pretty much tells you that you're hosed, but doesn't give much to go on. (It's actual definition is "Fatal error during installation.") As a general rule I suggest to developers that they shy away from this error if there is any other error more appropriate. Using 1603 just incites rage. Google it and you'll see a ton of hits, many of which are still unanswered. They range from everything imaginable.

When you call for support from an application vendor one of the first things they'll ask you (right before they blame it on the hardware manufacturer, platform manufacturer, or the HVAC guy) is what your exit code is. So it's a good idea to know it. You'll usually find it in a log file (generated by the installation), or an event log. Sometimes a dialog will pop-up during the installation with the exit code.

As I started to investigate exit codes, I found myself thinking about Adam's post on the Five Commandments of Remote Software Deployment. A good post. I recommend it.

Oh yeah, since everyone seems to have their own flavor that they prefer, return codes and error codes are synonymous with exit codes.

So go forth and know thy [exit|error|return] code.


You've got it (and they want it)

  | Share on Twitter Twitter | Share on Facebook Facebook | Submit to Digg digg it |  Add to delicious  delicious |  Submit to StumbleUpon StumbleUpon | Submit to Reddit reddit 

At some point nearly everyone in your organization will want it.

And they'll want it from you.

And they'll want it from you for one reason; they'll think that you have it.

The common thread that connects you to your manager, CFO, HR manager, facilities person, and coffee breath guy is data. Truth be told, data is the biggest reason that you have a job right now. After all, IT is nothing more than agateway to data.

So when they come asking, be sure to get two answers from them:

  1. Why do they want it?
  2. What will they be doing with it?

Your reasons for needing the answers have nothing to do with being a power-hungry Admin (there are other reasons for that). You need to know because each department has their own definition of data, as well as their own reason for needing it.

You have data in a ton of different locations. Databases, registries, flat files, bios', etc. Depending on what the answers are will tell you which place is the best location to retrieve the data.

Your manager wants to know how many memory dimms the company has. You provide the answer from your blazing fast database and she reports the numbers on up and everyone is fat, dumb, and happy. Unbeknownst to your boss is the fact that your data only includes the memory currently in use on the network. You've left out the older (but yet to be decommissioned) computers currently serving a role as door stops, or the 512MB dimms recently replaced by 2GB dimms in preparation for Vista. Oh, and there are the new laptops that came in last week but haven't yet been placed on the network...

Suddenly the data that your boss has is incomplete. But the problem wasn't the data. Your data was perfect. You were right. The problem was the scope of the data. This is why you need to know why they need what they say that they need.

OK, so your manager has lower than expected numbers to report to accounting. That's an inconvenience, but it probably won't lead to the death of the company. However, some errors are less forgiving.

Your security department believes that a disgruntled ex-employee may be responsible for recent sabotage. They may ask you for his old laptop. But is that enough? Does your security department know that this guy logged onto 37 different workstations and 5 different servers in the week before he was fired? If you have the data, and know the answers to their two questions, you'll be able to give them what they pay you for. Information.


Easy Answers to Hard Questions: Remotely Configuring Component Services

  | Share on Twitter Twitter | Share on Facebook Facebook | Submit to Digg digg it |  Add to delicious  delicious |  Submit to StumbleUpon StumbleUpon | Submit to Reddit reddit 

Setting your Component Services (dcomcnfg.exe) configuration can be more difficult than you think. DCOM (Distributed Component Object Model) can, by default, only be set locally at the workstation. This fact alone can make troubleshooting DCOM configurations a major pain. Enter DCOMACLS.EXE

If your Component Services security is not set properly you may find that remotely managing your computers is difficult, if not impossible.

DcomAcls.exe is a free utility that is bundled with Admin Arsenal. It allows you to view and set DCOM security locally OR on remote systems.

If you want to configure your Component Services locally then you can launch your Component Services manager via Administrative Tools (in the Control Panel) or by Start / Run / dcomcnfg.exe.  To view or configure remotely you will need to use DcomAcls.exe.

When you select the Properties for My Computer you can view the Default Properties tab. Under COM Security tab you will see the Access Permissions and the Launch and Activation Permissions for COM. Below is an example of the window which will show after pushing the Edit Limits... button under Access Permissions.

To set the permissions you want WITHOUT having to go to each computer and manually make these settings, you can use the DcomAcls.exe utility in the Program Files\Brisworks\Admin Arsenal directory.

The command below will give  Allow permissions for Remote Access to the user Domain\Tom.Waits on the computer named Raindog.

dcomacls.exe -allow AL.R:Domain\Tom.Waits -computer Raindog

The command below will change the Default Impersonation Level (on the Default Properties tab) to Impersonate on the computer named Raindog.

dcomacls -property impersonation=impersonate -computer Raindog

Check out the usage for DcomAcls.exe by running

dcomacls.exe /?

DcomAcls.exe does require that the Remote Registry service be running on target systems.


3.0 is bigger than 2.0, except when it's not

  | Share on Twitter Twitter | Share on Facebook Facebook | Submit to Digg digg it |  Add to delicious  delicious |  Submit to StumbleUpon StumbleUpon | Submit to Reddit reddit 

Microsoft has a lot of products. A lot. So, it's not surprising that occasionally they name things in a way that causes a bit of confusion. Here's an example that's bitten me lately.

Microsoft has a product called the .NET Framework. This product, which is used by application developers and needs to be installed on a computer in order to run those developers' applications, is actually a family of products. There have been 5 major releases:

  • .NET Framework 1.0
  • .NET Framework 1.1
  • .NET Framework 2.0
  • .NET Framework 3.0
  • .NET Framework 3.5

This list looks to be very simple, but it's a bit deceiving. Version 3.0 and 3.5 are actually separate products from 1.0, 1.1, and 2.0. They've just confusingly been given the same name. Versions 3.0 and 3.5 include 2.0 as part of their install, so it shouldn't really be a problem... Except in at least one case.

When Microsoft released version 3.5 they released 2.0 Service Pack 1. Among other things, the service pack allowed applications written to only support version 2.0 to use some of the new features in 3.5 (with a bit of tweaking.) It gave developers a way to get some 3.5 goodness without requiring that all of their customers install the just released 3.5.

Admin Arsenal is one such product; it requires .NET Framework 2.0 SP 1 or later. This has led to some confusion with users who have only version 3.0 installed, which is anyone with a default installation of Windows Vista. It sounds like having .NET 3.0 would indeed be "or later" than 2.0 SP 1, but it isn't. The fix is to install .NET 2.0 with SP 1, which sounds like it's going backwards, but it's actually more like going sideways with slightly forward curve.

Keep this in mind if you have .NET applications that don't seem to behave correctly on .NET 3.0. Not all installers verify which Service Pack for .NET is installed, and some .NET applications (mainly in-house ones) will have no installer at all.


Cold, Cramped, and Confused

  | Share on Twitter Twitter | Share on Facebook Facebook | Submit to Digg digg it |  Add to delicious  delicious |  Submit to StumbleUpon StumbleUpon | Submit to Reddit reddit 

The title of this blog is how I am feeling right now. Still, I have a smile on my face.

Actually I'm writing to you from Naples, Italy. I've spent the last 36 of 44 hours in this loud, very cold server room. As I was wrapping up a remote desktop connection to another server farm I found myself a little confused. I was trying to remember what country I was in. I kept thinking I was in Japan (another client site), but then I thought, "No, no, I was just there two months ago. I must be in ... Bahrain?" About 30 seconds later I realized where I was. It was then that I took a break.

Server rooms. You just love 'em, huh?

No matter where you are in the world, they seem so eerily similar. So are the cramps. I recall watching a mid-flight video on a Korean Airlines flight where the actors demonstrated some sitting exercises and techniques to help you fight cramping and dehydration. I'm using some of those techniques today.

I'll need more of those techniques. We're experiencing RAID Controller failures on one of our servers, so we have to roll back to a previous build. Not fun, but it's the only option now. We'll have to resume again tomorrow when we get some replacement disks.

If you have some exercises or techniques that you use to stay awake and alert in your cold, cramped, and loud server rooms I'd love to hear them.


Reboot with Pride

  | Share on Twitter Twitter | Share on Facebook Facebook | Submit to Digg digg it |  Add to delicious  delicious |  Submit to StumbleUpon StumbleUpon | Submit to Reddit reddit 

There is an old saying used by the US Navy submarine forces; "we hide with pride". Let's take this page from their playbook and apply it to our roles as system administrators. Reboot with pride.

In the past, rebooting a computer, especially a server, seemed to be almost an admission of guilt. For two decades Unix administrators have been needling their Windows counterparts over uptime and availability. Thanks to a better understanding to security (not to mention redundant servers) no longer are we willing to sacrifice security for bragging rights.

Windows systems need to be rebooted every month. Not because of leaking handles or poor performance, but for security. Microsoft releases patches monthly, therefore admins should be patching monthly. No excuses. Period. The end. Ummm, we've come to the part of the sentence that is meant to convey that there is no other alternative.

Unix administrators are slightly more free, key word being slightly. Depending upon the vendor, they usually patch quarterly. Gone are the days of the 365+ day server uptime. In fact, if you run into a Unix admin boasting of 365 day server uptime, feel free to thank him for letting you know that his systems are missing several quarterly security patch releases, therefore letting the free world know that his systems are vulnerable to whatever ailment(s) were patched in the past year. You can then remind him that he obviously failed his social engineering / corporate espionage training and that he should expect this serious vulnerability to be posted on your Myspace and Facebook pages in a matter of minutes (feel free to take a photo of his sweat-stained shirt with felt-tip ink blots on the pocket just to spice up your page a little).

Lest we be remiss, we don't want to exclude our application friends. Those wonderful Exchange, MS-SQL, Oracle, and < insert vendor specific application here > admins who also receive monthly/quarterly patches and should be scheduling their maintenance downtime right directly.

So be proud. You've earned it.


Multi-Processor File Compression

  | Share on Twitter Twitter | Share on Facebook Facebook | Submit to Digg digg it |  Add to delicious  delicious |  Submit to StumbleUpon StumbleUpon | Submit to Reddit reddit 

Jeff Atwood at Coding Horror recently published an excellent post on file compression with multiple processors. File compression is something that every sys admin runs into from time to time, and he's got some good information on how multiple processors affect it.

As is usually the case with Coding Horror, it has some great comments. Jeff's posts have some of the best signal-to-noise ratios in the blogosphere, and if you got the time to peruse them you won't regret it.


Easy Answers to Hard Questions: Online/Offline

  | Share on Twitter Twitter | Share on Facebook Facebook | Submit to Digg digg it |  Add to delicious  delicious |  Submit to StumbleUpon StumbleUpon | Submit to Reddit reddit 

Many of the requests which are made to a Systems Administrator (apart from the usual hygiene stuff) are much easier to fulfill than you may realize.

It seems your boss would like to know how many computers are currently online. Let's not ask why she wants to know this as we've stopped wondering things like that long ago.

Boss: "How many computers do we have in the company?"

SysAdmin: "Oh, that's easy" you say and you simply look at the main window in Admin Arsenal and read off the count of computer objects that is displayed in the status bar at the bottom of the window. "We have 233 computers."

Boss: "How many of those computers are being used right now?"

SysAdmin: "Well, let me see how many are online."

You simply create a new Dynamic Collection and in the filter drop down field you select "Online Status" equals "Yes" and then close the Collection definition window. Selecting the new Collection from the main window now shows only machines that are online.

SysAdmin: "It looks like 191 computers are currently online."

The online / offline status is determined by the Admin Arsenal Heartbeat feature. To determine the online status of remote machines the Admin Arsenal console will periodically (as defined in your Preferences window) send a ping (along with a few other minor WMI queries) to all computers in your environment. In order for machines to show the correct online/offline status, each machine needs to be able to respond to ICMP Echo Requests. If your environment blocks internal ICMP requests then you can enable them via GPO and the Windows Firewall.

The Heartbeat feature is configured using the Preferences command under the Admin Arsenal menu from the main window.


Microsoft Unveils "Thrive"

  | Share on Twitter Twitter | Share on Facebook Facebook | Submit to Digg digg it |  Add to delicious  delicious |  Submit to StumbleUpon StumbleUpon | Submit to Reddit reddit 

Thanks to Chris Avis for pointing out the new Microsoft Thrive effort for techies. It's coming at a good time as some of our kindred are finding themselves polishing up their resumes.

I remember in 2001 when a large food distribution company was hiring for one Windows NT server position. My brother-in-law was in charge of filling the position. He had over one hundred resumes coming in, and the guy they eventually settled on was willing to take 40k per year, vastly lower than he was getting only a year earlier.

If you are finding it difficult to land a job I strongly suggest using all the resources available to you, including some very focused training. Don't discount seminars and conferences. True, they cost some coin, but to use the often quoted cliche, "How much is your career worth to you?"

Kudos to Microsoft for making a good effort in providing options for their evangelists.


Review: Virtual CloneDrive

  | Share on Twitter Twitter | Share on Facebook Facebook | Submit to Digg digg it |  Add to delicious  delicious |  Submit to StumbleUpon StumbleUpon | Submit to Reddit reddit 

One thing that I've always enjoyed about working on Apple OS X is the ability to mount disk images. These act as though they were physical disk drives, however they are just files. One of the best uses for this technology is to mount CD and DVD images. More and more software is being delivered as ISO disk images, which are meant to be burned to physical media before use. Much of Microsoft's MSDN library of software comes as ISO files from their servers. It's tedious to have to burn them to disk before use. What's an admin to do?

Enter SlySoft's Virtual CloneDrive. This slick and free package installs a driver which allows you to mount DVD and CD files on a virtual drive. It really couldn't be any easier.

  1. Download the installer from SlySoft - The installer is a svelt 1.4 MB.
  2. Run the installer and answer questions about install location, file associations, and shortcuts.
  3. Be sure to continue through the unsigned driver warning (if you're on XP, I haven't tested on Vista). Unfortunately, the driver isn't signed, but I can easily let that slide for the price.
  4. No need to even reboot (in my experience). Suddenly you will have a new DVD drive show up.
  5. Double click on an ISO file.

That's it! 5 minutes start to finish and you can install from those pesky ISO files without going through the trouble of burning them. It even works over a network, so you can keep a library of installer DVDs on a file share for everyone to use.

Video Demo of Installing Virtual CloneDrive

I tip my hat to the people at SlySoft for making my life, and hopefully yours, easier. Thanks guys!


The 5 Commandments of Remote Software Deployment

  | Share on Twitter Twitter | Share on Facebook Facebook | Submit to Digg digg it |  Add to delicious  delicious |  Submit to StumbleUpon StumbleUpon | Submit to Reddit reddit 

Remote software deployment is one of the holy grails of system administration. Like all holy grails, it's usually just out of reach. The good news is that software deployment isn't impossible, just difficult to get right. Before you embark on the quest to the Castle Aaargh, keep in mind these 5 commandments and break them at your peril. They will be helpful whether or not Admin Arsenal is your tool of choice. For more in-depth information on software deployment, you can check out our whitepaper Unplugging the Sneakernet: Remote Software Deployment for Windows.

I. Thou Shalt Know Thy Silent Option

This is, by far, the most important thing to know in order to install software remotely. An installer that is running remotely on another computer and pops up a window to ask a question will hang forever. Even if someone is sitting at the computer, due to security restrictions in Windows, they won't be able to respond or click on a button. This is a difficult problem to diagnose, since there's no way to tell the difference between an installer that is hung waiting for a file and an installer waiting for input. There are a number of ways to find out the silent option for any given installer. Some, but by no means all, of these are:

  • Get an MSI version. If you have an MSI version of the installer, the best silent option is /qn (you can see all MSI options by running msiexec.exe from a command line.) Many deployment tools, such as Admin Arsenal, have this silent option built in. Keep in mind that some MSI installers break this rule and prompt anyway, but they're pretty rare.
  • Ask the developer. Many developers have documentation or support forums where this can be found.
  • Ask Google. Searching for things such as "Firefox silent install" can lead you right to the answer.
  • Ask the installer. Run the install with a parameter such as /? or -? or /help. A little trial and error may yield a dialog box or command line with some options.
  • Trial and error. Try some common silent options yourself and see if they keep any windows from appearing. Try things such as /q/s/silent/noui or /unattended may work.

There may not be a silent option. Unfortunately, remote installation is usually an afterthought, and sometimes a non-thought. In that case you can jump to commandment IV.

II. Thou Shalt Honor Thy User with No Reboot

Many application installations require a reboot of the computer to complete, usually to replace files which are in use. Since remote installations quite often happen when users are on the computer, this is more common than with standalone installations. Like with the silent option above, be sure to know about any options to prevent reboots. MSI has a couple of built-in options as do most installers with a silent option.

However, if you hate your users, this one doesn't apply to you.

III. Thou Shalt Not Double-Hop without Thy Primary Token

The double-hop problem is quite well known to administrators of web servers, where it crops up most often. But it's a good idea for you remote deployers to know about it, because it will probably bite you at one point or another. The problem is when credentials from one computer are used to access resources on another computer which then tries to use them to access resources on a third computer. The underlying details can get a bit complex, but suffice it to say that there will be times when your installer needs to get files off of a server but it can't. This happens when the installer is running without a primary security token.

Windows has a concept of secondary or impersonated security tokens. These are used when you connect to another computer remotely. They allow you to access the files, registry, and programs on the target machine, but a secondary token cannot be used to access any other computer beyond that. There are two ways to get around it:  The first is using Kerberos and Delegation in Active Directory, but this requires changes at the domain level and may not work in your environment. The second is to always use a primay token by passing your user name and password to the computer where you're running the installer. Most remote tools have this option, but keep in mind that some of them don't encrypt this information. Admin Arsenal is one that encrypts.

IV. Thou Shalt Covet Thy Neighbors Repackager

A repackager is needed when an installer doesn't have a silent option, or when you want to customize the application in a way that the installer doesn't support remotely. The concept is quite simple: The program watches what the installer does and then duplicates it in an installer of its own. This installer can run silently and will be able to customize the application almost infinitely. It's like making a clone with all of the uncooperative DNA removed.

There are a number of these products on the market, and for the most part they work quite well. Google for "Software Packager" to get an idea of what's available.

V. Thou Shalt Not Deploy without Testing and Testing Again

Finally, it's important to test, re-test, and test again. Remotely installing software can be a bit nerve-wracking. Without sitting at the console watching the install, there's no way to say "oh, crap, that's wrong, where's the cancel button.... click click click!" Always test an installer in a limited environment before sending it out into the wild to stomp all over users' files. Particularly if you're using a tool that can push out to large groups of computers at the same time. I've been there, and it's not fun cleaning up the mess.

There you have it, 5 commandments to bring you a long and angry-user-free life.


Remote Commands: Modify the Registry

  | Share on Twitter Twitter | Share on Facebook Facebook | Submit to Digg digg it |  Add to delicious  delicious |  Submit to StumbleUpon StumbleUpon | Submit to Reddit reddit 

Your users are complaining that they are constantly seeing a reminder window to update Java. They usually want to know one or more of the following:

  1. Should I install the update?
  2. Should I ignore the update?
  3. Can I have these notifications disabled?

Since most applications keep their respective configurations in the Windows Registry it is a good bet that you can reach your desired goals by modifying the registry.

Note: I hate the phrase "hack the registry". You can only "hack" the registry if you make a change to the registry that wasn't intended to be made. Most areas of the registry are made to be modified, either manually or automatically, so it is as much of a "hack" to modify a value in the registry as it is to modify a sentence in a Microsoft Word document.

By looking online (thank you Google) I was easily able to find the modification needed to turn off Updates for Java. Here is the following Registry Key that you need to modify:

HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Update\Policy

Turn off the Java Update feature by setting the EnableJavaUpdate value to "0". This will not only prevent the user from seeing the update requests, but it will also prevent them from updating at all. When you, as the administrator, are ready to update Java across your environment you can do so in an orderly and efficient way with software deployment.

To turn off the Java Update feature on mulitple machines, I suggest using the Remote Command feature in Admin Arsenal. The following command will turn off Java Updates:

REG ADD "HKLM\SOFTWARE\JavaSoft\Java Update\Policy" /v EnableJavaUpdate /t REG_DWORD /d 0 /f

The above command basically states: Add (or modify) the EnableJavaUpdate value to "0" and the type is DWord. The /f option forces an overwrite, which you will want to set if you are going to make this change en masse.

You can find the usage options for REG.EXE by running the following command from your Command Prompt:

REG /?

and

REG ADD /?

describe the image

Run your desired command on multiple computers at once (above we have selected an entire Collection) 

What are some common commands that you find yourself using? We'd love to hear how you use Remote Commands in your environment. Tell us your experiences by posting a comment to our blog.


Collection Folder Rollup

  | Share on Twitter Twitter | Share on Facebook Facebook | Submit to Digg digg it |  Add to delicious  delicious |  Submit to StumbleUpon StumbleUpon | Submit to Reddit reddit 

In Admin Arsenal, collection folders are handy to keep your collections organized, especially when you start to get a lot of collections to keep track of. What you may not realize is that folders can also hold computers. This is accomplished by Collection Folder Rollup.

Rollup refers to the ability of folders to look at each collection inside of them, combine all of the computers in each, and roll them up into a single list. This is especially useful when the criteria for your collections is hierarchical in nature. Consider the following example:

This hierarchy works great if you want to quickly see which computers are servers, or only the servers with Windows 2008. To get the computers to flow up into the folders, you need to set the Collection Folder Rollup property of each folder. This is done by right clicking on the folder.

You have three choices for rollup.

  1. No Children - Don't do any roll up, the folder contains no computers.
  2. All Children - Include any computers which are in all of the child collections. A computer must show up in every collection to be in the folder.
  3. Any Children - Include computers if they appear in any child collection. This is the choice that we want for the example above.

Once you have your collection folders rolling up computers, you can use them everywhere you would use a static or dynamic collection.


All Posts