Tuesday, March 31, 2009

Monitor pressed keys in C# ASP .NET text box controls

Similar to the way you can add a confirmation dialog box to a form, you can also monitor keystrokes within your text boxes and fire events off depending on which button is being pressed. This can help restrict certain buttons, or provide a specific key combination to perform a certain actions. Here's how to do it:

protected void Page_Load(object sender, EventArgs e)
{

if(!IsPostBack)
{
TextBox1.Attributes.Add("onkeydown", "if((event.which && event.which == 13) || (event.keyCode && event.keyCode == 13)) {alert('Please do not use the Enter key'); return false;} else return true;");
}

}

What this code does is define the "onkeydown" attribute for the text box named "TextBox1". In the example, it checks to see if the user is pressing the Enter key, and if so, displays an alert dialog box telling them not to. By having it return false, it then does not process that keystroke either. If they do not press Enter, then it returns true and the character they typed shows up in the text box. 

My need for this is that I didn't want users pressing Enter to skip lines in a multi-line text box. This worked perfectly, and could be used for all kinds of other purposes related to which keys are pressed at a certain point within a form. The original post I used to come up with this can be found here.

Thursday, March 26, 2009

Exchange error c103102e6 when adding new email address

If you're trying to add a new email address to a recipient policy, but receive an error c103102e6, don't worry. It just means that you forgot to include the '@' symbol in your email address. Add that in front of the email address you're adding to the recipient policy, then try again. You can find the same solution in MS KB 839500 too.

Free, easy to use network IP address scanner

I've used Angry IP Scanner numerous times to search for devices on the networks I manage. It's a really nice tool to have, and since it's free there's no reason not to. In fact, I've used it twice this week to figure out what IP addresses a couple of devices had after getting plugged in to the network (they were using DHCP). It works great for identifying those devices and active hosts, which cuts down on time trying to guess or having to gain access to the DHCP records to get information.

Wednesday, March 25, 2009

C# ASP .NET web form confirmation dialog box

I didn't realize just how simple it was to include a confirmation dialog box in a C# .NET web form. This is very useful for avoiding incorrect submissions, or those pesky accidental Enter press submissions. Here's how you can do it:

Assuming you have a Button control defined in your form, and lets say its name/ID is Button1. Button1 is also your form submission button. If you want to provide the user a confirmation box to make sure they mean to submit, you can add a single line of code to the Page_Load section of the code-behind file.

protected void Page_Load(object sender, EventArgs e)
{

if(!IsPostBack)
{
Button1.Attributes.Add("onclick", "return confirm('Ok to submit?');");
}

} 

By adding the "onclick" attribute, this will produce a dialog box with the text "Ok to submit?", with buttons for Ok and Cancel. If the user clicks Ok, the form will continue processing the submission. If they click Cancel, the submission doesn't happen and they can fix their info before submitting.

I added the if(!IsPostBack) so the Page_Load only processes this once. Otherwise it would add the attribute each time the page was posted back to the server. It's not that it would cause any major issues, but the more efficient the code, the better off you'll be. I found it at http://forums.asp.net/t/1213430.aspx, and they had other options to consider if you're interested in more information.

Monday, March 23, 2009

Fix SQL Server error 0xc00470fe

I ran into this error when trying to import data from a spreadsheet and .csv file to an existing SQL database. The import data wizard was able to create the table correctly, but it wouldn't import any of the existing data. I did a quick Google search and found out that the problem had a pretty simple fix. I thought the server already had integration services installed, but apparently it didn't. In order to import the data, you need to make sure integration services are installed. To do that, just put your SQL Server installation CD in the drive and go through the install process. During the installation, you're given the options for what you'd like to install. Check the Integration Services box and continue. Don't check any others unless you understand what they are and feel that you know what you're doing. Finish the install, then go back and try importing your data again. I bet it'll be ok.

Friday, March 20, 2009

Check IBM/Lenovo, Dell, HP, Apple, and other warranty status

Ever wondered whether your system or equipment was still covered under a warranty? I know I have. It's not always easy to keep track of warranty information when multiple machines are involved. However, some companies do allow you to check the status of a warranty on the web, as long as you know the serial number or service tag of the device. Here are links to IBM/Lenovo, Dell, HP, and Apple's warranty information lookup pages. If you know of others, please leave a comment with a link and the name of the manufacturer.

