Pages

Monday, August 22, 2011

Delete empty directories by using PowerShell script

It was interesting to create a script for finding empty folder under file share and delete with creating a log of directories.

##########################################################################
#Purpose of this script is to find blank folders from particular location
#and report into a text file and delete.
#Version - 1
#Auther - Prajeesh
##########################################################################

$date = ( get-date ).ToString('yyyyMMdd-HHmm')
$items = Get-ChildItem ‘\\Server1\Operations\2006’ -Recurse
foreach($item in $items)
{
      if( $item.PSIsContainer )
      {
            $subitems = Get-ChildItem -Recurse -Path $item.FullName
            if($subitems -eq $null)
            {
               $item.Fullname | Out-File -FilePath C:\Users\Prajeesh\Desktop\"EmtyFolder-$date.txt" -Append
                "Remove item: " + $item.FullName
                  Remove-Item $item.FullName
            }
      }
}

 

Just copy paste above script into a PowerShell Editor and edit locations [where to scan and where to store the log file] save file as ps1 and execute.

Monday, August 1, 2011

How to reset Enterprise Vault Cache from outlook 2003 and 2010

This post has 2 sections, section 1 talks about how we do it from Outlook 2010 and Section 2 talks about how we do it from Outlook 2003. This article can be used when you see your EV cache is not syncing due to ‘x’ reasons.

I. Reset Vault Cache from Outlook 2010.

1. Open Outlook

2. Hold the Ctrl+Shift keys and click on any of the EV icons on either, refer below screenshot
clip_image001
This will launch the EV Diagnostics window ,

3. From ‘Enterprise Vault Diagnostic’ window click on ‘Reset’ icon under Vault Cache.
clip_image002

4. Click on ‘Yes’
clip_image004

5. Click on OK
clip_image006

6. Close ‘Enterprise Vault Diagnostic’ window by clicking on OK .

7. Restart Outlook and check the status.

II. Reset Enterprise Vault Cache from Outlook 2003.

1. Open outlook 2003

2. Hold CTRL + SHIFT and click on an EV button in Outlook
clip_image008

3. Click on the button to reset the offline vault.
clip_image009

4. Respond Yes to the warning message

5. Close outlook.

6. Open outlook and see the status.