Thursday, October 17, 2013

SharePoint 2010 : Error when Uploading multiple files

שלום חברים
היום נתבקשתי לחקור בעיה מוזרה , כשאנשים מנסים להעלות קבצים מרובים באמצעות פקד ActiveX, שבו הם יכולים לגרור ולשחרר קבצים או לבחור קבצים מרובים . התחלתי לקבל "Object reference not set to an instance of an object"  .


הדבר המוזר הוא שזה הופיע רק באתרים מסוימים ועל כמה מחשבים (עשיתי ניסוי והרמתי תת אתר מסוג "אתר צוות עם Master Page Defaultי ולא הייתה בעיה להעלות קבצים מרובים). בעודי מתעסק בחקירת הבעיה שמתי לב שזה באמת קרה רק באתרים שבו אני משמש בדף ראשי מותאם אישית. המחשבה הראשונית שלי הייתה שזה היה משהו לא חוקי עם פקדי HTML או חסרים delegate controls  - אבל הכל היה בסדר גמור.
על ידי בדיקת הקוד בדפים הראשיים מותאמים אישית מצאתי את אלמנט קלט מסוג Button ללא ערך AccessKey .

כל האלמנט מסוג כפתור חייב להיות עם ערך AccessKey מוגדר שאינו ריק. החוסר בערך  AccessKey הייתה הדבר שגרם ל NullReferenceExceptionבהעלאת מרובת קבצים. במקרה זה היה לי כמה אלמנטי קלט מסוג כפתור ללא כל תכונות  AccessKeyבדף הראשי שלי.
יחד עם זאת ברגע שהוספתי את תכונה AccessKey עם ערך שאינו ריק העלאת קצים מרובים עבדה כמו קסם. שימו לב שהגדרת AccessKey = " " גורמת לאותה שגיאה, אתם צריכים להגדיר את הערך עבורו, למשל ; AccessKey = " _ " .


בהצלחה !
רון נס.

============================================================================================================================================================================================================================================================



Hello Friends
Today I was asked to explore strange Problem, It's when people are trying to upload multiple files using the ActiveX control, where they can drag and drop files or select multiple files. I started receiving "Object reference not set to an instance of an object" exceptions from the STSUpld control.


The strange thing is that this only appeared on some sites and on some computers. After some fiddling around I noticed that it actually only happened on sites where I used a custom master page. My initial thought was that this had something to do with invalid HTML or missing delegate controls - but everything was just fine.
By inspecting the code on the Custom Master Page I found an input element of the type button without AccessKey value.
 All input element of the type button must have the AccessKey value set to non empty the control iterates through all input elements looking for the AccessKey to find the OK and Cancel buttons. The point above was the thing that caused the NullReferenceException in the multiple upload control. In this case I had a few input elements with the type button without any AccessKey attributes in my master page.
Nevertheless once I added the AccessKey attribute with a non-empty value the upload worked like a charm. Note that setting AccessKey="" causes the same exception, you need to set a value for it for instance; AccessKey="_".

Good Luck :)
Ron Ness.


SharePoint 2010 : Increase the Upload File Size Limit

שלום חברים,
היום נתבקשתי להגדיל את מגבלת גודל הקובץ שניתן להעלות לאתרי SP. כברירת מחדל SP מאפשר העלאת קבצים עד 50MB. (ישנה מגבלה ב-IIS שצריך להתחשב בה ולהגדיל אותה גם כן, ברירת המחדל היא 30 MB)
לכן, כאשר מנסים להעלות מסמך גדול , הדבר גורם לשגיאה הבאה :


סדר הפעולות לשינוי הגודל הוא :
צעד ראשון -
1 . להגדיל את המגבלה של SharePoint דרך הניהול המרכזי
ראשית, עליך להגדיל את המגבלה של ההעלאה ב-SharePoint 2010.
ניהול מרכזי ==> "ניהול יישומי אינטרנט " ==> בחר בשורת יישומים באינטרנט ( אל תלחץ על הכותרת , פשוט בחר Web Application ) ==>  "הגדרות כלליות" ==>  בשדה גודל העלאה מקסימאלי , שנה את ההגדרה לערך הרצוי ( 150 MB למשל בדוגמא שלנו ) == > לחץ על "אישור"


 עכשיו,יישום האינטרנט מצויד לקבלת קבצים גדולים , אבל IIS7 עדיין יחסום אותו, וכתוצאה מכך באותה הודעת השגיאה כאמורה לעיל. אז, בואו נעבור לשלב 2.