IBM/Lenovo

Apple

Dell

HP

Updated 3/22/2009

Western Digitial

Lexmark

Seagate

Tuesday, March 17, 2009

Windows Vista, event ID 10 repeatedly shows up in log

I was diagnosing an issue with a Windows Vista laptop and ran across this. Event ID 10 errors were in the event log repeatedly, and even though I didn't think it was related, I found a solution. You can find it in MS KB 950375.

You need to create a visual basic file, .vbs, using NotePad, with the following code inside:

strComputer = "." 
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\subscription")

Set obj1 = objWMIService.Get("__EventFilter.Name='BVTFilter'")
set obj2set = obj1.Associators_("__FilterToConsumerBinding") 
set obj3set = obj1.References_("__FilterToConsumerBinding") 

For each obj2 in obj2set 
WScript.echo "Deleting the object" 
WScript.echo obj2.GetObjectText_ 
obj2.Delete_ 
next 

For each obj3 in obj3set 
WScript.echo "Deleting the object" 
WScript.echo obj3.GetObjectText_ 
obj3.Delete_ 
next 

WScript.echo "Deleting the object" 
WScript.echo obj1.GetObjectText_ 
obj1.Delete_

To create the .vbs file, you'll either need to use Save As from within Notepad, or you'll have to show extensions on files so you can change them.

After you have your .vbs file with the code above inside, you need to run it with administrative priveleges. The easiest way to do this is from the command line. Right-click the shortcut to the command prompt, and select "Run as administrator". If you don't have a shortcut, you can find the program at C:\Windows\system32\cmd.exe on your computer. From here, run your .vbs file from the command prompt and it should take care of the problem. You can do that by simply typing in the full path to the file, e.g. C:\Users\username\Desktop\test.vbs, and pressing Enter. If there are spaces in any of the directory names in the path, be sure to surround the entire path with double-quotes.

Intermittent connection with Intel PROSet wireless card

I ran into a problem with some built-in Intel wireless cards in a couple of IBM machines a few weeks back. I reformated and reinstalled Windows, but for some reason after the reinstall the wireless cards weren't able to stay connected. The other thing that was happening is that after it dropped the wireless network it wouldn't be able to find any other available networks, or I'd see some of the networks but would get an error when I tried to join any of them. I double-checked the drivers, played with the BIOS, contacted IBM, tried the Windows and Intel wireless software, but nothing seemed to help. I'm using a Cisco WAP and had never had any issues with it before. The firmware is probably a little older, but since the wireless cards were working prior to the Windows reinstall, I didn't expect the router to be causing the problem. That's when I was finally able to find an answer with the help of some Google searching.

The power management and roaming aggressiveness built into the Intel driver can apparently cause problems, such as intermittent connectivity. The fix is relatively simple, but doesn't involve a driver update. You have to have administrative privileges in order to do this:

1. Right-click the My Computer icon and select Manage
2. Go to Device Manager 
3. On the right, click the + to expand Network Adapters
4. Locate your Intel wireless card, right-click on it, then select Properties
5. Go to the Advanced tab.
6. In the Property box, scroll through and look for Power Management. Make sure it is set to Highest. Uncheck "Use default value" if you have to. This will make sure that the wireless card isn't having any problems staying powered on.
7. Go back to the Property box and look for Roaming Aggressiveness. Make sure this setting is set to Lowest. Again, uncheck the "Use default value" box if you have to in order to change this setting. This will keep your wireless card from trying to jump back and forth between wireless networks.
8. Click OK, then close the Computer Management console
9. Restart, and hopefully things start working like they should 

I did find others say that upgrading their wireless access point/router did help solve their issue, so feel free to try that if this doesn't work. Like I said above though, for my problem I didn't need to and it didn't seem like it should have mattered anyway.

Here's a note from Intel. It doesn't mention the roaming aggressiveness, but I had found that in some forum notes somewhere. The combination that I gave above is what solved the problem for me, but feel free to try your own combo.

Monday, March 16, 2009

No hard drives found during Windows installation

