Networking is the act of connecting one or more computers together using wired or wireless technology.

Use a Group’s SID Rather than Group Name For ThinApp Deployments

When I deploy applications with VMWare’s ThinApp, I like to limit the users that can use the application by specifying a single group via the PermittedGroups option in the package.ini file. Then i can control deployment by adding and removing users from the group in Active Directory.

When I’ve discovered is that your applications become useless if you rename the group after you build the application package. I didn’t find this out until I started standardizing our group naming conventions and began adding a prefix to all groups that control application deployment.

Fortunately PermittedGroups also supports the use of group SIDs, which never change regardless of the name of the group. I’ll get the group’s SID using PowerShell, then paste it into the PermittedGroups line in package.ini, then rebuild.  After that I can do anything I want to the group (other than delete it) and it’s ability to assign the ThinApp will be affected.

# Return the SID of an Active Directory group
[string](Get-ADGroup “Paste Group Name here”).SID

Listing Nested Members of a Group on the Command Line

Here is a simple little snippet of command-line magic you can use to display members, including nested members, of a group in Active Directory:

No Internet After Reformatting Windows? No Problem

A number of YouTube users replied to my video Find Your Network Settings in Windows XP asking for advice on what to do when you have no Internet after reformatting Windows.  This is almost always as simple as installing the correct Ethernet or wireless driver for your computer.  Your computer should have come with a disk with all of the drivers for your hardware. If you put in an ethernet or wi-fi driver after-the-fact, that should have come with a disk too.

Install the drivers from the disk, and your Internet connection should be available.  if you are using wireless, you may have to configure your network name (SSID) and password.

Subnet Calculator in 9 Lines of PHP

I’ve been spending a lot of time studying for my Microsoft 70-642 exam, an important part of which is subnetting.As an intellectual exercise I wrote a subnet calculator. Enjoy:

 function subnet($hosts)
	$bits       = decbin($hosts) + 2; // Add 2 for Network ID and Broadcast
	$hostBits   = strlen($bits); // find how many bits it takes to represent it
	$cidr       = 32 - $hostBits; // Find slash-notation
	$binaryMask = str_repeat('1', $cidr) . str_repeat('0', $hostBits); // Subnet in binary
	$subnet     = implode('.', array_map('bindec', str_split($binaryMask, 8))); // Subnet in dotted-decimal
	return array('hosts' => $hosts, 'hostBits' => $hostBits, 'cidr' => '/' . $cidr, 'binaryMask' => $binaryMask, 'subnet' => $subnet);

A Better Way to View Shell Command Output

I’m a command prompt guy.  If there is a way to do something with the keyboard, then by golly, that’s how I’m going to do it.  But sometimes you’ll want to use a command whose options and formatting aren’t obvious, and when you type the command to view the command’s usage (usually by typing command /?, command -h, or command –help), black and white letters go flying by like a newspaper in a Blendtec ad.

Linux users can read command documentation via the man command which provides detailed usage instructions in a way that’s easy to read and navigate.  We Windows admins don’t have such a luxury, but you can mimic it.

Piping Output to More

One way to view the output of a command when it’s longer than a single screen is by piping the output to the more command like this:

command | more

For example if I want to view the help page for the icacls command:

icacls.exe /? | more

This method works, but what if you want to save the command’s output for use later?

Redirecting Output to a File

Another option is to send the command’s output to a file. This can be done using the redirection operator “>”

command > output.txt

Using the same command from above, we’ll save the command usage page for icacls.exe to a file called icacls_help.txt:

icacls /? > icacles_help.txt

If we want to be really fancy, we can combine the ideas of redirection and piping and view the help page immediately in notepad:

icacls /? > icacls_help.txt | notepad icacls_help.txt