2 . להגדיל את אורך בקשת IIS7
השתמש בפקודה הבאה במחשב שפועל עליו IIS 7 :
%% \ system32 \ inetsrv \ appcmd סט -config סעיף windir : valueInBytes : requestFiltering - requestLimits.maxAllowedContentLength
במקרה שלנו , אנחנו פשוט נשים את 400150x1024x1024 = 157,268, בתים.
אתה תקבל הודעת אישור לאחר החלת הפקודה. נא לזכור כי אתה צריך להפעיל את cmd.exe במצב של מנהל מערכת.



 3 . להגדיל את TomeOut  - זמן חיבור IIS7 (אופציונלי)
עוד דבר אחד שיש לזכור הוא את הגדרות פסק זמן חיבור : כאשר מעלים קבצים גדולים. אם אתה רוצה , אתה יכול להגדיל את הזמן המוקצב לחיבור בערך גדול יותר. הסטנדרטי הוא 120 שניות. שלב זה הוא אופציונלי , אבל יכול להיות נדרש אם יש לך משתמשים בעלי חיבורי אינטרנט במהירות נמוכים.



פתוח IIS ==> בחר את יישום האינטרנט ==>  לחץ על הגדרות מתקדמות ==>  להרחיב את גבולות חיבור ==> הגדר את הערך החדש לחיבור בזמן החוצה ( שניות ) ==>

כעת תוכלו להעלות קבצים גדולים יותר :



בהצלחה !
רון נס.

============================================================================================================================================================================================================================================================


Hello Friends
Today I was asked to increase the file size limit for SP. By default SP allows uploading files up to 50MB. (There is a limit in IIS to consider it and increase it as well, the default is 30 MB)The Problem.
So, when trying to upload a big document, this results in the following error:

The good news is: This can be custom tailored to your needs, by simply following 3 steps. Here comes the first step:
1. Increase the SharePoint Upload Limit via Central Administration
First, you must increase the SharePoint 2010 upload limit.
Central Administration ==> “Manage Web Applications” ==> Select desired web ==> application row (don’t click on the title, just select)  ==> “General Settings” in the ribbon  ==> Under Maximum Upload Size, change the setting to the desired value (e.g. 150 MB in our example) ==> “OK”


Now, the web app is equipped for receiving large files, but IIS7 will still prohibit it, resulting in the same error message as above. So, let’s move on to step 2.

2. Increase the IIS7 request length
Use the following command on the machine you are running the IIS 7:
%windir%\system32\inetsrv\appcmd set config -section:requestFiltering -requestLimits.maxAllowedContentLength:valueInBytes
In our case, we’ll simply put 150x1024x1024=157268400 bytes.
You will receive a confirmation message after applying the command. Please bear in mind that you will need to run the cmd.exe in administrator mode.




3. Increase the IIS7 connection timeout length (optional)
One more thing to keep in mind is the connection timeout settings: When you upload large files, depending on your connection speed it can happen that the connection times out. If you want, you can increase the connection timeout to a larger value. The standard is 120 seconds. This step is optional, but can become required if you have users with low speed internet connections.

Open IIS ==> Select the Web Application ==> Click on Advanced Settings ==> Expand Connection Limits ==> Set the new value for Connection Time-out (seconds)


You users will now be able to upload larger files:



Good Luck :)
Ron Ness.


Monday, October 7, 2013

SharePoint 2013 : You may be trying to access this site from a secured browser on the server. Please enable scripts and reload this page

שלום חברים,
היום ראיתי אצל לקוח את ההודעה הבאה בראש הדפדפן :
"You may be trying to access this site from a secured browser on the server. Please enable scripts and reload this page."
כשניסתי ללחוץ על לינקים כדי לפתוח חלון מסוים למשל, לרשום משתמש מנוהל בחווה החלון לא נפתח.
הבעיה היא בהגדרות הדפדפן שלא מאפשרות להריץ קוד JavaScript.
כדי לפתור בעיה זו, הפעל את תכונת JavaScript ב-Internet Explorer
לשם כך, בצע את הפעולות הבאות
1.פתח את ה- Internet Explorer, עבור לאתר SharePoint Server 2013, לחץ על Alt כדי לחשוף את שורת התפריטים, לחץ על כלים, ולאחר מכן לחץ על אפשרויות אינטרנט.
2.בכרטיסיית האבטחה (
Security), לחץ על רמה מותאמת אישית.
3.גלול למטה למקטע סקריפטים הפעילים, ולאחר מכן בחר הפעלה.
("Active scripting section")
בהצלחה !
רון נס.
========================================================================================================================================================================================================================================
Hello Friends,
Today I saw the following message at the top of your browser:

"You may be trying to access this site from a secured browser on the server. Please enable scripts and reload this page."

When I tried to click on links to open a window , for example , Configure manage Account, the window does not open.

The problem is that the browser settings doesn’t allow to run JavaScript code.

To resolve this issue, enable JavaScript in Internet Explorer. To do this, follow these steps:
1. opened the Internet Explorer, go to SharePoint Server 2013, press Alt to reveal the menu bar, click Tools, then click Internet Options.
2. Choose Security tab and click Custom Level.
3. Scroll down to Active scripting section, and then select Enable.

Good Luck J
Ron Ness.

Tuesday, October 1, 2013

Change the Alert frequency for a particular User

שלום חברים,
היום נתבקשתי למצוא דרך לשנות למשתמש מסויים את תדירות ההתראות שהוא מקבל למייל האישי שלו, מתדירות יומית לתדירות חודשית.
ניסתי למצוא דרך לשנות את ההגדרת דרך ממש המשתמש של SharePoint אך ללא הצלחה.
הפתרון שמצאתי הגיע בעזרת קוד PowerShell פשוט.
להלן הקוד :
$web = Get-SPWeb "http://pais-portal/sites/operation/" #Modify with your URL
$listurl = "Lists/List Name" #Modify to the relative URL of your list

foreach($alert in $web.Alerts)
{
    if($alert.ListUrl -eq $ListUrl)
    {          
            "User : " + $alert.User.Name
            "Title : " + $alert.Title
            "Frequency : " + $alert.AlertFrequency
            "Delivery Via : " + $alert.DeliveryChannels
            "Change Type : " + $alert.eventtype
            Write-Host "=================================="

            # Cange the Frequency for a User
                if($alert.User.UserLogin -eq 'Domain\User Account')
                        {
                          $alert.AlertFrequency = "Daily"   # You can put this values : Immediate/Daily/Weekly
                          $alert.Update()
                        }
    }
}


<# if somthing goes wrorng cahnge the rows to :
   $alert.AlertFrequency = [Microsoft.SharePoint.SPAlertFrequency]::Daily
   $alert.Update() #>


בהצלחה !
רון נס.


============================================================================================================================================================================================================================================================




Hello Friends,
Today I was asked to find a way to change the frequency of the alert to a particular user, he is getting the alert to his email every day and he want to get the alerts every  month.
I tried to find a way to change the settings through SharePoint UI but without success.
The solution I found was using a simple PowerShell code.
Here's the code:
$web = Get-SPWeb "http://pais-portal/sites/operation/" #Modify with your URL
$listurl = "Lists/List Name" #Modify to the relative URL of your list

foreach($alert in $web.Alerts)
{
    if($alert.ListUrl -eq $ListUrl)
    {          
            "User : " + $alert.User.Name
            "Title : " + $alert.Title
            "Frequency : " + $alert.AlertFrequency
            "Delivery Via : " + $alert.DeliveryChannels
            "Change Type : " + $alert.eventtype
            Write-Host "=================================="

            # Cange the Frequency for a User
                if($alert.User.UserLogin -eq 'Domain\User Account')
                        {
                          $alert.AlertFrequency = "Daily"   # You can put this values : Immediate/Daily/Weekly
                          $alert.Update()
                        }
    }
}


<# if somthing goes wrorng cahnge the rows to :
   $alert.AlertFrequency = [Microsoft.SharePoint.SPAlertFrequency]::Daily
   $alert.Update() #>

Good luck :)
Ron Ness.

Monday, September 9, 2013

SharePoint 2010 Event ID 6482 : "Application Server Administration job failed for service instance Microsoft.Office.Server.Search.Administration.SearchServiceInstance"


שלום חברים,

היום נתקלתי בתקלה חוזרת ב-Event Log שחזרה על עצמה בכל דקה.

התקלה : Event ID 6482

תוכן :

Application Server Administration job failed for service instance Microsoft.Office.Server.Search.Administration.SearchServiceInstance (GUID).

Reason: An update conflict has occurred, and you must re-try this action. The object SearchDataAccessServiceInstance was updated by domain\user, in the OWSTIMER (5040) process, on machine (server name). View the tracing log for more information about the conflict.

Technical Support Details:
Microsoft.SharePoint.Administration.SPUpdatedConcurrencyException: An update conflict has occurred, and you must re-try this action. The object SearchDataAccessServiceInstance was updated by domain\user, in the OWSTIMER (5040) process, on machine (server name). View the tracing log for more information about the conflict.

 