If you're trying to install Windows on a machine, but run into an error that says that no hard drives were found, it's one of two things. Either the hard drive you're working with is faulty and truly not available, or the driver needed to communicate with the hard drive is not one of the defaults loaded on the Windows installation CD. Hopefully it's the latter, and if you have the drivers on a floppy, and the computer actually has a floppy drive, then you're set. If not, it's actually not that hard to fix with some free software, a CD burner, and a Windows install disc.

I actually found a really good help guide here: http://www.howtogeek.com/howto/windows/resolving-setup-did-not-find-any-hard-disk-drives-during-windows-xp-installation/. Because that one is done so well, I'm not going to reiterate it, but rather direct you right to that site. The just of it is that you need to create a new XP install disc using a free program called nLite. During the creation process, you will be given the option to include drivers for your hard drive, which you can usually download from the computer manufacturer's website if you don't already have them. At the end, you can create an .ISO file, which can then be burned to a CD and used to install Windows on the machine.

If you're just looking to find a way to include new service packs or updates in your XP install so you don't have to run Windows Update 10 times after you're finished, nLite handles that as well. My previous post about slipstreaming updates includes directions on how to do this, but nLite looks to be much more simple to use.

Friday, March 13, 2009

Reset Blackberry to factory defaults and wipe information

If you're going to sell a Blackberry you don't want anymore, are having weird problems, or just want to start over, you can reset the phone to the factory defaults pretty easily. This will erase all user information from the phone and it will then be as if it just came out of the box for the first time, minus the physical wear and tear. Anyway, to reset your phone, follow these instructions:

1. From the icon screen, go to Options, then into Security Options
2. Press the Menu button to bring up the menu, then select "Wipe Handheld"
3. Is should ask you to confirm the erase, so agree to that
4. Type "blackberry" when prompted. This is a safety feature to make sure you really do want to wipe the phone.
5. That's it. Now wait for the device to finish resetting itself, then you can do whatever you were going to do with it

If you're worried that you may need something from the phone afterwards, be sure to use Blackberry Desktop Manager to create a backup of it prior to resetting. This method performs a hard reset, so once it is finished your data is lost. The only way you'd be able to recover it would be from a backup.

Thursday, March 12, 2009

Printers disappear or won't work in Mac OS X

I had a few OS X users who had their printers disappear this week. When I tried to add them, an error would pop-up saying "server-error-service-unavailable". I assumed the print spooler/service had stopped, but wasn't sure how to reset it. A simple restart fixed one of the machines, but the other continued having problems. I did a quick search and ran across Apple KB TS1975. It explains how to restart the printing system using Terminal. I ran through the steps quickly, restarted, and the printers were back, and working. First off, you must be logged in with administrative credentials to follow these steps:

1. Open Applications->Utilities->Terminal
2. In the prompt, change the directory to /var/spool using the command: cd /var/spool/ and pressing Enter
3. Use the command sudo mkdir cups. This will elevate your permissions to try to create a new folder called "cups". It may ask for your password, which you can Enter. Also, if you get an error saying the directory already exists, ignore it an continue on with the rest of the steps
4. Now use the command sudo chown daemon:admin cups. This will change the owner of the "cups" folder.
5. Now use sudo chmod 700 cups, which will change the permissions on the "cups" folder
6. After you're done running through those commands, quit Terminal and reboot. The printers that you had setup before should be back, and you should be able to print again.

While trying to find the link to that article for this post I also ran across Apple KB HT1341. You may want to try that first if you're running OS X 10.4 or 10.5, unless you're itching to go through the Terminal commands. There's less room for error, and it's just a few mouse clicks.

Fixing errors printing to a shared Windows printer from Mac OS X

I needed to get some Mac users setup to print to a special printer with software running on a Windows computer. I ran into some problems at first, then narrowed that down to the Windows share name having an underscore. Turns out that's not the only place you can't use special characters. I continued to get an error NT_STATUS_LOGON_FAILURE, and couldn't figure out why. The domain account's username and password was stored in the keychain, and the samba settings appeared to be correct. That's when I turned to Google and found Apple's KB HT2398. It turns out that you can't have any special characters in the shared printer's name, the username, the password, or the name of the computer sharing the printer. Sure enough I had special characters in the password, so as soon as I changed it the printer started working again.

