Showing posts with label SharePoint 2010. Show all posts
Showing posts with label SharePoint 2010. Show all posts

Monday, July 9, 2012

SharePoint 2010 | Content Deployment using Path and Jobs from Central Admin | Errors

Hi

We have a staging source and target production.  For 1st migration on blank site collection :

1. Even if we migrate content to a blank site collections we get many warnings like :

a.

[WebFeature] [Publishing]   Warning: Provisioning did not succeed. Details: Failed to create the 'Images' library. OriginalException: The feature failed to activate because a list at 'PublishingImages' already exists in this site.  Delete or rename the list and try activating the feature again.

b.

Warning: Provisioning did not succeed. Details: Failed to create the 'Images' library. OriginalException: The feature failed to activate because a list at 'PublishingImages' already exists in this site.  Delete or rename the list and try activating the feature again.

c.

Warning: User or group 19 cannot be resolved.

 

 Can we use a backup of staging as target instead of blank . What else than initial migration failure should I aspect as drawback in this ?

 

2.

Content deployment deploys the most recent major and minor versions of a content item. For example, if version 2.7 of a Web page is being deployed, the most recent major version (2.0) of the page, and the most recent minor version (2.7), will be deployed to the destination site.

Is it possible to limit the migration to last major version only ?

  1. We have started with blank site collection using powershell. Still getting the error in point one.

  2. I refer to http://centralAdmin/_admin/Deployment.aspx in this problem statements above.


Reply 1 By http://social.technet.microsoft.com/profile/jason%20warren/?ws=usercard-mini

Microsoft's Stefan Goßner has a great post about content deployment that I recommend you review.

 

In the section about the requirements for a successfuly content deployment, he recommends using an empty site collection for the destination and not a site collection with the Blank Site template (STS#1):
3) Use an empty site collection as the destination of your content deployment job

As already discussed in Part 5 content deployment will fail if the destination database contains conflicting content. To avoid this it is required that the initial deployment is done into an empty site collection.

Be aware that the only way to create an empty site collection is to use the following STSADM command:

STSADM.EXE -o createsite -url <url-to-site-collection> -ownerlogin domain\user -owneremail <email-address>

Using the "Blank Site" template will NOT create an empty site collection! It will actually create a site collection with content. You can see the difference if you create a site collection using both methods and then inspect the content of the created sites using SharePoint designer.

I personally recommed to always use the STSADM command with the syntax above to ensure that you really have an empty site collection as destination.

Impact: If the site collection has been created using a different method or already contains data the content deployment job will fail.

How to resolve: Deploy into an empty site collection

For your second question, content deployment will deploy the latest published version. If you don't want a minor version to be deployed (it's a draft, perhaps), simply do not publish it.




 

JASON WARREN

Infrastructure Specialist



 


 Reply 2 By http://social.technet.microsoft.com/profile/neal%20mcfee%20%5Bmct%5D/?ws=usercard-mini

To create a site collection that does not have a template (an empty site template) you omit the -template parameter in the New-SPSite cmdlet.

If you create a blank site using the STS#0, this will not work for the task you are trying to complete.

 

 

Try deleting the target site collection and recreating it using New-SPSite but do not specify the template.

Then re-run your publishing job.




If this helps you then please mark the post as helpful.
If this answers your question then mark it as the answer.
If another contributor in the thread answers your question then please do the right thing.
And as always most answers for SharePoint are based on "It depends"

 

Sunday, July 1, 2012

VariationsFixupTool

variationsfixuptool is used to correct variations system data
on publishing sites or pages.If you want to analyze the actual site structure
and the data stored in the relationships list this tool may be good one.

Syntax

stsadm -o variationsfixuptool

   -url <source variation site URL>

   [-scan]

   [-recurse]

   [-label]

   [-fix]

   [-spawn]

   [-showrunningjobs]


Parameters


Parameter name Value Required? Description
url A valid URL, such as http://server_name Yes The URL of a site in source variation where variations system data is being analyzed or corrected.
scan <none> No Analyzes the variations hierarchy and report findings.
This parameter provides functionality that cannot be accessed using the Central Administration Web site.
For each Site/Page, it reports:
  • If the source site is marked as being in the source variation hierarchy (SPWeb.AllProperties["__InSourceHierarchy"] == True ?). If the site is marked as being in the source hierarchy means that the page is part of the source hierarchy.
  • The Variation Group Id of the source site or page (SPWeb.AllProperties["Variation Group Id"] or PublishingPage.ListItem[FieldId.VariationGroupId])
  • Which peers are registered in the relationships list with same Variation Group Id
  • If a variation peer exists in the configured labels (default is all spawned labels) by first checking if a peer is configured in the relationships list with the same variation group ID for the given label. If no peer can be found using the relationships list we try to lookup the peer using the default URL that would be used when creating a variant in the given label
  • The variation group id of the variation peers in the target labels (SPWeb.AllProperties["Variation Group Id"] or PublishingPage.ListItem[FieldId.VariationGroupId])
  • If the source site/page is configured in the relationships list
  • In addition the command reports the variation labels used for the peer check (default is all spawned labels).
  • The tool will not identify any issues - it is required to analyze the report in detail and interpret it in order to find problems.
