Pages

Thursday, September 1, 2011

Clear Deleted Item folder from Exchange mailbox with out opening.

 

I could find a script to do this job, this script is utilizing OWA and clearing the Deleted Items folder. For executing this script you may need a account which has rights on all mailboxes from where you want to clear deleted items.

strURL = "http://”ExchangeServer'”/exchange/”E-Mail of the user”/deleted items"
Set objXMLHTTP = CreateObject("Microsoft.XMLHTTP")
objXMLHTTP.Open "DELETE", strURL, False, strUName, strPwd
objXMLHTTP.setRequestHeader "Depth", "infinity,noroot"
objXMLHTTP.Send().

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.

Tuesday, July 19, 2011

Export owner information of folders into a CSV file by using Power Shell command

 

I have been in search of getting a command which help me to find out owner of folders in a share. My ideas was to create a report of folder with owner information so that I can send the report to the owners and ask them to clear it off from the share if not required or get back to me with proper justification why they want to keep it there.

I did lot of search in google Smile but nothing turned, I know there is easy way in powershell. [as you may know Power Shell is the tool which will help you to hack windows]

Lets check how I figured it,

  1. From PS locate the folder.
  2. type ‘Dir |get-acl’ and enter,
    This will list all the folders and files with owner information.
  3. Below command will help you to export the owner information to CSV file.
    dir |get-acl |select-object path,owner |Export-Csv test.csv -NoTypeInformation

How to make USB drive as bootable by using Windows 7

Its nice to know that by only using Windows Media you can convert you Thump dive/USB drive into bootable. Fore performing this you only need Windows 7 Media and a USB drive which is sized above 4 GB.
Trust me its not a big deal and its too interesting.
OK, lets get started..
  1. Connect your thump drive/usb Drive to system.
  2. Run the command prompt as Administrator
  3. From command prompt type ‘Diskpart’ and press Enter.
  4. From diskpart prompt type ‘List disk’ and press Enter. This will list all the drives which is connected to the system, from the screen you can find whether the disk you have just connected is detected by system or not.
    image
  5. Type ‘Select disk 1’ and press Enter. This command will select the disk 1, please get the disk number from ‘list disk’ output.
    image
  6. Type ‘clean’ and press Enter.
    image
  7. Type ‘Create Partition Primary’ and press Enter
    image
  8. Type ‘Select Partition 1’ and press Enter.
    image
  9. Type ‘Active’ and press Enter.
    image
  10. Type ‘Format fs=ntfs’ and press enter.
    image
  11. Type ‘assign’ and press enter to assign a drive letter to the formatted drive.
    image
  12. Type ‘exit’ and press to exit diskpart.
    image
  13. Insert windows 7 DVD into drive and from command prompt go to D:\bootimage
  14. Type ‘Bootsect /nt60 E:’ and press enter.
    In this example the drive is E and please choose drive letter according to your drive letter.
    image
  15. Close the command prompt by typing ‘Exit
  16. Brows Windows 7 Media and copy entire files to the drive E [the drive which we just prepared].
We are done!!
Now boot your system, go to Bios setup and configure the USB as first boot device.

Sunday, July 17, 2011

How to configure connectivity between Exchange 2010 and SAP system

It was a tough job for me to configure a connectivity between Exchange 2010 and SAP system as I am a student in Exchange 2010 Smile.
The requirement was to receive mails in SAP but with out publishing SAP domain. SAP team was not ready to do any configuration change and the request was from high level of the Organization. SAP team just want to receive mails which sent to a particular mail address [User] that means they wanted us to receive mails and forward that to a SAP server to a particular port 250xx. The funniest thing is I was not aware that we can change destination port from settings of a ‘send connector’ Sad smile. Let us check how I did it.
Note;- this method which is mentioned in this article can be used for any destination system where you want forward mail to a particular port.
For getting this happen you have to have some pre-requisites, they are,
1. One user mailbox with proper mail address.
   -This is for receive mails. Set forwarder from the properties to the mail-enabled contact. [Pre-requisites 2]
2. One mail enabled contact
  -This can be used to forward mails to SAP SMTP address.
Create Send Connector
1. Go the EMC from Exchange 2010 server.
2. Brows through and locate ‘Hub Transport’ under ‘Organization Configuration’
image
3. Right click on ‘New Send Connector…’
image
4. Give proper name and click on ‘Next’
note that its recommended to use ‘_’ in the name when you use multiple words in name that will help you when you use EPS
image
5. From next screen, go to Add dropdown and select ‘SMTP Address Space..’
image
6. Enter the destination domain/SAP and click on OK.
Note;- Choose proper cost according to your needs, its recommended to use cost 1 if you don’t have more than one connector to SAP.
image
7. Review the settings that you have just made and click on Next
image
8. From next screen select ‘Route Mail through the following host:’ and click on Add.
image
Enter the destination IP address and click on OK
image
9. Review the settings and click on Next
image
10. Leave it as default and click on Next
image
11. By using ‘Add..’ button add the Hub Transport server/Edge Transport server and  click on Next
image
12. Review the settings and click on Newimage
13. Now you are done with creating a send connector. Click on Finish to complete.
image
Configure send Connector with proper destination SMTP port.
1. Go to EMS from Exchange server 2010.
2. From Shell type below command and press enter.
Note choose the
Get-SendConnector -identity Connector_to_SAP |Set-SendConnector -port 2500
image
3. Use the below command and make sure that SMTP port address is updated,
Get-SendConnector -identity Connector_to_SAP |fl
Send a test mail and track it, trust me you will be happy to read the track log Smile
Note;- If you are confused somewhere in this article then I request you to write the comment, I will be happy to assist you.

