Thursday, October 31, 2013

Convert user mailbox to resource when using Exchange Online

I am in the middle of a cutover migration from an Exchange 2003 environment to Exchange Online. One issue with the cutover is that all our resource mailboxes were imported as user mailboxes, rather than resources. Luckily, using PowerShell, it is easy to convert these and I only had ~10 so it was easy enough to do. If you have a lot of resource mailboxes to convert you may want to script it instead. Anyway, here are the instructions which I originally found from here:

1. Connect Windows PowerShell to the Service. Refer to the article below.

2. Run set-mailbox mailboxName -type room, substituting your specific mailbox name in for mailboxName, and also specifying either room OR equipment. The example is to convert to a room resource

Friday, October 25, 2013

Cannot get mail connection to server is unavailable error on iOS device

The typical answers to this would be verify your username/password/server address, and make sure you have an active data connection and can access the server. However, I'm posting this because I ran across a very odd solution to this error message when those first two failed.

I had a user who could not receive any new emails on her iPhone 5 through an Exchange ActiveSync connection, yet she could send and also had the contacts and calendar working fine. It happened out of nowhere and I was able to replicate the issue on a 2nd iPhone. No other users were reporting issues, and the user's email was working fine in Outlook and OWA. It was very odd.

After doing some extensive troubleshooting I finally tracked down the issue and decided to post it in case anyone else runs across the same problem and is scratching their head. The user had used an emoticon when sending an email, and had two replies to that message in her Inbox. However, that emoticon had gotten corrupted on the receiving end, so when sent back to her in the reply it actually made the messages unreadable on the iPhone and prevented any newer emails from being downloaded as well. As soon as I removed those 2 emails from the Inbox, the iPhone began working correctly again.

Thursday, October 3, 2013

Error while trying to export to PST using Export-Mailbox on Exchange 2007

This is probably valid for more than just Exchange 2007, but that's the version I was working on where I ran into the problem. After finally getting myself setup with a machine running a 32-bit Windows OS, and with both Exchange Management Tools and Outlook 2007 installed, I tried running my Export-Mailbox command. No go, and in checking the migration log file the error looked something like:

Error was found for user1 ( because: Error occurred in the step: Moving messages. Failed to copy messages to the destination mailbox store with error: 
MAPI or an unspecified service provider.
ID no: 00000000-0000-00000000, error code: -1056749164

I scratched my head on this one for a while after the Google results for the error code didn't show any results. Luckily my brain still works without Google (kind of...) and I had to smack myself a little for how simple the fix was. I didn't have full access to the mailboxes I was trying to export with the account I was logged in with! Once I realized that I simply ran

Add-MailboxPermission -Identity user1 -User myaccount -AccessRights FullAccess

Once that was done I tried my Export-Mailbox command again and viola! Exporting to PST files from the Exchange 2007 information store worked as expected.

Thursday, August 22, 2013

Windows Search Companion pane is blank

If you run into this, the likely cause is that the jscript.dll file is not registered correctly. To fix, simply go to Start->Run, then use the command "regsvr32.exe %windir%\system32\jscript.dll" and click OK. You should get a pop-up saying that the DLL was successfully registered, then try using search again.

Outlook Web Access (OWA) shows requested resource is in use page

I don't like admitting this, but I'm still stuck supporting an Exchange 2003 environment. Yes, it's over 10 year old software, but it is what it is. With that out there, I had a problem today with my Exchange 2003 box after a power outage. Outlook Web Access, aka OWA, was showing a page that said "Requested resource is in use" if anyone tried to use it. I didn't see anything obviously wrong, and other Exchange functionality was working fine, so I turned to the web.

The fix was very simple. A dll file that OWA depends on was not registered properly. To fix the problem all I had to do was go to Start->Run, then use the command "regsvr32 %windir%\system32\vbscript.dll". You should get a pop-up alert that the DLL was registered succesfully after you run that command, and OWA will come back to life.

Wednesday, July 17, 2013

Deploying Windows 8 using the Windows ADK and WinPE

After spending a chunk of today trying to get imaging and deployment of Windows 8 figured out I decided it was worth a post since the scripts Microsoft provides are either slightly incorrect or missing information. I started out with this TechNet article and this other, then built the final solution from there.

First, use the article to get the Windows ADK, which will allow you to create bootable WinPE media. You can either create a bootable USB device like the article states, or create an iso image file that can be burned to a CD. Personally I prefer CD because it seems to be the most compatible since everything can boot from CD, but not everything likes booting from USB. To create the iso file instead of the USB in their step 1.3, use the command MakeWinPEMedia /ISO /C:\winpe_amd64 C:\winpe.iso. That will create the ISO file named winpe.iso in the root of the C drive using the directory located at C:\winpe_amd64. If you want to change those paths, feel free, especially for the location of the iso file.

From this point on I was able to capture the system image using the directions outlined in the TechNet article, so refer to that for image capture.

Deployment is where I started running into problems. I have a pile of cheap Dell Inspirons, and they were using UEFI booting. I'm not going to get into MBR/BIOS since I didn't deal with that and don't know if the article is correct, but the scripts provided for the UEFI option need some tweaking.

For the create partition script, use the script below instead of what Microsoft provided. I have bolded the changes I made. For the line with shrink minimum, adjust this so it's big enough to hold your system image. 14GB is what they have it set to, and my image came out to just over 7 so if I didn't adjust it I would've wasted 7GB of hard drive space.

rem These commands are used with DiskPart to
rem erase the drive and create five partitions
rem for a UEFI/GPT-based computer.
rem Adjust the partition sizes to fill the drive as necessary.
select disk 0
convert gpt
rem === 1. Windows RE tools partition ===========
create partition primary size=300
format quick fs=ntfs label="Windows RE tools"
assign letter="T"
set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
gpt attributes=0x8000000000000001
rem === 2. System partition =====================
create partition efi size=100
format quick fs=fat32 label="System"
assign letter="S"
rem === 3. Microsoft Reserved (MSR) partition ===
create partition msr size=128
rem === 4. Windows partition ====================
rem ==    a. Create Windows partition =========== 
create partition primary 
rem ==    b. Create space for recovery image ====  
shrink minimum=10000
rem ==    c. Prepare the Windows partition ====== 
format quick fs=ntfs label="Windows"
assign letter="W"
rem === 5. Recovery image partition =============
create partition primary
format quick fs=ntfs label="Recovery image"
assign letter="R"
set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
gpt attributes=0x8000000000000001

You can name that CreatePartitions.txt as suggested, or use your own file name. Make sure you copy it onto a USB drive or something that is accessible to the machine you will be deploying the image to. You can use the instructions in the TechNet article to run this script (e.g. diskpart /s E:\CreatePartitions.txt if the script file is saved on something mapped to the letter E).

Now, for the batch file that actually deploys the image you need to make a few tweaks to this as well to get it to work. Use the below

rem These commands use the specified Windows image file 
rem to deploy Windows, system, and recovery tools 
rem to a UEFI-based computer.

rem Usage:   ApplyImage WimFileName 
rem Example: ApplyImage E:\Images\ThinImage.wim

rem === Apply the image to the Windows partition ========
dism /Apply-Image /ImageFile:%1 /Index:1 /ApplyDir:W:\

rem === Copy tools to the Windows RE Tools partition ====
md T:\Recovery\WindowsRE
copy W:\windows\system32\recovery\winre.wim T:\Recovery\WindowsRE\winre.wim

rem === Copy boot files to the System partition =========
W:\Windows\System32\bcdboot W:\Windows /s S: /f ALL

rem === Set the location of the WinRE tools =============
W:\Windows\System32\reagentc /setreimage /path T:\Recovery\WindowsRE /target W:\Windows

rem === Create the recovery image =======================
Mkdir R:\RecoveryImage
Copy %1 R:\RecoveryImage
W:\Windows\System32\reagentc /setosimage /path R:\RecoveryImage /target W:\Windows /index 1

To actually have the system partition recognizable as UEFI you need to add the /f ALL to the bcdboot command. Also, they made a bad typo in the very last line by getting the drive letters mixed up. They have it as T in their script, but it needs to be R.

With those few changes I was able to successfully deploy Windows 8 just like I had been doing for Windows 7 machines using WinPE and imagex.exe. Hopefully this will save you from trying to figure out what is wrong with the scripts Microsoft provides. I did send them feedback outlining the mistakes, but whether or not they'll actually update it is yet to be seen. Good luck with your deployment!

Wednesday, May 22, 2013

Remotely enable Remote Desktop

I've had a few instances where, for whatever reason, remote desktop has been disabled on machines I manage. This can be quite a pain when you don't have someone onsite at that location who can turn the service back on. However, if the proper services are running you can get remote desktop working from your remote location without rebooting the computer. I originally found this article, but added in the extra steps in the beginning to avoid any need to reboot.

To get started, go to Start and right-click on Computer, then choose Manage. Right-click on Computer Management at the top and select Connect to another computer... Enter in the computer name for the computer you need to enable remote desktop services for. This will connect you to the management console for that remote computer. If you cannot get into the management console, you can still try changing the registry with the steps below with the hopes that the services are already running, but by using the management console you can verify the services are running.

Once the management window opens for the remote computer, go to Services and Applications->Services. Scroll down to Remote Desktop Configuration. Now, verify that the following services show Started under the Status column: Remote Desktop Configuration, Remote Desktop Services, Remote Desktop Services UserMode Port Redirector, and Remote Registry. If any of them do not show Started, right-click on that service and choose Start

After those four services have been started, open Registry Editor (this is where this article comes in) by typing regedit into the Search bar, or into the Run box if you're using Windows XP/Server 2003. Once the Registry Editor is open, click on File->Connect Network Registry, enter the remote computer's name, and click OK. This should get you access to the registry on the remote computer. Navigate to HK_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server. Once there, double-click on fDenyTSConnection and change the value to 0 and click OK. This will allow terminal server connections on the remote machine. That should be it. Try to access the remote machine using remote desktop now and it should connect. If not, try rebooting the remote machine using the command prompt with the command: shutdown -r -m \\computername

Tuesday, May 7, 2013

Repair a corrupt Recycle Bin in Windows

If you've ever run into a problem where you get an error when emptying your Recycle Bin on a Windows computer, it can be very annoying. I hate seeing anything in that trash can icon and try to keep it empty all the time. If you're having similar problems, try this to reset your Recycle Bin. I originally found this post, then added in the option for XP and Server 2003.

For XP and Server 2003 go to Start->Run, type cmd and Click OK. If you're on Vista, Windows 7, or Server 2008, go to Start, type cmd in the search box, then right-click Command Prompt and select "Run as Administrator".

Once the command prompt is open type the following command corresponding to your operating system and press Enter

For XP/Server 2003: rd /s /q C:\Recycler

For Vista/Windows 7/Server 2008: rd /s /q C:\$Recycle.bin

This will delete the Recycle Bin folder from your machine, effectively getting rid of whatever problem files are creating the issue not allowing you to empty the Recycle Bin. Once you've done this you can add something new to the Recycle Bin and Windows will create a new version of the folder so you can once again clean up your junk files.

Wednesday, April 17, 2013

Search Active Directory for email accounts that are being forwarded elsewhere

I was asked by a member of the management team to shut off the email forwarding for all ex-employee accounts that were going to this particular person. Rather than go through all Active Directory user accounts to check whether forwarding was on or not, I did a quick online search and found an easy way to use an LDAP query to list only the accounts I needed to check. The original post is here

I'm still stuck with Exchange 2003, so here were the steps:

1. Open Active Directory Users and Computer
2. Right-click on your domain and choose Find
3. In the Find dropdown, change it to Custom Search
4. Go to the Advanced Tab
5. In the "Enter LDAP query" box, type (objectClass=*)(altrecipient=*) then click Find Now

The results will be all users that have email forwarding turned on. Please check the original post if you're looking for how to do this with Powershell in Exchange 2007. I'd guess it'll work the same in 2007 and newer versions

Friday, April 12, 2013

Outlook "Cannot copy or move because it contains private items" error

Update 3/25/15

I can't believe it's been almost 2 years since this was posted. Since the original post I've had mixed luck with this method, which has led me to believe the original is not necessarily a fix. However, I have not seen this error when I log in as the actual user, which is because the user has access to everything within its mailbox. I've been backing up the mailboxes this way and it works fine.

1. Assign license to user account (if one isn't already assigned)
2. Reset the user account password so you have the login info
3. Enable login for the user if you had previously disabled it
4. Convert the mailbox back to a regular mailbox if you had made it a shared mailbox
5. Set up an Outlook profile with the user account info, making sure to turn off Cached Exchange mode
6. Open Outlook with the profile and login
7. Export to PST from within Outlook
8. Remove the profile from Outlook
9. Delete the user account from O365
10. Repeat for other user accounts you want to back up and remove

Of course you should modify those steps for your own needs (e.g. only delete the user account if you actually want to), but in general you can get around the private items error this way. If you're trying to do this for an active user you'll have to work with the user to have them login to his or her mailbox so you can run the export.

Original post 4/12/13

I ran into the "Cannot copy or move because it contains private items" error today while trying to copy a folder from an ex-employee's mailbox to the mailbox of the person taking over that ex-employee's duties. Being the admin I thought it was kind of an odd message to run into, but taking to Google I had an answer within a minute:

Apparently the same error doesn't happen if you use drag-and-drop rather than copy/paste. if you want to copy the folder, you can hold Ctrl and click on the folder, then drag it to the mailbox you want to copy it to.

If you're looking to move the folder rather than copy, then click and drag-and-drop without holding the Ctrl key.

Worked like a charm for me. The KB references Outlook 2002 and 2003, but I'm running Outlook 2007 and saw the same issue and that same fix worked for me.