recurse <none> No Scan or fix all subsites of the site specified by the url parameter.
label A valid label name, such as "English" No Name of the label of the variation target.
fix <none> No Corrects invalid variations system data that are found. If the recurse parameter is used, fixes are done recursively for all subsites.
This parameter provides functionality that cannot be accessed using the Central Administration Web site.Fix mode will not create missing variation peers.
The following issues are automatically fixed:
  • Missing Variation Group ID on source site or source page
  • Missing relationships list entry for source or target page or site
  • Missing Variation Group ID on target site or target page
  • Different Variation Group ID in source site/page and target site/page (source ID will win)
spawn <none> No Creates new site variations on the source variation site specified by the url parameter for all target variations labels. If the recurse parameter is used, variations for subsites and pages are also created.
This parameter equivalent to the New Variation Site user interface setting that is located on the Site Content and Structure page.
This operation mode cannot be used to spawn pages in already spawned sites.
The command initiates the site spawn operation by creating a scheduled work item for the SpawnSiteJobDefinition timerjob. The spawn will be performed as soon as the timerjob runs.
The difference between the scheduled work item created by the CPVAreaEventReceiver and the Variationsfixuptool is that the tool has the option to create a workitem, which only spawns the site to one specific variation rather than to all spawned variation labels.
A common use scenario is to configure the source variation label with the Hierarchy Creation option to create only the root site and not the complete hierarchy and later to spawn the hierarchy or parts of the hierarchy from the source label using the STSADM command.
In MOSS 2007, this command was a major benefit compared to the automatic hierarchy creation in the UI, as it was the only way to force the creation in OWSTIMER rather than W3WP.
With SharePoint 2010 where all actions are already in OWSTIMER the benefit of using the STSADM command rather than the UI is rather limited.
showrunningjobs <none> No Displays current status of Variations Propagate Page Job Definition and Variations Propagate Site Job Definition timer jobs that are located on the Timer Job Status page of the SharePoint Central Administration Web site. But this does not provide information about Variations Create Hierarchies Job Definition , Variations Create Page Job Definition and Variations Create Site Job Definition.You only get to know about Variations Propagate Page Job Definition and Variations Propagate Site Job Definition.
Example :
stsadm -o variationsfixuptool -scan -url http://server/sites/pub/vhome/source -recurse > C:\report1.html

Source of information :

SharePoint Variations – The complete Guide – Part 11 – Variations Fixup Tool (blogs.technet.com/b/stefan_gossner/archive/2011/11/28/sharepoint-variations-the-complete-guide-part-11-variations-fixup-tool.aspx)

Use the variationsfixuptool operation (SharePoint Server 2010) [technet.microsoft.com/en-us/library/dd789633(v=office.14).aspx]

You may also like:

Cannot create Variation site because the parent Publishing web cannot…


0x80070057 sharepoint variations


Access “Pages” Library for Chinese Locale

Wednesday, June 27, 2012

SharePoint 2010 strange behavior of Taxonomies under Migration from one server to another

Microsoft.SharePoint.dll version 14.0.4762.1000

Microsoft.SharePoint.Taxonomy.dll  version 14.0.4756.1000

 

We migrate only published and approved content from staging to production. Under one of the scenarios, we want to introduce new Terms for our system. Here is the strange behavior we are facing that might be reported to Microsoft for improvements in future service packs:

  1. Create new term on staging under desired termset.

  2. Reproduce same term with same Guid and parent term set on production :

    • By using TermSetItem.CreateTerm Method (String, Int32, Guid)

    • By stopping meta dataservice and then replace db on production from staging

    • By using Export-SPMetadataWebServicePartitionData,Export-SPMetadataWebServicePartitionData  powershell



  3. Create unpublished SPItem on staging which refer the new term.

  4. Let the content deployment proceed. This will migrate only the Term entry in TaxonomyHiddenList.

  5. Publish any spDoc which refers few of the old and new terms.

  6. Let the content deployment migrate the new published item.

  7. Now on production the newly migrated spDoc has only new term referred.

  8. If we migrate spDoc which only has old terms , not the new one, it migrates well and all the terms are visible under the display item form > SPField.


How you could help me in this:

I got tp_ListId and tp_DocId for my target document migrated from [AllDocs] database Tableusing LeafName.

Using tp_ListId and tp_DocId  on [AllUserData] I was able to observe that, actully content deployment has created entry correctly here.

The entry is like under ntext2 is like:“OldTerm1|OldTerm1GUID;NewTerm1|NewTerm1GUID;OLDTerm2|OldTerm2GUID”

Using all SharePoint API’s and U2U etc, my migrated item returns only the new term , it seems to be old terms are wiped off , but they are not , they are there in the database.

The output of U2U is:

NewTerm1|NewTerm1GUID

Now I have a question for you, what else than Taxonomy Update Scheduler Timer Job could be the culprit? Is it like the account with which SharePoint Timer Job is running , must have full control on Meta Data DB and Site Collection DB ?

 

How Microsoft should help us in this:

For a new term, when referred by an item, it should be handled by the migration /deployment API’s exposed internally that:

  • A new Term should be created under the same termeset as on source. Right now it tends to create under System > Keyword Terms set if term is missing. ( if I miss step 2 above)

  •  No multiple entries should be allowed in TaxonomyHiddenList with same title /GUID, name parent termset etc. If we migrate an item which is published under ste 4 above. 2 entries are created under TaxonomyHiddenList.

  • Taxonomy Update Scheduler should be made efficient to handle multiple entries for same term in the taxonomyhiddenlist by the external processes.


 Reply 1


A.

 

After doing all the above steps once :

So the Taxonomy Hidden List has all the terms as desired , the Term Store is up to date , the SQL  content DB has the entry as it should be.

