Friday, 27 January 2012

Find email addresses in Exchange 2010



The quickest and easiest way to work out who (or what) is using an email address is to open up a PowerShell command window and run: 


get-recipient -results unlimited | where {$_.emailaddresses -match "address@company.com"} | select name,emailaddresses,recipienttype


for full details on the result, try 


get-recipient -results unlimited | where {$_.emailaddresses -match " address@company.com "} | fl



Sunday, 1 January 2012

thumbs.db can't be deleted because it's in use

If you are like me, you keep all your media on a network drive.
In what it thinks is an aid to productivity, Windows 7 (and Vista) will go to these network drives and automatically create a hidden file called thumbs.db which contains a thumbnail image of every media (video or photo) file. Naturally this takes time if you have hundreds of images or some large videos, and I often try to delete the directory before the thumbs.db have finished being created... and get an annoying error message saying that the file can't be deleted as it's still opened by another application.
You can turn off the generation of this file by going:

Start > Run > Gpedit.msc

User Configuration > Administrative Templates > Windows Components > Windows Explorer > Turn off caching of thumbnail pictures in hidden thumbs.db> Enabled



I hope this proves helpful... if it does, please click on an ad to show your appreciation.

Thursday, 8 December 2011

Expanding a LVM linux partition

Linux is something of a black art to me, so when I was required to resize a Centos (RedHat) virtual machine's hard disk, it took quite a bit of effort to do. As a Windows person I was very disappointed that I had to jump through so many hoops.

First I though I'd just boot up off a GParted ISO and resize it like I would do with any other machine.. only to find out that it didn't support LVM... and just refused to go any further.
So.. here's how to do it...

Assuming you have already expanded the Virtual HDD in VMware.

1 Log on to the VM as root

Let's not mess around with SU and all that business, we're doing some pretty dangerous stuff here, and we should know what the risks are!

2 Open a command prompt


df
Filesystem           1K-blocks      Used Available Use% Mounted on /dev/mapper/VolGroup00-LogVol00
                      26377276   3810884  21204884  16% /
/dev/sda1               101086     19650     76217  21% /boot
tmpfs                  1544956         0   1544956   0% /dev/shm

The 26377276 references the old size of the HDD. It's 30GB actually but after formatting etc it comes to 26Gb

Make a note of the Volume Group name /dev/mapper/VolGroup00-LogVol00, you're going to need it later.

3 Create a new partition that will contain a new physical volume

Run the print command to view the partitions


parted /dev/sda print


Model: VMware Virtual disk (scsi)
Disk /dev/sda: 64.4GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      32.3kB  107MB   107MB   primary  ext3         boot 
 2      107MB   32.2GB  32.1GB  primary               lvm  

You can see that I have a 64.4GB HDD but the partitions only extend to 32.2GB... so I have loads spare.
I need to create a new primary partition to use this space:

parted /dev/sda "mkpart primary 32.2GB 64.4GB"


Do another print to check you now have a new partition

parted /dev/sda print

Model: VMware Virtual disk (scsi)
Disk /dev/sda: 64.4GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      32.3kB  107MB   107MB   primary  ext3         boot 
 2      107MB   32.2GB  32.1GB  primary               lvm  
 3      32.2GB  64.4GB  32.2GB  primary                    

OK, that looks good!


4 Create a new physical volume

We need to create a new physical volume. Let's look at what we already have:

lvm pvs
  /dev/hda: open failed: No medium found
  PV         VG         Fmt  Attr PSize  PFree
  /dev/sda2  VolGroup00 lvm2 a-   29.88G    0 

OK, so I already have /dev/sda2, so let's call the new one /dev/sda3 

lvm pvcreate /dev/sda3
  Physical volume "/dev/sda3" successfully created

and let's check that it was created properly

lvm pvs
  /dev/hda: open failed: No medium found
  PV         VG         Fmt  Attr PSize  PFree 
  /dev/sda2  VolGroup00 lvm2 a-   29.88G     0 
  /dev/sda3             lvm2 a-   30.00G 30.00G

Hey.. that looks good..it even shows that I have 30GB free!


