Thursday, May 23, 2013

Immediate alerts not working on a list/document library

There are various issues with the sharepoint alerts.
Problem 1: Not a single site sends the alerts.
Problem 2: A specific site fails to send the alerts
Problem 3: A specific user fails to receive the alerts

Problem 1:Not a single site sends the alerts.
After registering for alerts on a SharePoint list/document library, you get the welcome email "You have successfully created an alert for 'doc lib' ". But you will never get the actual alert mail for the changes on the document/item you marked for an alert.
Reason:
There is a config/environement change that was not reflected into the config database or config cache.
Fix:

  1. Stop the WSS Sharepoint timer service
    start -> admin tools -> services -> Windows Sharepoint Services timer -> stop.
  2. delete the un used Alternate Access Mappings(CA-> Operations -> Alternate Access mappings), un used IP configurations, orphans in the DB.
  3. Clear the config cache.
    - Go to the local sharepoint config files folder:
    C:\Documents and Settings\All Users\Application Data\Microsoft\SharePoint\Config\ConfigDB ID
    - Delete all the XML files and do not delete the "cache.ini" file.
    - Delete all the numbers in the "cache.ini" , type 1 and save it.
  4. Start the WSS Sharepoint timer service
    start -> admin tools -> services -> Windows Sharepoint Services timer -> Start.
  5. Check whether the timer job is successful or not. Also see the Immediate alerts status.
    CA -> Operations -> Timer Job Status
  6. Check whether the 'alerts' is configured in Minutes :
    A -> Operations -> Timer Job definitions.
  7. Some times there will be a problem with the mail provider settings.Check the SMTP Relay settigns to see the IP Address configured properly.
Problem 2:A specific site fails to send the alerts
Reason:

There is a config/environment change in a specific site. In other scenarios, if a site is migrated from different environment or another version. So, you do not get alerts on that specific site.
Fix:
  1. (Do this step if your environement is flexible)
    Create a new web application/new content database and test for the alerts. On success, move this perticular problematic site to the new web application/content database.
  2. Force the "alerts enabled" command on the perticular site.
    C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN> stsadm.exe -o setproperty -pn alerts-enabled -pv "true" -url http://sitename/.
    You will be fine.
Other commands:
Though you can do all these below commands through CA UI, STSADM is preferred.
  1. To verify whether a site has the alerts enabled:
    Stsadm.exe-o getproperty -url http://sitename/ -pn alerts-enabled
    This will return Yes or No.
  2. To disable alerts on a site:
    stsadm.exe -o setproperty -pn alerts-enabled -pv "false" -url http://sitename/
  3. Verify the job-immediate-alerts. Should be every 5 minutes.
    stsadm.exe -o getproperty -url http://sitename/ -pn job-immediate-alerts
  4. If the above command returns any thing other than "Every 5 minutes between 0 and 59", set the time
    stsadm.exe -o setproperty -pn job-immediate-alerts -pv "every 5 minutes between 0 and 59" -url http://sitename/
Problem 3: A specific user fails to receive the alerts
Reason:
There must a problem with the registered email id. Or user might not have at least "read" access on the document library.
Fix:
  1. Check for the user access on the doc library. If not, add the user with at least "read" access.
    It may happen that the user gets the initial mail. Coz, initial mail doesnt look for the permissions before sending the mail.
  2. While configuring, use the "email id" instead of the usual "Domain\Name". If succeeded, then there must be a problem with the email id registered.
  3. To confirm the email not in sync,
    SQL -> Associated Content Database -> Tables -> ImmedSubscriptions -> email field.

Thursday, April 11, 2013

How to Copy an Assembly From the GAC to the File System

Sometimes you need a local copy of an assembly from the GAC and here is a quick tip on how to do it. The GAC can be found in the c:\windows\assembly directory, but if you try to browse it, the following custom shell extension appears:

image

This view does not provide the ability to copy assemblies, but it does provide some very useful information such as the strong name details. Here are some options to get around that feature to copy an assembly from the GAC.

Option 1: Disable the Shell Extension in the Registry


One possibility, but not the best one, is to disable the shell extension. I don't like this approach because it involves editing the registry and I like the information provided by the shell extension. Here's how to disable the extension if you want to. Open the registry editor and add/set the HKLM\Software\Microsoft\Fusion\DisableCacheViewer DWORD value:

image

Set the value to 1:

image

Once you make that change, you can browse the directory:

image



Option 2: Go Command-O


Another option is to copy assemblies from the GAC from the command line. This approach works well if you prefer working from the command line, but if you like to right-click with a mouse, this might not be the choice for you.

I highly recommend PowerShell, but you can use Windows Command Prompt. Find your way to the c:\windows\assembly directory and copy the file you need:

image

Option 3: Use the SUBST Command


The SUBST command allows you to create a shortcut to a path on your file system and assigns that shortcut a drive letter. I really like this approach because you have the option of using Windows Explorer without having to disable the shell.

Suppose you want to create a G Drive (G for GAC), use the following command: SUBST G: C:\WINDOWS\ASSEMBLY

image

Then in Windows Explorer you are free to double-click and right-click to your heart's content and still use the shell extension.

image