Means Taxonomy Update Scheduler is not able to update the content DB , so that it may display the right values.

 

Do we need some kind of Service pack here ? We have :

Microsoft.SharePoint.dll version 14.0.4762.1000

Microsoft.SharePoint.Taxonomy.dll  version 14.0.4756.1000

 

I tried  TaxonomySession.SyncHiddenList(mySiteCollection); but it could not help .

 

 

B.

If I run all my Meta service , web application pool and SharePoint Timer Job with an "Admin Everywhere" account on production replica and follow the steps above along with TaxonomySession.SyncHiddenList(mySiteCollection);  still it does not help.

C.

If I run all the app pools and windows services on the server using an account who has admin rights everywhere along with TaxonomySession.SyncHiddenList(mySiteCollection);  it helps , I had to insert SyncHiddenList along with manual run of Taxonomy Migration Job in b/w step 4 and 5 above. i.e after the Taxonomy Hidden List item migration and before the actual content come in .

 

 

 

 

 

 

Is there some shorter way to avoid all the mess above said ? Or at least you could point out what else than exactly my Meta service app pool  , web application pool and SharePoint Timer Job is involved in Taxonomies !!!

 

Reply 2


Temporary Solution:
Everywhere on msdn and blogs, technology geeks have suggested making taxonomy store to be common for staging and production environments. But in our case we cannot maintain this. So with our version of SharePoint (Microsoft.SharePoint.dll version 14.0.4762.1000, Microsoft.SharePoint.Taxonomy.dll  version 14.0.4756.1000 ) we have tested below mentioned to work as an alternative:

 

0. On staging and production go to Central Admin > Security > Configure Service Accounts

a. Select Farm Account and press OK, the account you had decided to be farm account previously will be getting full control at many places in the DB , if the DB's are backup and restore off the line , generally we loose this important couple b/w farm account and Database. It will make sure the timer service which runs with Farm account can do many stuff on the whole farm without any errors.

b. do similar to above for app pool account for managed meta service and your target web applications.

1. Run export import for the staging and production to be in sync. Halt the changes on staging.
2. Create new term on staging under desired termset. Extract the GUID for this new term and keep safe with you
3. Create unpublished SPItem on staging which refer the new term.( To create an entry in taxonomy hiddenlist)
4. TaxonomySession.SyncHiddenList(mySiteCollectionStaging).Before Sync Please make sure your SharePoint Timer Job is running with an account which has full rights on site collection and the taxonomy data base. This can be done by setting admin for site collection and taxonomy service.Please make sure after this you wait for  "Enterprise Metadata site data update" and "Taxonomy Update Scheduler"  to run once as scheduled.

5. Delete the unpublished item of step 2 if you wish to .

6. Run export process and discard this export package. Because this package contains all the terms, since they are updated by sync process.
A. Reproduce same term with same Guid and parent term set on production: By using TermSetItem.CreateTerm Method (String, Int32, Guid) Take GUID and name from step two above.
B. Create an unpublished dummy item on production with new term.
C. TaxonomySession.SyncHiddenList(mySiteCollectionProd).Please make sure after this you wait for  "Enterprise Metadata site data update" and "Taxonomy Update Scheduler"  to run once as scheduled.
D. Delete the unpublished item if you wish to.

Now servers are ready for future normal import and exports without any error till the time you don’t introduce new terms.

 

Reply 3


Permanent Solution:

 

How Microsoft should help us in this:

1. Make the content deployment API's smart enough , that source Taxonomy hidden list is not marked for migration while exporting site collection , when the SPtem which refer to a term is created on Target , the right ( in sync) Term will automatically be created under target taxonomy hidden list.

2. In case Target term store is not updated , there should be explicit messages in import log , that a term is referred which may have been missing in the target term store.Import is unsuccessful.Please update your term store and run the import again. Or let the SharePoint Timer job create one at right place and give error if parent term set is missing

Friday, June 1, 2012

Central Admin Content Deployment Jobs and Path by Microsoft (SharePoint 2010) VS SharePoint Content Deployment Wizard by chrisobrien

Hi

Few of our projects are using SharePoint Content Deployment Wizard  by chrisobrien    since old days of MOSS 2007. And others use Central Admin Content Deployment Jobs and Path  by Microsoft .

Microsoft keeps on updating there out of box feature in SharePoint as usual.

 

I am starting this discussion for folks here to encourage using the best that could be. I would request everyone to share there views Like :--

____________________________________________________________________________________________________________

My preference : Central Admin Content Deployment Jobs and Path  by Microsoft (SharePoint 2010) (Option 1)

Why :

  1. I prefer option 1 because it is something for which I can go back to Microsoft  and request for support. I get  almost all feature in option 1 , which option 2 gives.


OR

My preference :  SharePoint Content Deployment Wizard  by chrisobrien   (Option 2)

Why :

  1. I prefer option 2 for level of customization it allows with custom API as wrapper  , I can control the whole migration process . Option 1 is kind of Black box for us.


_____________________________________________________________________________________________________________

 

You are welcome to share links where the tech world have already such threads available which gives this comparison handy like SharePoint Content Deployment Wizard

________________________________________________________________________________________________________________________________________________________________________________________________________________________

 

 

Are there some alternatives if we don’t want to upgrade from Microsoft SharePoint Server 2010 (14.0.4763.1000), still we don’t face below mentioned issues:

  1.        An incremental content deployment of a package in SharePoint Server 2010 fails if the following conditions are true:

    • The package contains a renamed site.

    • A sub-site contains a link to the renamed site.