One other useful thing I learned while trying to solve this problem was that there is a web-interface for printer management in OS X. You can get to it by going to http://localhost:631. This is the CUPS (common Unix printing system) admin interface, and can be found on Linux machines as well. One thing that is really useful in that interface is that you can see how the printer is mapped with Samba. You may find it helpful for diagnostics if you're troubleshooting a shared printer being used on a Mac

Export to csv from OpenOffice Base using SQL

I have a Mas 90 install that I needed to export data out of. The server didn't have Excel, but it did have an ODBC mapping for Mas 90, so I threw OpenOffice on it quick and decided to try to get the data that way. At first glance, the lack of the normal File->Export functionality made me wonder if it could do it, but a few Google searches later I had the answer. I found it here.

The easiest way is to drag your database table into an open Calc file. This will copy the contents to the Calc file, and you can then do an export to csv from there. It is also the only way I found that would allow you to preserve the column headers. To do the export from Calc, simply open up your Base file, and open a new Calc file. Drag the table or query you want to export into the open Spreadsheet window. This will copy the data into Calc. Once that finishes, in Calc, go to File->Save As. Enter the filename to save your csv as, and also change the "Save as type" to "Text CSV" (or whatever other format you'd like). Then follow the prompts to set the delimiter and change any other configurable options. If you'd rather avoid copying data to a Calc spreadsheet and then copying it back out, there is another way too.

You can also use a SQL command to get the data out of your table in Base. You can do that by opening your database, going to Tools->SQL... From there, type the following into the "Command to execute" box, then clicking on Execute. If you get a lexical element error, be sure to read further down.

SELECT * INTO TEXT "output_csv_file_name" FROM "your_table_name"

Substitute the name you want the exported csv to have for "output_csv_file_name", and use the name of the table you're exporting in place of "your_table_name". Also, surround both with double-quotes, just like in the above example. Without them the command won't work. Also, after you've executed this command, the csv will be put in the same directory that your Base database is stored in. I'm not sure if you can change that, but I do know that putting a path in for the file name doesn't affect the location.

I also ran into an issue using this directly from my initial Base database. I had set it to open my ODBC database rather than create an actual Base database, but this kept giving me an error saying there was an unexpected lexical element, and listing FROM. I found that by copying the table I wanted to export to an actual Base database I had created, I could then use the SQL command within that database instead. This requires two .odb files, one linked to your ODBC source, and another standalone, blank Base database you created new. It's not the greatest workaround, but copying and pasting is simple enough, and if that's the only way to get the data out, then so be it.

In case you're wondering, I used OpenOffice.org 3.0. This command was new to me, and I'm going to guess you could use it to export any type of database table that supports SQL commands to a csv, not just OpenOffice databases. I know you can use 
SELECT * INTO table1 FROM table2 
to create copies of SQL tables (this would create a copy of table2 named table1), but I wasn't aware that you could export direct to a csv by adding TEXT to it. Good luck!

Wednesday, March 11, 2009

AppleScript to automatically add file extensions

First off, I have to point you to http://www.macwindows.com/convertr.html. That is where I found the original script to modify for my needs, so thank you for that. I needed to set up a folder using folder actions (see previous post) that would check a file put in a folder to see what type of file it was, and if it didn't have the correct extension, it would add it to the filename. At first I didn't think it was possible, but then I ran across this script and the idea of File Creator and File Type (see previous post). If you know what the file type and file creator are for a file, and you also know what the extension should be for that combination, you can program it with AppleScript. The previous post has a link to a free program that makes it easy to find both of those values for any particular file. The main project I was given was to rename art/design files created with Quark, Illustrator, InDesign, Photoshop, and Acrobat. This covers various extensions: eps, qxd, ai, indd, pdf, tif, and jpg. You could tweak it to your needs, or add more, using some copy/paste action, and also the FileType program from the previous post. I apologize in advance for the poor formatting, but it was either this or post a screenshot, and this way you can use copy/paste. Be aware that because of the formatting, simply copying and pasting will probably cause the code to not compile. You'll most likely need to try compiling, and then go through the code in your AppleScript editor, adding carriage returns where needed so the commands are lined up correctly. Use this code to create a new AppleScript, then enable Folder Actions on a folder and attach the script to that folder. After you do that, each time you add a file to that folder, the system will run the script, check what type of file it is, and add the extension if needed. Anyway, here is the final AppleScript that I came up with, and it seems to be working fine for the users who have been using it.

If you have a need to add the file extension and also remove or replace certain characters from the file name, check out my newer post about using Applescript for the removing or replacing.
________________________________

EPSF (eps), AI (ai), PDF (pdf), ART5 is Illustrator

indd = Creator: InDn, Type: IDd5
indd = Creator: InDn, Type: IDd4
ai = Creator: ART5, Type: PDF
eps = Creator: ART5, Type: EPSF
psd = Creator: 8BIM, Type: 8BPS
pdf = Creator: CARO, Type: PDF
jpg = Creator: 8BIM, Type: JPEG
eps = Creator: 8BIM, Type: EPSF
qxd = Creator: XPR3, Type: XPRJ
tif = Creator: 8BIM, Type: TIFF
*)

