Archive for May, 2011

Backing up a Windows 7 Boot Camp installation and restoring it to a smaller partition.

May 26, 2011 1 comment

I had set up a Boot Camp installation yesterday for a user, who wanted to use it for both dual-booting and so he could use VMWare (using the Boot Camp partition for the VMWare Windows install.) I’d set it for 100 GBs (20%) of the disk and delivered it, but I got a follow-up email from the user asking if the Windows partition could be made smaller (50 GBs).

Since there’s no easy way I know of to shrink a Windows partition (plenty of options if you want to grow it), I was looking at a multi-hour re-install of Windows 7 which I had just done.

That’s when I remembered my (possible) savior: Winclone . The venerable tool was no longer being updated, but it could still save my bacon. At least, that’s what my hope was.

After some Googling, I happened across this Apple Discussion thread and saw Toocool4‘s post at the bottom of the thread. That was the key information I needed and it helped me immeasurably with avoiding the pain of reinstalling Windows 7 again. See below the jump to get the procedure I used.

Read more…

Oh yeah, I have a GitHub repository.

May 21, 2011 Leave a comment

In my just-previous entry, I mentioned that I was linking to scripts in my GitHub repository. For those and other scripts, my GitHub repository is publicly available at the following address:

Categories: Geeky, Scripting

Upgrading an Intel Mac from 10.5.x to 10.6.x using NetInstall and DeployStudio

May 21, 2011 Leave a comment

One thing I was asked recently was to share how I’m using NetInstall and DeployStudio to (mostly) automate upgrading from 10.5.x to 10.6.x. I’ve written up the procedure I’m using at my own work place (with appropriate sanitization of work-specific details) and posted them here:

Where possible, I’ve posted the scripts on my GitHub repository and linked them to the procedure.

Update – PDF version available here

Outlook 2011 can’t import Outlook 2011-generated mbox mail archive files.

May 19, 2011 3 comments

Outlook 2011 has a bug currently with importing Outlook 2011-generated mail archive files, where Outlook 2011 can export mail to .mbox files, but can’t then import the Outlook 2011-generated mbox files using its mbox import function. To fix this for one of my users (who needed to import mbox files given to her by another Outlook 2011 user), I came up with this workaround.

In this case, I was using Apple Mail and the procedure assumes that Apple Mail hasn’t been configured.

Here’s what needed to be done to fix it:

1. Open Apple Mail.
2. Set up a dummy account. (localhost was used for all requested server names.)
3. Import the mbox files using the following procedure:

A. In Mail, click on the File menu and select Import Mailboxes…
B. In the Import window, select Files in mbox format.
C. Select the mbox files to import.

4. Once imported, quit Mail
5. Open Outlook 2011.
6. Import the mbox files using the following procedure:

A. In Outlook, click on the File menu and select Import
B. In the Begin Import window, select Information from another application.
C. Select Apple Mail.
D. In the Import Items window, uncheck all except for Messages

7. Outlook will seem to freeze as it imports the messages.
8. If the On My Computer folders are hidden, you will need to unhide them (see here for details: )
9. Find the Mail import folder.
10. Copy the imported mail into a new folder under the user’s Exchange inbox.
11. If you unhid the On My Computer folders, re-hide them.

Setting preferred wireless networks from the command line.

May 17, 2011 4 comments

If you need to set a wireless network in Mac OS X from the command line or with a script, you can do so with the networksetup command. Networksetup has a few options that are specifically geared to working with wireless networks. For me, one of the more useful is the ability to set wireless networks, either manually via the command line or automating it with a script. You can set this using the -addpreferredwirelessnetworkatindex option, with the network port, wireless network name, the index number you want to assign it to (set it to 0 if you don’t know what to set it to, as that’ll bump it to the top of the list), and the security type of the wireless network (OPEN, WEP, WPA, WPA2, WPAE or WPA2E). You can also substitute NONE in place of OPEN in the security type.

For example, you may have a wireless network named HomeNetwork that uses WPA2 encryption with the password of donthackme. It’s the only one in your environment and you want to set your Mac(s) to prefer this wireless network. To set your preferred wireless network, log into your Mac(s) with an admin account, open Terminal and run the following command:

sudo networksetup -addpreferredwirelessnetworkatindex AirPort HomeNetwork 0 WPA2 donthackme

Running this command will add it to the list of your preferred wireless networks in System Preferences: Network: Airport. It will also add a password item to the System keychain for the HomeNetwork wireless network, which will store the donthackme password.

For greater flexibility, you can also script this so that all of the various values after -addpreferredwirelessnetworkatindex are variables which can be set as needed. See below the jump for a script that shows how to do this.

Hat tip to Charles Edge for describing this method in this entry on his blog:

Read more…

Disabling the Xerox ColorQube print banner

May 5, 2011 2 comments

I had a call come in today asking to have the print banner for our Xerox ColorQube turned off. We don’t normally have that option enabled, so I took a look and found something that annoyed me greatly. The print banner in the Mac’s print settings was disabled, as it should have been, but there was a second banner option buried deep down in the Advanced section in the Xerox-specific settings. That login banner option was enabled by default.

In the event anyone has a similar annoyance, here’s how you can turn it off:

1. Log in as any user at your workstation.

2. Log into the local CUPS web interface: http://localhost:631

3. Select your Xerox ColorQube’s print queue

4. Select Set Default Options

5. Select Advanced

6. Set XRBannerSheet to Off

7. Click the Set Default Options at the bottom of the page.

You then need to authenticate with the local administrator account’s username and password. After that, the Xerox banner option will be turned off by default in your ColorQube’s print queue on your workstation.

Update – 5-6-2011:

I had one person ask how to send this silently on the command-line, so that it could be scripted or sent to multiple machines at the same time. Here’s the lpdadmin commands you’ll need to send:

To identify the CUPS print queue for the Xerox ColorQube printer on the workstation, run the following command:

lpstat -v | awk '{sub(/\:/,"",$3); print $3}'

You should see a printer name that references either the printer’s name or IP address. Use this in place of print_queue_name in the commands below.

To disable: sudo lpadmin -p print_queue_name -o XRBannerSheet=None

To re-enable, sudo lpadmin -p print_queue_name -o XRBannerSheet=AtStart

You can also edit and take the PPD for this printer from /etc/cups/ppd and use it on a print server (or as part of your image), so that everyone who gets their PPD from that print server will automatically get those options set for that print queue.

Setting access controls for SSH Part 2

May 2, 2011 2 comments

As a follow-up to my earlier blog entry on setting SSH access controls, here’s how you can add groups to your SSH SACL:

Command to create the SACL (if it doesn’t already exist):

dseditgroup -o create -q

Add your group as a nested group inside the SACL group:

dseditgroup -o edit -a “group name” -t group

If you’re adding an AD group, you may need to add the AD domain’s name:

dseditgroup -o edit -a “DOMAIN\group name” -t group

%d bloggers like this: