Monday, November 30, 2009

Update all address lists in Exchange 2007

We are very close to getting the Last Exchange Server 2003 decommissioned. Long process, will write about it when I get some time.

I used the this link to get some info about upgrading the Address Lists to Exchange 2007, finally ended up using PowerGUI with Exchange PowerPack to perform the actual task. Anyways after the filters were corrected for each department by using

(Department –eq ‘Department Name’ -and RecipientType -eq 'UserMailbox')

Users were still seeing the old entries in the address lists in outlook because the lists had to be update or refreshed in Exchange 2007.  To update one address list only you can use the following cmdlet in EMS

Update-AddressList -identity ‘list name’

To update all address lists use the following

Get-AddressList | Update-AddressList

Love the power of Exchange Management Shell and PowerShell!!!

Sunday, November 29, 2009

BlackBerry Server MAPI Connectivity Issue

 

When trying to resolve the Exchange server profile on BlackBerry server following error appears

“The name could not be resolved. Network Problems are preventing connection to the Microsoft Exchange Server computer. Contact your system administrator if this condition persists.”

image

This could be caused due to many reasons, but one that I would check the last (not even that) caused it on our BlackBerry server.  When BlackBerry server is installed and for the first time MAPI connectivity is established through Exchange Collaboration Data Object, it uses a Global Catalog server to authenticate. If GC role is seized from that server, above issue occurs.

To fix it I had to enable the GC role again on the same server and it started to work fine. I tried a few registry tweaks to get the BlackBerry server to find nearest GC with no success. Will try to find a better fix, meanwhile if you have any suggestions please comment.

User with no mailbox appears in Global Address List (GAL)

 

This might happen when you copy a user account in Active Directory. If the template account had a mailbox and the newly created account doesn’t have a mailbox.

Active Directory still copies the Exchange Attributes and that is why the newly created account which doesn’t have a mailbox or email address appears in the Global Address List.

image

To fix it : -

  • Open ADSI Edit
  • Look for the account and open its properties
  • In the Attribute Editor find showInAddressBook
  • Click Edit and remove all entries.

image

Friday, November 27, 2009

Uninstall Software From Remote Workstations

To have the ability to uninstall a package/program on a remote computer can be very useful for Systems Administrators and Helpdesk. Following is how you can accomplish it. You can write a batch file that can uninstall a certain software from multiple computers. 

It will require three things.

  1. MsiZap.exe
  2. PSTools – psexec.exe
  3. GUID of the software you need to uninstall

1. –> Microsoft has a tool called MsiZap.exe, for details check the following link

http://msdn.microsoft.com/en-us/library/aa370523%28VS.85%29.aspx

To acquire this tool download Windows Installer Cleanup and open it with 7zip. MsiZap has two versions MsiZapA.exe (for use in Windows 95, Windows 98 and Windows ME), and MsiZapU.exe (for use in Windows NT, Windows 2000, Windows XP, and Windows Server 2003). Extract the one you need and rename it to MsiZap.exe.

2. –> I use PSTools regularly, you can download it and extract it in “%windir%\System32” so it can be used in command prompt anywhere.

3. –> Okay now we have all the tools we need, but we still need the GUID. To find that you can create a batch file with the following command

for /f "tokens=7 delims=\" %%a in ('reg query hklm\software\microsoft\windows\currentversion\uninstall ^| FIND "{"') do for /f "tokens=2,*" %%c in ('reg query hklm\software\microsoft\windows\currentversion\uninstall\%%a ^| find /i "DisplayName"') do echo %%d,%%a>>c:\GUIDProgsList.txt

--> Now run this batch file using psexec on a remote computer

psexce –cds \\computername “path\batchfile.bat”

you will have GUID for all installed software appended to a file called GUIDProgsList.txt on the C drive of the remote computer.  You can also get this list by going to the following registry manually.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\

Uninstalling a program remotely

If you have followed the above steps correctly then all you need is to run the following command.

psexec.exe -cd \\computername "path\MsiZap.exe" TW {GUID for the Program to be removed}

Following is an example of removing 7zip from a computer name nyclient01.

psexec.exe -cd \\nyclient01 "path\MsiZap.exe" TW {23170F69-40C1-2701-0457-000001000000}

________________

Word of caution: – MsiZap is powerful commandline tool, use carefully. Always test first.

Thursday, April 2, 2009

Split Mail merge in to separate documents and save as PDF

If you are using mail merge in Microsoft Word and sending letters to many people (not emails), the last step of merging does not provide an option to split each letter in to a separate file.

Well, following is a detailed guide on how to split merge into separate documents or PDF files. It requires installing an Add in to be add to Microsoft Word.

http://www.gmayor.com/individual_merge_letters.htm

and when you use it to split each merged letter into separate document, the above puts an extra line in each document. For some of you it might not be a problem but that one extra page at the end of a document can cost most people several hours.

So here is the Fix

I assume that you have already used the above to split the merge letters into separate files in a folder. Following is what you need to do to get rid of that one extra page at the end of each document.

1. Close the actual mail merge document.

2. Select all the documents in the folder and press enter to open them, you might get the following notification depending on the number of documents (if there are too many documents, I suggest you select only what your hardware can handle at a time)









3. After all the documents are opened, go to Tools > Macro > Macros > click on Create button and paste the Following Code in the right side panel as shown in the figure below and Close Microsoft Visual Basic.






















Sub RemoveExtraPage()
'
' RemoveExtraPage Macro
' Macro recorded 01-Apr-09 by Bhojraj Parmar
'
Selection.MoveDown Unit:=wdScreen, Count:=2

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^b"
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False

End With
Selection.Find.Execute
With Selection
If .Find.Forward = True Then
.Collapse Direction:=wdCollapseStart
Else
.Collapse Direction:=wdCollapseEnd
End If
.Find.Execute Replace:=wdReplaceOne
If .Find.Forward = True Then
.Collapse Direction:=wdCollapseEnd
Else
.Collapse Direction:=wdCollapseStart
End If
.Find.Execute
End With
Selection.EndKey Unit:=wdStory
Application.Keyboard (1025)
Selection.RtlPara

ActiveDocument.Save
End Sub

Sub FixAllDocs()

For Each sDocument In Application.Documents

sDocument.Activate
RemoveExtraPage
sDocument.Close


Next

End Sub


4. Now go to Tools > Macro > Macros and look for FixAllDocs







5. Select it and click on Run


You now have all the documents saved and closed and the extra page from all the opened documents was removed.