Additionally, you receive the following error message:

Value does not fall within the expected range.

References: http://support.microsoft.com/kb/2459108

  1.        You perform a content deployment from a source web application to a destination web application in SharePoint Foundation 2010.

    • You select languages under the Alternate language section in the source web application.

    • You perform an incremental content deployment.




In this scenario, the alternative language setting is not changed in the destination web application.

References: http://support.microsoft.com/kb/2536591

  1.        Assume that you perform an incremental content deployment on a destination SharePoint Server 2010 farm. In this situation, the changes for the alternative language settings on the source farm are not reflected on the destination farm.


References: http://support.microsoft.com/kb/2536591

  1.        When you use the Managed Metadata columns together with document sets in SharePoint Foundation 2010, you cannot perform a content deployment successfully. Additionally, you receive the following error message:


FatalError: Specified data type does not match the current data type of the property.

References: http://support.microsoft.com/kb/2598304

  1.        You paste HTML markup into the comments field of a publishing page in a SharePoint site.


You change the page order by using the Site Navigation Settings page in the SharePoint site.

You perform a content deployment from this site to another site.

In this scenario, the content deployment fails, and you receive the following error message:

Cannot complete this action.

References: http://support.microsoft.com/kb/2598304

  1.        One of the issue you may face with Deployment job is :   How to Fix – Publishing Site Content Deployment Error – Duplicate First Name Column

  2.        You should verify for relative links, if they are migrated correctly.


Nevertheless we can avoid many not listed anywhere using below mentioned:

Best practices for content deployment (SharePoint Server 2010)

You are invited to add the issues you kept on facing in SharePoint Content Deployment using Paths and Jobs , with links to resolution or explanations.

SPWebService.CollectSPRequestAllocationCallStacks property

There was a time when you had to restart a lot of stuff after editing registry entries like  : KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\HeapSettings        SPRequestStackTrace = 1

to get the root cause of memory leaks and all that stuff.

Now you have property  SPWebService.CollectSPRequestAllocationCallStacks .  This is a diagnostic setting that facilitates the debugging of leaks of SPSite and SPWeb objects. If not disposed properly these objects can hold onto large amounts of memory. By enabling this setting, traces in the trace log that report leaks will contain callstacks. However, callstack collection is expensive so this should only be enabled during a brief diagnostic period.

Powershell :

$MySvc = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$MySvc.CollectSPRequestAllocationCallStacks = $true | $false
$MySvc.Update()

 

Monday, March 12, 2012

SharePoint 2010 | mix mode authentication with ntlm and sql providers | Browser issue

Hi

 

I have a web application claim based with ntlm and sql provider ( mix mode authentication). The default login page of SharePoint 2010 , allows me to login the site on Mozilla 10 and Google  crome,

but on IE 8 and 9 , it does not redirect me anywhere after windows authentication pop up, nor the user is able to access the application pages by typing url directly ( means there is a problem in authentication rather than redirection only)

 

I have tried allowing all cookies and adding the site in trusted zone on IE 8 and 9 , but no luck


I had given a   hostheader different to the server name, when I revert it back to server name/blank,   I was able to use default SharePoint login page perfectly fine.

This is when hostheader had a DNS entry also in place !!!

 Reply1 

Make sure javascript is not disabled. A next step could be to install Fiddler and check which requests/responses are sent over.

Reply 2

Are you forced to actually enter a username and password using IE? This might imply a kerberos misconfiguration?

Reply 3

Hi,

Have you checked Remember me in the login page?

If yes, please try to do some changes in web.config file:

<cookieHandler mode="Custom" path="/" > changed it to:

<cookieHandler mode="Custom" path="/" persistentSessionLifetime="60">

For more information, please refer to:

http://jasear.wordpress.com/2011/12/27/sharepoint-2010-login-issue-only-using-ie-internet-explorer-on-an-fba-enabled-site/

http://social.technet.microsoft.com/Forums/en/sharepointadmin/thread/a34cb1a3-b920-4e8e-8c31-54bd13d886b7




 

Xue-mei Chang

 




Sparkytect

Wednesday, December 7, 2011

SharePoint 2010 | User Profiles | Recent Activities

Hi

While querying user profile changes we can get changes upto last 14 days.

Now,I want to know about recenet activities web part which shows user profile edits by the user. Up to which point in the past , it shows the user profile changes as recent activities ?

I need to know the duration (in days) in past for which the changes in user profile are reflected as recent activities on page : http://<server>/my/Person.aspx?accountname=domain\AccountID

Reply 1

Helo Heamntrhtk,

 

Check on this site you can configure it: http://sharepointsolutions.blogspot.com/2010/11/sharepoint-2010-social-networkingpart-3.html

Under section:"Timer Jobs Required"

 

The following are listed in the webpart:

Rating, blog, tag, like, ..

Activity Feeds are an ongoing record of a user’s activities through the day (or for whatever time period in which they choose to update the feed). There are two sections of Activity feed.

· My Activities - My Profile > Recent Activities

· Consolidated - My Newsfeed (Activities which track)

These two sections are like two sides of a conversation. Both are depending on Activity Feed timer job.

Kr, Gokan

 

Reply 2

Only the following activities will be displayed in the recent activities.

Rating, Tagging, new blog post and so on.

http://blogs.msdn.com/b/spses/archive/2011/02/05/social-computing-part-3-activity-feeds-social-ratings-tags-and-notes.aspx

 