-- THESE PROPERTIES ARE FOR THE NOTIFICATION ROUTINE
-- if true, the script will speak the alert. If false, the script will 
--display an alert

property speak_alert : false 

-- set the amount of time before dialogs auto-answer.dialog
property dialog_timeout : 30

-- THIS PROPERTY IS USED TO INDICATE WHETHER THE SCRIPT 
--CHECKS THE INCOMING FILES FOR COMPLETED TRANSFER
-- SET THIS PROPERTY TO TRUE FOR FOLDERS SHARED VIA 
--FILE SHARING
-- NOTE THAT ITEMS DROPPED IN SHARED FOLDERS WILL 
--HAVE THEIR LABEL SET TO 7

property copy_checks_indicator : false

-- THESE PROPERTIES ARE FOR THE STATUS CHECKING 
--ROUTINES
property item_check_delay_time : 2
property folder_check_delay_time : 3
property special_label_index : 7

on adding folder items to this_folder after receiving added_items
try
if copy_checks_indicator is true then
 -- CHECK THE FILES TO MAKE SURE THEY'RE 
--COMPLETELY AVAILABLE
set the added_items to my check_added_items(the added_items)

if the added_items is {} then return "no valid items"
end if

tell application "Finder"
 --get the name of the folder
set this_folder_name to the name of this_folder
end tell

-- find out how many new items have been placed in the folder
set new_item_count to the number of items in the added_items

tell application "Finder"
repeat with x in added_items
copy name of x as string to FileName
copy file type of x as string to FileType
copy creator type of x as string to FileCreator
-- check for Quark
if FileType is "XPRJ" and FileCreator is "XPR3" then
if FileName does not end with ".qxd" then
set Suffix to ".qxd"
set the name of x to FileName & Suffix
end if

else if FileType is "XDOC" and FileCreator is "XPR3" then
if FileName does not end with ".qxd" then
set Suffix to ".qxd"
set the name of x to FileName & Suffix
end if
-- check for Illustrator ai
else if FileType is "PDF" and FileCreator is "ART5" then
if FileName does not end with ".ai" then
set Suffix to ".ai"
set the name of x to FileName & Suffix
end if
-- check for InDesign
else if FileType is "InDn" and FileCreator is "IDd5" then
if FileName does not end with ".indd" then
set Suffix to ".indd"
set the name of x to FileName & Suffix
end if

--check for InDesign CS2
else if FileType is "InDn" and FileCreator is "IDd4" then
if FileName does not end with ".indd" then
set Suffix to ".indd"
set the name of x to FileName & Suffix
end if
-- check for Illustrator eps
else if FileType is "EPSF" and FileCreator is "ART5" then
if FileName does not end with ".eps" then
set Suffix to ".eps"
set the name of x to FileName & Suffix
end if
-- check for Photoshop psd
else if FileType is "8BPS" and FileCreator is "8BIM" then
if FileName does not end with ".psd" then
set Suffix to ".psd"
set the name of x to FileName & Suffix
end if
-- check for Photoshop tif
else if FileType is "TIFF" and FileCreator is "8BIM" then
if FileName does not end with ".tif" then
set Suffix to ".tif"
set the name of x to FileName & Suffix
end if
-- check for Photoshop jpg
else if FileType is "JPEG" and FileCreator is "8BIM" then
if FileName does not end with ".jpg" then
set Suffix to ".jpg"
set the name of x to FileName & Suffix
end if