Saturday, July 16, 2011

How to list Full Mailbox Access permission assigned

Today I have came up with a situation to generate report and send to higher management. The higher management needs to have a check on all the mailboxes and find out who else has full mailbox permission on xx mailboxes. I had to do a lot of work to consolidate the report but the PowerShell made my life easier to find the information.

In Exchange 2010 its pretty easy to get Full Mailbox information of a mailbox by using command Get-MailboxPermission. Use proper piping so that you can get what ever the result you are looking for.

Let us check with an examples,

eg.1 Get-mailbox –identity “prajeesh” |Get-MailboxPermission

This example will list who ever having permission on the mailbox of user ‘prajeesh’. This produces a long list of permissions – inherited and assigned explicitly to this mailbox.

If you don’t need the list of users who have permission inherited then you can use filter again. Check example 2.

eg 2. Get-mailbox –identity “prajeesh” | Get-MailboxPermission | where { $_.IsInherited -eq $false }

This example will list only the user who got permission particularly on this mailbox. If there is no user who got access in the mailbox level then you get a blank line.

eg 3. Get-Mailbox -Server “server1” | Get-MailboxPermission | where { $_.IsInherited -eq $false }

This example will help you to find permission on the mailboxes which is hosted on the server “server1”, please replace with the exact name of your sever when you try.

eg 4. Get-Mailbox -Server “server1” |Get-mailbox |Get-MailboxPermission |where {($_.AccessRights -eq "FullAccess") -and ($_.IsInherited -eq $false)}

Here we get list of users with only “FullAccess” permission

eg 5 Get-Mailbox -Server “server1” |Get-mailbox |Get-MailboxPermission |where {($_.AccessRights -eq "FullAccess") -and ($_.IsInherited -eq $false)} |Export-Csv Mbxpermission.csv -NoTypeInformation

This example is going export the list to a ‘csv’ file.

You may have question now, how can I export mailbox permission of all users from Exchange 2010 organization. Here you go…

eg 6.  Get-Mailboxdatabase |Get-mailbox |Get-MailboxPermission |where {($_.AccessRights -eq "FullAccess") -and ($_.IsInherited -eq $false)} |Export-Csv Mbxpermission.csv -NoTypeInformation

Friday, July 15, 2011

How to fix 0x80040119 error in outlook

1. Close outlook and OC/Lync

2. Go ‘C:\Program Files\Microsoft Office\Office14’ and run ‘SCANPST’
clip_image002

3. Fro ‘SCANPST’ tool brows and select your .ost file and click on start.
clip_image003

4. Scan will start immediately and show you the progress.
clip_image004

5. Finally the error report will be generated and shown to you. Please make sure that the option for “Make backup of scanned file before reparing” is checked and click on “Repair”
clip_image005

6. Once repair completed tool will be prompted to exit.

7. Open outlook and see the status of the issue.

Note:- if the SCANPST is not helping then request you to download ‘PST File Repair’ tool from below link and try http://www.pstfilerepair.com/download.php.

Tuesday, June 14, 2011

How to troubleshoot 'outlook disconnect automatically' issue

Option 1
-----------
1. Click Start -> Control Panel -> Mail.
2. Click E-mail Accounts.
2. In the E-mail Accounts dialog box, click ‘View or change existing e-mail accounts’ and then click Next.
3. Double-click your Exchange Server account, and then click ‘More Settings’.
4. On the General tab, in the When starting box, please make sure that "Automatically detect connection state" is selected.

Option 2 :
  1. Close outlook
  2. Search for the following four files and rename them by changing the file extension from ".dat" to ".old"
    : outcmd.dat, extend.dat, frmcache.dat, views.dat.
Note: These files are normally located under ‘C:\Documents and Settings\<username>\Application Data\Microsoft\Outlook’ folder.
             In some condition you may not see any file other than Outcmd.dat.

Option 3 : Create a new outlook profile and check the status.

Friday, May 27, 2011

How to update Query Based DL by updating the LDAP query

1.       From AD find where the AD object located.
2.       Go to ADSIEDIT.MSC from ‘Run’.
3.       Brows the object and go to ‘properties’ of the object
4.       Select the attribute ‘msExchDynamicDLFilter’ and click on ‘Edit’.
5.       Edit the vault and save.