5 Add this new physical volume to the volume group

lvm vgextend VolGroup00 /dev/sda3
  Volume group "VolGroup00" successfully extended

   
6 Extend the logical volume in the volume group

Running the lvm vgdisplay command allows us to see the Free PE statistics. I want to use all this space, so make a note of it.

lvm vgdisplay VolGroup00
  --- Volume group ---
  VG Name               VolGroup00
  System ID             
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               59.84 GB
  PE Size               32.00 MB
  Total PE              1915
  Alloc PE / Size       956 / 29.88 GB
  Free  PE / Size       959 / 29.97 GB
  VG UUID               doO2t7-BlLf-1rW5-mbNU-zvUq-pzUb-ZAsBD4

The lvm lvextend command expands the logical volume. The /dev/mapper/VolGroup00-LogVol00 comes from step 2... I told you to remember it!

lvm lvextend -l+959 /dev/mapper/VolGroup00-LogVol00
  Extending logical volume LogVol00 to 55.94 GB
  Logical volume LogVol00 successfully resized


7 Resize the file system

After extending the volume group and the logical volume, it is now possible to resize the file system. This is done using ext2online. First I verify the file system size, perform the resize, and then verify the size again.

df -h 
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       26G  3.7G   21G  16% /
/dev/sda1              99M   20M   75M  21% /boot
tmpfs                 1.5G     0  1.5G   0% /dev/shm

resize2fs /dev/mapper/VolGroup00-LogVol00

df -h 
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       55G  3.7G   48G   8% /
/dev/sda1              99M   20M   75M  21% /boot
tmpfs                 1.5G     0  1.5G   0% /dev/shm


Congratulations, you have resized your hard disk!

I hope this helps you out.. please click on an advert to show your thanks.

Tuesday, 29 November 2011

Backing up Ex2010 mailboxes to PST

Exchange 2010 SP1 has a new command to import and export to a PST.


First you need to give yourself permissions to do this with the following command:


New-ManagementRoleAssignment –Role “Mailbox Import Export” –User “<username>”


You will need to close down and open up the console again to gain access to the commands below.


Then you need to run the following to actually Export for a PST


New-MailboxExportRequest -Mailbox user@domain.com -FilePath \\path\to\file.pst 


You can check on the progress of the backup with:


Get-MailboxExportRequest


You can clear any old Mailbox requests with:


Remove-MailboxExportRequest -Identity "username\MailboxExport"


Very simple!

Thursday, 13 October 2011

Configuring Room Finder Lists in Exchange 2010

Outlook 2010 and Exchange 2010 make booking resources like Meeting Rooms much easier.
We all know that you can invite a resource mailbox to a meeting to reserve it for your use, but Outlook 2010 allows you to view which meeting rooms are available at a particular time.


To group resources together, fire up Exchange Management Shell and type:

New-DistributionGroup -Name “Head Office Meeting Rooms” -Members "Meeting Room #1","Meeting Room #2","Meeting Room #3" -RoomList

I hope this tip helps you, please click on an advert to show your appreciation.

Tuesday, 6 September 2011

Microsoft seem to make every effort to hide the Google Search provider for IE9 - here's the direct link:

http://www.microsoft.com/windows/ie/searchguide/en-en/default.mspx#


Friday, 26 August 2011

Changing the default User and Computer OU

I like to keep my "Real" Users in a separate folder away from all the other system accounts. This ensures that only valid accounts are displayed if you use LDAP lookups for various applications (e.g. a network scanner)


Windows 2003 introduced a couple of new commands that allow you to change the default location:


Users:


   ReDirUsr "OU=RealUsers,DC=domain,DC=com"


Computers:


   ReDirCmp "OU=RealComputers,DC=domain,DC=com"


You need to run this on a Domain Controller, and you need the AD to be in Windows 2003 mode as a minimum.


As you want to ensure the path to the new directory is correct, I recommend Softerra LDAP browser (it's free) which allows you to connect to the AD with LDAP and copy object locations.


I hope this helps you out...please click on an advert to show your appreciation.