-- check for pdf
else if FileType is "PDF" and FileCreator is "CARO" then
if FileName does not end with ".pdf" then
set Suffix to ".pdf"
set the name of x to FileName & Suffix
end if
end if
end repeat
end tell

on error
end try
end adding folder items to

on remove_labels(the added_items)
tell application "Finder" repeat with this_item in the added_items
set the label index of this_item to
end repeat
end tell
end remove_labels

on check_added_items(the added_items)
-- check the transfer status of every added file to determine
-- if each file has completed being moved into the 
--attached folder

set the notbusy_items to {}
repeat with i from 1 to the number of items in the added_items
set this_item to (item i of the added_items)
if my check_busy_status(this_item) is false then
set the end of the notbusy_items to this_item
end if
end repeat
return the notbusy_items
end check_added_items

on check_busy_status(this_item)
-- a folder can contain items partially transfered
-- this routine will wait for all the folder contents to transfer

if the last character of (this_item as text) is ":" then
set the check_flag to false
repeat

-- look for any files within the folder that are still transferring
tell application "Finder"
try
set the busy_items to the name of every file of the entire contents of this_item whose file type begins with "bzy"
on error 
set the busy_items to {}
end try
end tell

if the check_flag is true and the busy_items is {} then
return false
-- pause for the indicated time
delay the folder_check_delay_time

-- set the flag and check again
set the check_flag to true
end repeat
else 
-- the passed item is a single file, suitcase, clipping, etc.
-- check the label of the item. If it is the marked label 
--then it's already been processed so ignore.
tell application "Finder"
if (the label index of this_item) as integer is the special_label_index then
return "ignore"

end if
end tell

set the check_flag to false
repeat
tell application "Finder"
set the item_file_type to the file type of this_item
end tell

if the check_flag is true and the item_file_type does not start with "bzy" then
tell application "Finder"
set the label index of this_item to the special_label_index
end tell

-- allow the Finder time to change the label
delay the item_check_delay_time
return false
else if the item_file_type does not start with "bzy" then
-- set the flag and check again
set the check_flag to true
end if
-- pause for the indicated time
delay the item_check_delay_time
end repeat
end if
end check_busy_status

--HANDLER FOR KEEPING THIS FOLDER OPEN

--To activate the handler, remove the comment 
--markers (the parens and asterisks)
--at the beginning and end of the following handler 
--and save this script.

(*
on closing folder window for this_folder
beep
tell application "Finder"
open this_folder
end tell
end closing folder window for
*)

Tuesday, March 10, 2009

Using folder actions in OS X to automate tasks

One nice feature of OS X that I was unaware of until recently were folder actions. They can be used to set up a folder as a "dropbox" which can perform specific tasks assigned to the folder through the use of Applescripts. Some of the default tasks included with OS X are displaying a prompt any time a file is added to a folder, duplicate a file as a jpg, tif, or png file, or rotate an image left of right. If you're good with Applescript, you can create customized scripts so it will do exactly what you want it to. It's fairly easy to configure folder actions. There are two options for enabling/disabling folder actions. 

One way is to create the folder you want to use, then Control+Click on it and select "Enable folder actions". After doing that, Control+Click on it again and you should see an option for "Attach a folder action". Select that, and then pick the script you want the folder to execute. You could also use Control+Click and then select "Configure folder actions", which lets you manage all of the folders that have folder actions enabled, along with which script(s) each folder users. There are some preloaded scripts with OS X, and you can also use customized AppleScripts if you know what you're doing to create those. The default location for the built-in scripts on a Mac Desktop is Macintosh HD->Library->Scripts->Folder Action Scripts.

The other way to get into the Configure folder actions is only applicable if you're setting it up on an OS X Server. If you are using OS X server to share folders that you want to attach scripts to, you can go to Applications->AppleScript->Folder Actions Setup and do the same thing as above. The default location of scripts on OS X server is the same, but you can also access them in the Applications->AppleScript->Example Scripts shortcut.

