Wednesday, November 14, 2012

Exchange Contact Photos GAL

So you may or may not have seen some organisations have Contact Card pictures when you browse the Exchange contact list.

They attach to the users Active Directory username and appear in a few locations, most which are seen in Outlook (Android can also use them when syncing your Exchange Email Account and Contacts).

Above: Hover Contact Card

This is done using a powershell command in the Exchange Console called Import-RecipientDataProperty

To read how to do this manually please visit this Technet Blog on GAL Photos in Exchange.

If you are interested in accelerating the process and prefer to use a GUI I have come across this very neat utility by CJWDEV called AD Photo Edit. There is a free version which allows for single imports (Which is what I use), and a paid version which allows bulk imports.

Above: AD Photo Edit Free Edition

Simply put a name into the search field and click search.

Above: Search Results

Now click on Edit Image

Above: Edit Image Window

Microsoft States that you need to have a MAXIMUM dimension of 96x96 for your Contact Image, fortunately this program has a 'Resize to recommended dimensions' which automatically resizes the image to 96 pixels on the longest side, maintaining aspect ratio. So simply click 'Select New Image' pick your image and then click on 'Resize to recommended dimensions' and click ok.

Above: New Image selected and Resized

Now click on the OK button and the program will resize the image and upload it to the AD database for you!

Above: Confirmation the upload was successful

Now you can go back to Outlook and if you are in non-cached mode the picture will update instantly.

Above: Updated GAL Photo

Now some notes..

- Outlook Cached clients will not see the new photos until you manually update the OAB which can be done using the following PS command.

Update-OfflineAddressBook "Default Offline Address Book"

For more information on this read the section titled "GAL Photos and the Offline Address Book" on the Technet Blog

- If you want to bulk resize without relying on the AD Photo Edit program I recommend Paint.Net with the Bulk Image Processor plugin which will allow you to select all photos and resize in one go.

- If you get any errors to do with thumbnailPhoto properties, please ensure your schema has the correct properties set as per the Technet Blog

Wednesday, May 30, 2012

Windows Server Backup Error code 2155348010

Windows Server Backup is a great basic inbuilt utility to backup your Windows 2008/R2 servers.

But is also just that, as basic utility, it has some smarts, but trips itself up often if the circumstances are right.

Microsoft recommend your backup disks are 150% greater than the data you are backing up so that it can have enough space to create the number of snapshots it wants.

The problem is if you don't have that extra space and you run very close to your disk size, any large change in data will attempt to 'overfill' the disk and the fail due to error.

Now Microsoft don't recommend this solution, however it is a work around :).

Above: Windows Server Backup Disk Usage

As you can see, I have enough room for day to day changes (around 4GB on average), so WSB can recycle the space happily, however recently I moved a VHD from one disk to the other, so suddenly the incremental change was 120GB, which will never fit.

Above: Windows Server Backup Status

 So suddenly I was getting failed backups with the error:

 One of the backup files could not be created. Detailed error: There is not enough space on the disk.  

When this happens you have three choices.
- Buy new, larger backup disks
- Reduce the amount you are backing up
- Try Delete the oldest snapshots off the backup disk.

You know how to do the first two, so lets get on to how to remove the oldest snapshots to give us some more space on the hdd.

Note: Once removed you cannot get them back, so make sure your systems are all in working order, ie do this at your own risk!

We need to start by identifying the backup disk's UID. To do this we open command prompt and run mountvol with no switches.

 Creates, deletes, or lists a volume mount point.  
 MOUNTVOL [drive:]path VolumeName  
 MOUNTVOL [drive:]path /D  
 MOUNTVOL [drive:]path /L  
 MOUNTVOL [drive:]path /P  
   path    Specifies the existing NTFS directory where the mount  
         point will reside.  
   VolumeName Specifies the volume name that is the target of the mount  
   /D     Removes the volume mount point from the specified directory.  
   /L     Lists the mounted volume name for the specified directory.  
   /P     Removes the volume mount point from the specified directory,  
         dismounts the volume, and makes the volume not mountable.  
         You can make the volume mountable again by creating a volume  
         mount point.  
   /R     Removes volume mount point directories and registry settings  
         for volumes that are no longer in the system.  
   /N     Disables automatic mounting of new volumes.  
   /E     Re-enables automatic mounting of new volumes.  
 Possible values for VolumeName along with current mount points are:  
     *** NO MOUNT POINTS ***  
     *** NO MOUNT POINTS ***  

The bottom section is what we are interested in. Most particularly the Volumes with '** NO MOUNT POINTS **, as the backup disk does not get mounted with a drive letter.

I'm not sure why, I'm sure someone could fill me in though, the System Drive is always listed twice, one with a drive letter and one without.

The disk we are looking for is the 3rd disk down, which has a UID different to the others. The information we need is the entire string: \\?\Volume{0de85de0-9849-11e1-ae67-00259049b4c2}

Now the next command is for the actual deletion of the snapshots.

For this we use a builtin utility called 'DISKSHADOW', simply type this into a command prompt to enter the utility.

Now type delete shadows OLDEST -VolID-

which in the examples case would be:
delete shadows OLDEST \\?\Volume{0de85de0-9849-11e1-ae67-00259049b4c2}

When run you should see something similar to:

 DISKSHADOW> delete shadows OLDEST \\?\Volume{0de85de0-9849-11e1-ae67-00259049b4c2}  
 Deleting shadow copy {47c0fd32-c3e9-4c66-8481-2ac004b6d2ff} on volume \\?\Volume  
 {0de85de0-9849-11e1-ae67-00259049b4c2}\ from provider {b5946137-7b9f-4925-af80-5  
 1abd60b20d5} [Attributes: 0x00020019]...  
 1 shadow copy deleted.  

Now when you look back at your Windows Server Backup:
Above: Windows Server Backup Disk Usage

You are actually able to delete all the shadow copies on the disk, so that only one copy remains if you wish. But again be certain you don't need to go back in time to retrieve this data!

So use all of this information at your own risk, but if this is what you were searching to do, that's how to you it :)