Wayne Fan

How to exclude items from Search Result page?

in sharepoint 2010, there is an option to remove a url from search results immidiately, corresponding crawling rules/ exclude rules are set automatically

And the that specific content does not get crawled.

 

Otherwise go for Crawl exclude rules directly.

Tuesday, August 9, 2011

The user does not exist or is not unique FBA while adding AdGroup to siteGroup SharePoint 2010

Hi

I tried to add an ADGroup/FBARole to  site  group . In 2 ways:

1 is AddUser(SPUser user);

2nd is AddUser(string loginName, string email, string name, string notes)

code for 1st option:

SPUser cntrSubSiteUser = CreateUser(Constants.C_FBA_AUTHENTICATION_GROUP_PREFIX + RoleProvider + Constants.C_AUTHENTICATION_PIPE + ADgroup, "", ADgroup, "", web.Site);//loginname in format in format c:0-.f|roleproviderName|pp 1001 siteGroup.AddUser(cntrSubSiteUser);

siteGroup.Update();

and the createuser function is like;

private static SPUser CreateUser(string strLoginName, string strEMail, string strName, string strNotes, SPSite spSite) { SPUser spReturn = null; SPRoleAssignment spRoleAssignment = new SPRoleAssignment(strLoginName, strEMail, strName, strNotes); SPRoleDefinition spSPRoleDefinition = spSite.RootWeb.RoleDefinitions["Read"]; spRoleAssignment.RoleDefinitionBindings.Add(spSPRoleDefinition); spSite.RootWeb.RoleAssignments.Add(spRoleAssignment); //Update site spSite.RootWeb.Update(); spReturn = spSite.RootWeb.AllUsers[strLoginName]; return spReturn; }

 

for the second option code is like:- siteGroup.AddUser(Constants.C_FBA_AUTHENTICATION_GROUP_PREFIX + RoleProvider + Constants.C_AUTHENTICATION_PIPE + ADgroup, "", ADgroup, "");//Login Name in format c:0-.f|amsurgrole|pp 1001

siteGroup.Update();

 

 

 

Now lets come to the problem:

On 1 of our dev servers it works fine. But on production we get the error: The user does not exist or is not unique

However by UI, We can add this FBA Role  to any group.

 

please help.

 

Reply 1


hi

 

we have got the solution.

 

we are adding user in group for site 1( on web app 1) from site 2 ( on web app 2) code.  web app 1 is FBA .  site 2 is normal windows site.

in 2007 this code works fine

 

but for sharepoint 2010, we need to give entries for roleprovider and membership provider in web application 2 (admin web app) web.config  also.

                                                                      Reply 1.1


 I  am also getting the same exception. I am doing everything on a single sharepoint application

[SPException: The user does not exist or is not unique.]

 

Can you please point out, what are the other scenarios for the exception to happen?

Reply 1.1.1

did u also do ensure user ? also make sure user exists in ad/ ur membership provider

Reply 1.1.1.1

when extending the application it named the membership provider wrongly, hence the error is caused. Thanks for all the replies. Now the problem is solved.

Tuesday, June 21, 2011

Few of the SharePoint Sites not accessible outside server

Hi

 

Few of my sharepoint sirtes do not open outside the server. Others are working fine. Did you faced such issue in past ?

I verified almost every setting . All the settings on both type of web applications are same.

Reply : 

It was due to firewall settings on the server.

Tuesday, June 14, 2011

SharePoint disable loopback check | Specify Host Names

A number of errors related to authentication failure are reported with SharePoint 20xx

You can try disable loopback check  or Specify host names based on how much you can compromise on security front.

Method 1: Specify host names (Preferred method if NTLM authentication is desired)

To specify the host names that are mapped to the loopback address and can connect to Web sites on your computer, follow these steps:

  1. Set the


DisableStrictNameChecking
registry entry to 1.

2. Click Start, click Run, type regedit, and then click OK.

3. In Registry Editor, locate and then click the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0
4. Right-click MSV1_0, point to New, and then click Multi-String Value.
5. Type BackConnectionHostNames, and then press ENTER.
6. Right-click BackConnectionHostNames, and then click Modify.
7. In the Value data box, type the host name or the host names for the sites that are on the local computer, and then click OK.
8. Quit Registry Editor, and then restart the IISAdmin service.

 
Method 2: Disable the loopback check (less-recommended method)

The second method is to disable the loopback check by setting the DisableLoopbackCheck registry key.

To set the DisableLoopbackCheck registry key, follow these steps:
1. Set the
DisableStrictNameChecking
registry entry to 1.
2. Click Start, click Run, type regedit, and then click OK.
3. In Registry Editor, locate and then click the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
4. Right-click Lsa, point to New, and then click DWORD Value.
5. Type DisableLoopbackCheck, and then press ENTER.
6. Right-click DisableLoopbackCheck, and then click Modify.
7. In the Value data box, type 1, and then click OK.
8. Quit Registry Editor, and then restart your computer.

                                                 or
$regKeyPath = "HKLM:\System\CurrentControlSet\Control\Lsa"
$key = "DisableLoopbackCheck"
New-ItemProperty -Path $regKeyPath -Name $key -Value "1" -PropertyType dword


Reference :http://support.microsoft.com/kb/896861

Friday, June 10, 2011

refer unsigned assembly in SharePoint 2010 Project ( Visual Studio 2010)

I have around 50 3rd party dll's which I need to refer in my SharePoint project.
But since my project dll is strong named we were unable to refer unsigned dll's in it.
I tried below mentioned things:
1. removed signing of my dll from project properties. Project is build But in this case xml template of the package fails .The error I get while package creation is :
Value cannot be null. Parameter name: PublicKey
2. I tried below mentioned commands to strong name all the 3rd party dlls :
ildasm myDLL.dll /out:myDLL.il
This generates myDLL.il and myDLL.res
ilasm myDLL.il /key:Key.snk /res:myDLL.res /dll /out:myDLL.dll
This generates back strong named DLL.
But after this few of the namespaces get missing in the final DLL !!!!! well to my surprise .
3. I created a blank class library project . Given predefined structure to deploy 3rd party dll ( 80\bin) , with user controls inside proper structure as per wspbuilder guidelines. given the output path of my project dll as (80\bin).
Now I have a wsp ready and working being deployed . But neither my project dll is strong named nor the third party DLLs. dlls are deployed in web application bin and user controls inside proper control template folders . They work fine . but …
Now I come to my query:
I need to strong name my project dll still use 3rd party unsigned dll's inside my SharePoint project very similar to point 2 above.
Kindly suggest something.

Reply 1 By http://social.technet.microsoft.com/profile/martin%20hatch/?ws=usercard-mini

Ask the 3rd party to provide properly signed assemblies?

 

Reply 2 By http://social.technet.microsoft.com/profile/geoff%20webber-cross/?ws=usercard-mini

 

Might be a good option to wrap your business logic up that uses the DLLs in a WCF service and run it outside SharePoint, then you can call these methods safely from inside SharePoint (are you writing web parts?).

Reply 3 By http://social.technet.microsoft.com/profile/ryan%20t%20mann/?ws=usercard-mini

1. Use IlDasm to disassemble the DLL to an .il File

2.  Then use IlAsm to reassemble it passing in a new key generated with the sn command line utility to generate strong names.

Make sure you use the .Net 3.5 versions of ILDasm and ILAsm or it will reassermble the Dll for the wrong framework, sharepoint  2010 stuff is .Net 3.5

The downside is you'll have to do that everytime a new version comes around.

This is how I got the .Net 3.5 version of the AJAX Control Toolkit to work in sharepoint 2010.

 

Heres a pretty in depth article that even covers signing DLL's that reference each other.

http://www.geekbeing.com/2010/01/30/sign-me-up-scotty-signing-managed-assemblies-with-ildasm-and-ilasm-duo/




My Blog: http://www.thesug.org/Blogs/ryan_mann1/default.aspx Website: Under Construction

Wednesday, May 25, 2011

Multiple TargetPath under EcmDocumentRouterRule | EcmDocumentRouter , Content Organizer Rules , SharePoint 2010

In SharePoint 2010 with Content organizer  Feature, we can route a document to the target based on predefined rules.

If multiple rules condition satisfy for current document being put in drop off library, priority of rule decides which rule will run.

 

My requirement is :

Either

1. Run multiple rules for single document so that same document may be routed to multiple targets.

Or

2. Under single rule define multiple targetpath so that single document may be routed to multiple locations base don predefined rules.

 

Reference :

http://msdn.microsoft.com/en-us/library/microsoft.office.recordsmanagement.recordsrepository.ecmdocumentrouterrule_properties.aspx

Reply 1 By http://social.technet.microsoft.com/profile/kefang%20chen/?ws=usercard-mini

Hi,

If you want to implement the requirement you mentioned, it is not necessary to use the Content Organizer feature.

You can create an 'ItemAdded' event receiver for all the document libraries. After you uploaded document to library, you can call the method 'SPListItem.CopyTo()' to copy current document to destination.

For this topic you can see the following document.

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splistitem.copyto.aspx

Reply 1.1 By http://social.technet.microsoft.com/profile/mayur%20joshi/?ws=usercard-mini

Chen,

What if I want to avoid customization using Object Model. Can the content organizer then help in this. I have a similar requirement to this. I have location property which is multi value field. Based on the selections need to route the document to the appropriate folders. Can you please highlight how this can be achieved?

Thanks,

Mayur

Reply 1.1.1 By http://social.technet.microsoft.com/profile/hemantrhtk/?ws=usercard-mini

Mayur

In your case it is achivable out of box.

 

Define as much rules as much you have targets.

 

In the condition of each rule you can define, based on meta data field( which is your location ) route the document to desired target.

 Reply 1.1.1.1 by http://social.technet.microsoft.com/profile/mayur%20joshi/?ws=usercard-mini

Hemant,

Wish that was the case, i cant set as much rules because numerous permutation and combination that can happen with the countries (its a multi choice field).

I have raised another thread located here explaining the entire scenario. Any help will be highly appreciated.

Thanks,

Mayur Joshi

 

Sunday, May 15, 2011

"Central Administration>General Application Settings>External Service Connections >Configure Send To Connections" code for this

This is the way we define a connection to a site where we would like to drop our documents.

 

Now in my case there could be hundreds of target sites created by code as and when required.

For each site created I want to write few lines of code which will do exactly what /_admin/OfficialFileAdmin.aspx  page does.

 

 

So i want code for what /_admin/OfficialFileAdmin.aspx ( Central Administration>General Application Settings>External Service Connections >Configure Send To Connections) does.

 

 

just try out like:
SPWebApplication app = SPWebApplication.Lookup(new Uri("http://hemant1236"));
SPOfficialFileHost host = new SPOfficialFileHost(true);
host.OfficialFileUrl = new Uri("http://hemant1236/testsite1/_vti_bin/officialfile.asmx");
host.OfficialFileName = "hemant1236Test1saurabh";
host.ShowOnSendToMenu = true;
host.Action = SPOfficialFileAction.Move;

host.Explanation = "created at Time" + DateTime.Now.ToString() + " by custom utility.";

app.OfficialFileHosts.Add(host);

app.Update();

Friday, May 13, 2011

Name cannot begin with the '\' character, hexadecimal value 0x5C

Hi

 

While extending a claim based web application I get the error :

Name cannot begin with the '\' character, hexadecimal value 0x5C. Line 858, position 42.

Troubleshoot issues with Microsoft SharePoint Foundation.

Correlation ID: b2bdf10b-33d2-4630-8bab-8054c6ce310c

Date and Time: 5/13/2011 3:16:10 AM

 

any idea why it happen so .

 

In the log:

 

 

05/13/2011 04:03:37.57     w3wp.exe (0x0954)                           0x1A00    SharePoint Foundation             Runtime                           tkau    Unexpected    System.Xml.XmlException: Name cannot begin with the '\' character, hexadecimal value 0x5C. Line 858, position 42.    at System.Xml.XmlTextReaderImpl.Throw(Exception e)     at System.Xml.XmlTextReaderImpl.ParseAttributes()     at System.Xml.XmlTextReaderImpl.ParseElement()     at System.Xml.XmlTextReaderImpl.ParseElementContent()     at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)     at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)     at System.Xml.XmlDocument.Load(XmlReader reader)     at System.Xml.XmlDocument.Load(String filename)     at Microsoft.SharePoint.Administration.SPAspConfigurationFile.ApplyZoneSettingsToWebConfig(Uri responseUri, SPIisSettings settings)     at Microsoft.SharePoint.Administration.SPWebApplication.Provision()     at Microsoft.SharePo...    16bc3d6e-05e4-45d0-984c-813ed7e0c515
05/13/2011 04:03:37.57*    w3wp.exe (0x0954)                           0x1A00    SharePoint Foundation             Runtime                           tkau    Unexpected    ...int.ApplicationPages.ExtendWebFarmPage.BtnSubmit_Click(Object sender, EventArgs e)     at System.Web.UI.WebControls.Button.OnClick(EventArgs e)     at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)     at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)    16bc3d6e-05e4-45d0-984c-813ed7e0c515