If you want more sources, check out:

and

Or just Google for OS X Folder actions, and I'm sure you'll find plenty other sites offering resources to help you out.



Exchange error c10312e7 when adding a new email address

I was asked to create a new user with an email address on our Exchange server. Sounds simple enough, and I expected it to take all of 2 minutes. However, after I added the user, the email address was different than what I wanted and had a number appended to it (e.g email@email.com was getting set up as email3@email.com). When I manually tried changing the SMTP address value, I received an error c10312e7 "This email address already exists in this organization". I had never set up the user before, and I know I had never used the email address before, yet a search on email addresses didn't help. I turned to Google and found the solution here

1. Open the Active Directory Users and Computers snap-in
2. Right-click the domain and choose Find, or click the domain and go to Action->Find...
3. In the Find: box (which defaults to Users, Computers, and Groups) change that option to be Custom Search
4. To the right of that, in the In: box, change that to be Entire Directory
5. Click on the Advanced tab so you can directly input an LDAP query
6. For your LDAP query, use proxyaddresses=smtp:emailToFind@yourDomain.com
7. Click on Find Now. The results will display at the bottom, and you should find the Object causing you grief

Doing this solved my problem right away. It turns out that prior to my time at the company, someone had created a public folder on the Exchange server, and that folder had the email I was trying to use attached to it. The folder was never used, so I just deleted it and fixed the email address for the user I was creating. Seems like a pretty simple fix to an annoying problem.

I also found KB 280765, which may be an alternative for you if the above doesn't solve your issue.

Monday, March 9, 2009

Outlook appointments off by an hour after daylight savings

Since originally posting this, I figured out something else that helps fix the issue in Outlook 2007. I had a user who had some recurring appointments showing up an hour later than they were supposed to be, but others were appearing correctly. The one thing I noticed about the incorrect appointments is that when I opened the series, it appeared to have time zone information attached, and the Time Zones button appeared as if it was selected in the toolbar. It wouldn't let me click on it to deactivate, but if I click on Recurrence, then clicked OK to get back out without changing anything, the appointment fixed itself. It seems like an odd solution, but it also worked so I can't really complain, and it also deactivated the Time Zones button. If you're looking to mass update your calendar, go ahead and continue to the rest of the post, but the issue causing that type of problem was supposedly handled a while back by a Microsoft update, so you may want to double-check those on your machine as well.

Did you show up to work today to find appointments were off by an hour after the daylight savings change over the weekend? Or maybe it's just your recurring appointments, which seems to be the problem my users are having. I originally went through the DST update for Exchange back when the original start and end dates were changed, but apparently there are still some leftover details to deal with. Luckily Microsoft provides a handy utility for quickly updating appointments. There's also an advanced section which allows you to select to only update recurring appointments. You can download direct from Microsoft at http://www.microsoft.com/downloads/details.aspx?FamilyId=27BB0EE2-03AC-4E5B-AEC5-3E878490FCE1&displaylang=en. Follow the directions to update your calendar to reflect the correct time for your time zone.

If you're an Outlook 2007 user, it actually has an appointment update feature included. You can find it by opening Outlook, then going to Tools->Options, then under the Preferences tab, go to Calendar options, then Time Zones... You can use this to make sure all of your appointments are set up for the correct time zone.

Limiting Control Panel access with group policy

You can manage your users' access to the Control Panel through group policy. You can allow/restrict all, or you can pick and choose individual items for user access. The policy to set is found under User Configuration->Administrative Templates->Control Panel in your group policy object.

If you do want to pick and choose individual control panel items, Microsoft has assembled a quick reference list to all the included .cpl files. You can find that list in KB 149648

Saturday, March 7, 2009

Move file from one Linux machine to another

The cp command is pretty useful, but what if you want to move a file or folder from one Linux machine to another? For that, you're best off using rsync.

rsync -a -e ssh /currentDirectory/ newServer:/newDirectory

This will move your data from the location you specify as the currentDirectory to the newDirectory on the newServer, and also retain the symbolic links between files.

I found the information here

Tuesday, March 3, 2009

Change iTunes account on iPhone or iPod touch