מסתבר שזה קורה כאשר יש תוכן של מערכת קבצים במטמון שרתי FE שהוא חדש יותר מהתוכן של מסד הנתונים. זה יכול לקרות אם לאחרונה בוצע שדרוג למערכת או התאוששות.


פתרון:
צריך לנקות את קבצי ה-
Cache  בכל שרתי ה-FE.
להלן הצעדים לביצוע פעולה זו:
1. עצור את שירות "שעון העצר" של
Windows SharePoint Services (SPTimerV4)
2. נווט אל תיקיית המטמון , ב
Windows Server 2008 R2, מטמון התצורה הוא במיקום הבא:
כונן: \
Programdata \ Microsoft \ SharePoint \ Config, אתר את התיקייה שיש בה את הקובץ "Cache.ini"
(הערה: תיקיית
Application Data עשויה להיות מוסתרת כדי להציג את התיקייה המוסתרת, יש לשנות את אפשרויות התיקייה כנדרש.)
3. גבה את קובץ
Cache.ini.
4. מחק את כל קבצי ה-
XML בתיקיית GUID. התיקייה תתמלא מחדש בקבצי XML כאשר השירות - SPTimerV4 יופעל מחדש.
5. שים לב, כאשר אתה מרוקן את מטמון התצורה בתיקיית
GUID, ודא שאתה לא מוחק את התיקייה ואת קובץ GUID Cache.ini שנמצא בתיקיית GUID.
6. לחץ פעמיים על קובץ
Cache.ini.
7. בתפריט עריכה, לחץ על בחר הכל. בתפריט עריכה, לחץ על מחק. רשום 1, ולאחר מכן לחץ על שמור בתפריט הקובץ. בתפריט הקובץ, לחץ על יציאה.
8. הפעל את שירות "שעון העצר" של
Windows SharePoint Services (SPTimerV4)
9. שים לב למטמון מערכת, הקבצים נוצרים מחדש לאחר ביצוע הליך זה. ודא שאתה מבצע הליך זה בכל השרתים בחוות השרתים.
10. ודא שהקובץ בתיקיית
Cache.ini GUID מכיל כעת הערך שלו קודם. לדוגמה, ודא כי הערך של קובץ Cache.ini לא 1.


בהצלחה !

רון נס.





========================================================================================================================================================================================================================================


 Hello Friends,
Today I encountered the error persists Event Log on repeated every minute.


The event viewer had an error occurring every minute – Event ID 6482 which states:

Application Server Administration job failed for service instance Microsoft.Office.Server.Search.Administration.SearchServiceInstance (GUID).

Reason: An update conflict has occurred, and you must re-try this action. The object SearchDataAccessServiceInstance was updated by domain\user, in the OWSTIMER (5040) process, on machine (server name). View the tracing log for more information about the conflict.

Technical Support Details:
Microsoft.SharePoint.Administration.SPUpdatedConcurrencyException: An update conflict has occurred, and you must re-try this action. The object SearchDataAccessServiceInstance was updated by domain\user, in the OWSTIMER (5040) process, on machine (server name). View the tracing log for more information about the conflict.



Turns out that this happens when Some contents of the file system cache on the FE servers is newer than the contents of the configuration database. This could happen if you’ve recently been through a system upgrade or recovery.

Resolution:

The file system cache on all FE’s on which the timer service is running needs to be cleared.

Below is the step by step for doing this:

  1. Stop the Windows SharePoint Services Timer service
  2. Navigate to the cache folder
    In Windows Server 2008 R2, the configuration cache is in the following location:
    Drive:\ProgramData\Microsoft\SharePoint\Config , Locate the folder that has the file "Cache.ini"
    (Note: The Application Data folder may be hidden. To view the hidden folder, change the folder options as required)
  3. Back up the Cache.ini file.
  4. Delete all the XML configuration files in the GUID folder. Do this so that you can verify that the GUID folder is replaced by new XML configuration files when the cache is rebuilt.
  5. Note when you empty the configuration cache in the GUID folder, make sure that you do not delete the GUID folder and the Cache.ini file that is located in the GUID folder.
  6. Double-click the Cache.ini file.
  7. On the Edit menu, click Select All. On the Edit menu, click Delete. Type 1, and then click Save on the File menu. On the File menu, click Exit.
  8. Start the Windows SharePoint Services Timer service (SPTimerV4)
  9. Note the file system cache is re-created after you perform this procedure. Make sure that you perform this procedure on all servers in the server farm.
  10. Make sure that the Cache.ini file in the GUID folder now contains its previous value. For example, make sure that the value of the Cache.ini file is not 1.

Good Luck J

Ron Ness.