Reply 1


In the app keys for main web application which is being extended; there was a key which referred a shared location like : "\\hemant1236\dropOff". The characters \\ in this app keys were the culprit. When I commented out this key , the web application was able to extend successfully.

Thursday, February 17, 2011

List Level backups for multiple sub sites -Poweshell

In SharePoint projects, there are scenarios, where a number of sub sites are created using a same template (now WSP).

We come across requirements where these templates require updation in due course of time.   And hence the sub sites already created may require an update. But it is not feasible to go to each and every sub site created and make the changes.

So best way could be take backup of variable components (   Lists) and then recreate all the sub sites and then restore back the lists to the newly   created sub sites.

The below mentioned   PowerShell script can be used to take backup export the content  from a specific named list in a shared folder structure, where each sub site will have a specific folder for backup in format cmp :

 

$mainBackuppath="\\abc2010\exportimport"

$File="export.txt"

Get-SPSite -Identity $spsite | Get-SPWeb -limit all| ForEach-Object {

 

 

 

if(($_.URL -eq $spsite+"/xyz") -or ($_.URL -eq $spsite+"") -or ($_.URL -eq $spsite+"/lmn") )

{

write-host -f Green  "Skipping " $_.URL

"Skipping " + $_.URL | Out-File $File -append

 

}

else

{

 

write-host -f Green "processing for "  $_.URL

"processing for " + $_.URL | Out-File $File -append

$currentSubSiteTitlewithoutspace= ""

$currentSubSiteTitlewithoutspace=$_.Title.Replace(" ","")

write-host -f Blue "Creating Directory: "$mainBackuppath"\"$currentSubSiteTitlewithoutspace

"Creating Directory: "+$mainBackuppath+"\"+$currentSubSiteTitlewithoutspace | Out-File $File -append

$error.clear()

 

[IO.Directory]::CreateDirectory($mainBackuppath+"\"+$currentSubSiteTitlewithoutspace)

if($error.count -gt 0){$error | out-file $File -append}

 

 

 

$filesystemPath=""

$filesystemPath = $mainBackuppath+"\"+$currentSubSiteTitlewithoutspace

 

if(Test-Path $filesystemPath)

{

$filesystemPath =$mainBackuppath+"\"+$currentSubSiteTitlewithoutspace+"\"+$currentSubSiteTitlewithoutspace+".cmp"

$DocLibPath=""

$DocLibPath= "/"+$_.Title+"/Shared Documents"

write-host  -f Yellow "Taking Backup for "$DocLibPath " at location " $filesystemPath "...."

"Taking Backup for "+$DocLibPath +" at location "+ $filesystemPath +"...."| Out-File $File -append

 

$error.clear()

export-spweb -identity $_.URL   -path  $filesystemPath   -ItemUrl $DocLibPath -Force -IncludeUserSecurity -IncludeVersions All | Out-File $File -append

if($error.count -gt 0){$error | out-file $File -append}

 

write-host  -f Yellow "Backup for "$DocLibPath " at location " $filesystemPath "Completed."

"Backup for "+$DocLibPath +" at location "+ $filesystemPath +"Completed."| Out-File $File -append

 

}

 

else

{

write-host  -f Red $filesystemPath  " does not exist."

$filesystemPath  +" does not exist." | Out-File $File -append

}

 

write-host -f Green "End of "  $_.URL"`n`n`n`n"

"End of "+  $_.URL+"`n`n`n`n"| Out-File $File -append

 

 

}

 

}

 

 

The below mentioned   PowerShell script can be used to restore backup /exported content  shared folder structure, where each sub site will have a specific folder for backup in format cmp, to the subsites created using new template :

 

 

$spsite= "http://abc:1104"

$mainBackuppath="\\abc2010\exportimport"

$File="export.txt"

Get-SPSite -Identity $spsite | Get-SPWeb -limit all| ForEach-Object {

 

 

 

if(($_.URL -eq $spsite+"/xyz") -or ($_.URL -eq $spsite+"") -or ($_.URL -eq $spsite+"/lmn") )

{

write-host -f Green  "Skipping " $_.URL

"Skipping " + $_.URL | Out-File $File -append

 

}

else

{

 

write-host -f Green "processing for "  $_.URL

"processing for " + $_.URL | Out-File $File -append

 

$currentSubSiteTitlewithoutspace= ""

$currentSubSiteTitlewithoutspace=$_.Title.Replace(" ","")

write-host -f Blue "Checking if directory exist for current web"

"Checking if directory exist for current web" | Out-File $File -append

$filesystemPath=""

$filesystemPath =$mainBackuppath+"\"+$currentSubSiteTitlewithoutspace+"\"+$currentSubSiteTitlewithoutspace+".cmp"

 

if(Test-Path $filesystemPath)

{

 

$DocLibPath=""

$DocLibPath= "/"+$_.Title+"/Shared Documents"

write-host  -f Yellow "Restoring  Backup at  "$DocLibPath " from  " $filesystemPath "...."

"Restoring  Backup at  "+$DocLibPath +" from  " +$filesystemPath +"...." | Out-File $File -append

 

$error.clear()

Import-SPWeb -Identity $_.URL -Path $filesystemPath  -IncludeUserSecurity  -Force -UpdateVersions Overwrite | Out-File $File -append

if($error.count -gt 0){$error | out-file $File -append}

 

write-host  -f Yellow "Backup for "$DocLibPath " at location " $filesystemPath "Completed."

"Backup for "+$DocLibPath +" at location " +$filesystemPath +"Completed." | Out-File $File -append

 

}

else

 

{

write-host  -f Red $filesystemPath  " does not exist."

$filesystemPath  +" does not exist." | Out-File $File -append

 

}

 

 

 

write-host -f Green "End of "  $_.URL"`n`n`n`n"

"End of "  +$_.URL+"`n`n`n`n" | Out-File $File -append

 

 

}

 

}

 

___________________________________________________________________________________________________________________

description of commands being used:

 

 

1.       Get-SPSite  : creates object for the spsite as given by identity parameter.

2.       Get-SPWeb -limit all  gets all the  spweb in the site collection

 

3.       Out-File $File –append   :  put entry in a log file.

 

4.       write-host -f Green "processing for "  $_.URL :  to write a text on screen

 

5.       $error.clear() : clears the current error

6.       [IO.Directory]::CreateDirectory()  : used to create a folder on the shared path

 

 

7.       if($error.count -gt 0){$error | out-file $File –append :  if the error count is greater than 0, that is logged in the log file.

 

 

8.       Test-Path $filesystemPath  : verifies if the folder has been created

 

9.       export-spweb -identity $_.URL   -path  $filesystemPath   -ItemUrl $DocLibPath -Force -IncludeUserSecurity -IncludeVersions All | Out-File $File –append

: the heart of all commands, which is actually creating the cmp file

 

10.   Import-SPWeb -Identity $_.URL -Path $filesystemPath  -IncludeUserSecurity  -Force -UpdateVersions Overwrite | Out-File $File –append

: the heart of all commands, which is actually restoring   the cmp file.

Monday, June 21, 2010

Microsoft.SharePoint.WebPartPages.ToolPart , page needs a refresh to apply changes back to web part

Hi

 

I have a problem with custom tool part. The page needs a refresh before the changes are actually visible in the web part.

Either user have to hit apply then OK in Tool Part, or after directly hitting Ok he needs to refresh the page.

 

Seems to be create child control of web part  being called before applychanges of tool part.

 

Any pointers ?

Reply 1

This is a common issue with custom properties in SharePoint webpart.

Just try call the method that modifies your custom property in the PreRender event.

For more check these links:

http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/6445d939-05da-4ce9-a2cf-3e9fe28b98ee

http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/5b85a5dc-37aa-49d7-a741-d40c7bd2bd0c




BR, PM

Reply 2

Hi

 

Thanks for you guidance,

I had to use a property from custom tool part to a script in the usercontrol( inside our web part).

calling my RegisterStartUpScript inside OnPreRender in user control solved my problem.

 

Thanks

Reply 3

Awesome news!!




BR, PM

 

Friday, June 1, 2007

How far I should go with customization ........

Almost every SharePoint project starts with elaborating  what the current version of SharePoint supports as Out of Box  feature .

But at the end of the day , level of customization we require in these OOB feature is huge.

To make it easy for future upgrades and better performance and really really get what Microsoft promise , we should be inclined towards no  customization.