If you have a need to change the iTunes account on your iPhone of iPod touch, Apple has the instructions for you in KB HT1311. I've run into this problem a few times because we've been purchasing iPhones for the employees at work, and everytime I activate the phone to set it up I have to use my computer, which has my iTunes account loaded. Without doing that I'd have to leave it up to the end user, and then wait for them to bring it back so I can set it up for email. As soon as I do that though, then they're stuck with my iTunes account loaded on the phone and can't use the App Store or iTunes without my logon credentials. It sure would be nice for Apple to change that, and to also let you change the iTunes account right on the phone, but it looks like we'll have to settle for this for now. http://support.apple.com/kb/HT1311

If you're wondering how to backup or restore your iPhone or iPod Touch, or need to transfer data from one iPhone or iPod to another, check out my other post.

Monday, March 2, 2009

Use a resource account in Outlook for booking things like conference rooms

First, I'm going to assume that the resource has been set up correctly to automatically accept and reject meeting requests. If you don't know how to do this, I just created a walkthrough for it here.

When creating your appointment/meeting, make sure to book a resource AS A resource. This is something that tends to get overlooked, and adding it to your appointment any other way will defeat the purpose. In order to do this, add your required and optional attendees, and then just like the way you added them, add the resource's account to your meeting in the third box labeled Resources. That is the only way it will perform as an actual resource. Save the meeting and send the invite to the invitees. You should receive one of two messages at this point. The resource will either prompt you and say that it was successfully book, and then you can continue on as normal. Or you will get a message that the appointment was rejected because it conflicts with something else booked with the resource. Either way, this is a nice way to try to avoid conflicting meeting times in a conference room. I'm currently setting one up to accept everything, and it will be used as a time-off calendar for everyone to view. However you use it is up to you, but it's definitely useful to know how to utilize them.

Create a resource account for booking and scheduling in Outlook

If you have conference rooms and rely on your Exchange-based calendar, odds are you already have, or need, resources set up. It will allow people to book resources such as conference rooms, and also help avoid meeting conflicts with those booking. It's actually pretty simple to set up as well.

1. First, set up a user account on your Exchange server for the resource. For this example, I'll use "Main Conference Room". Make sure to create a mailbox for this account, since it will need that to hold its calendar
2. Once the user has been created, you will need to set up a profile in Outlook for that user account.
3. Go into the Control Panel, then into the Mail settings.
4. Click on "Show Profiles...", then click Add. Here you can set up the resource account as a second profile on your machine. If you don't know how to setup the account you'll have to talk to your email administrator because it varies and I'm not going to cover it here. One thing to note is that you can clear the "Cached Exchange mode" box during the setup because you won't need to use that.
5. Once the profile has been created it should show up as an option in "The following profiles are set up on this computer:". Be sure to change the options at the bottom to "Prompt for a profile to be used", or else Outlook will just continue using your personal profile.
6. Open Outlook and when prompted, choose the new profile you created for the resource's account.
7. After the Outlook account for the resource finishes loading, go into Tools->Options...
8. On the Preferences tab, click on Calendar Options...
9. At the bottom, click on Resource Scheduling...
10. Check the boxes you want. The typical configuration is to check the first two so the resource will automatically accept requests if the time is available, and automatically reject any requests that conflict with existing meeting. If you don't want anyone to create recurring meeting requests on the resource, check the third box too.
11. Click OK, which should prompt you with a box that talks about standard permissions. Leave "Set standard resource permissions for all users" checked and click OK. You can uncheck that box and set custom permissions if you want, but that's beyond the scope of this walkthrough.
12. Click OK a few more times to get back to your Outlook window
13. That's it, your resource is set up.

If you want, at this point you can go back into Control Panel->Mail->Show Profiles and change the settings back to the way they were. Delete the resource profile you created, and also set it to always use the default profile.

Now the most important thing to do is make sure your users not how to schedule the resource. To help you with that, I put together a separate post just focused on how to add a resource to a meeting correctly.

I'm currently setting up a resource account to accept everything, and it will be used as a time-off calendar for everyone to view so they know who is in and out of the office. We have plenty of others set up for conference rooms, and also for checking out items such as a projector. However you use them is up to you, but it's definitely useful to know how to create and utilize resources in an Exchange environment.