Friday, August 30, 2013

PowerShell vs stsadm in SharePoint 2010 - Solution Deployment

  • Add solution
  • stsadm –o addsolution –name SharePointProject2.wsp
  • Add-SPSolution c:\code\SharePointProject2\bin\debug\SharePointProject2.wsp

  • Deploy Solution
  • stsadm –o deploysolution –name SharePointProject2.wsp –url http://moss-server –allowCasPolicies –immediate
  • Install-SPSolution –Identity SharePointProject2.wsp –WebApplication http://sp2010 -GACDeployment


  • Upgrade Solution
  • stsadm –o upgradesolution –name SharePointProject2.wsp –filename SharePointProject2.wsp –immediate –allowCasPolicies
  • Update-SPSolution –Identity SharePointProject2.wsp –LiteralPath c:\code\SharePointProject2\bin\debug\SharePointProject2.wspGACDeployment

  • Remove Solution.
  • Uninstall-SPSolution –Identity SharePointProject2.wsp –WebApplication http://sp2010
  • Remove-SPSolution –Identity SharePointProject2.wsp


Source:
http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2009/12/02/adding-and-deploying-solutions-with-powershell-in-sharepoint-2010.aspx

Feature vs. Solution

http://manish-sharepoint.blogspot.com/2010/01/difference-between-solution-and-feature.html

Error occurred in deployment step ‘Activate Features’: Feature with Id ‘’ is not installed in this farm, and cannot be added to this scope.

I am upgrading a RSS reader web part used in our MOSS farm for use in the new 2010 MSF farm.
I had it almost complete but could not get it to deploy and activate without an error.  The error message:

Error occurred in deployment step ‘Activate Features’: Feature with Id ‘<GUID>’ is not installed in this farm, and cannot be added to this scope.”
Would come up each time I deployed the feature.

This issue was driving me crazy until I found Graham Alltoft's post:
- http://alltoft.wordpress.com/2011/06/13/sp2010-error-occurred-in-deployment-step-activate-features/

Solution: 

Use powershell to activate the feature not VS 2010

  • Set the project to No Activation
  • Deploy from Visual Studio again with no activation this time
  • Open powershell
  • Install-SPFeature <yourFeature>
  • Enable-SPFeature <yourFeature> -Url http://yoursite.com

  • or

    In central admin go to the solution management and activate the solution with the GUI

    Tuesday, August 27, 2013

    Content Database Current Site Count is 0

    Upgrading a 2007 SP2 content database to 2010 content database.  Using the Mount-SPContentDatabase shell and having good success.  Ran into this one and was stumped.

    I would submit the command

    Mount-SPContentDatabase SharePoint_Content_01 –databaseserver <servername> -WebApplication <serverurl>

    The result would execute and return the command:

    ID                        : <Guid>
    Name                   : SharePoint_Content_01
    WebApplication  : Web - 80
    Server                  : <SQLServer\SchemaName>
    CurrentSiteCount: 0

    Issue:
    Why would there be 0 sites?  I have at least 10.

    Solution:
    Check the spelling of your content database.  The mount command does not check for the content database.  If it does not exist it will create it for you automatically.

    I purused this site http://sharepoint.stackexchange.com/questions/29719/content-database-shows-no-site-collections and stumbled across this issue.




    Thursday, August 22, 2013

    Adding a Button to the Ribbon in SharePoint 2010

    Create your own Custom Action Group with a Custom Action


    Rather than reinventing the wheel by writing my own set of instructions, please refer to this MSDN article:

    Tuesday, August 20, 2013

    DotPeek .Net decompiler

    I was looking around for a copy of the decompiler and could not find it. 
    The url is
    http://www.jetbrains.com/decompiler/

    This tool will decompile any .net dll from 1.0-4.5!

    Wednesday, August 14, 2013

    Microsoft SQL Server Migration Assistant (SSMA)

    The Upsizing Wizard built into Access does not bring over the "queries" in the Access database.
    I surmise these are the equivalent of stored procedures.  Not sure why the upsizing did not bring this over.  I did find this nice add on from Microsoft which claims to migrate from Access to SQL server.

    Microsoft SQL Server Migration Assistant (SSMA) for Access is a tool to automate migration from Microsoft Access database(s) to SQL Server or SQL Azure

    http://www.microsoft.com/en-us/download/details.aspx?id=28763
    http://blogs.msdn.com/b/ssma/archive/2011/01/28/access-to-sql-server-migration-how-to-use-ssma.aspx

    Migrate from Access to SQL


    NOTE: If you are using Access 97 and higher versions, you can also use the SQL Server Migration Assistant for Access. For more information about the SQL Server Migration Assistant for Access, visit the following Microsoft Web site:

    http://www.microsoft.com/sqlserver/en/us/product-info/migration-tool.aspx#Access


    The easiest way to convert an Access database to SQL Server is to use the Upsizing Wizard. The Upsizing Wizard:
    • Preserves database structure, including data, indexes, and default settings.
    • Automatically converts Access validation rules and default settings to the appropriate SQL Server equivalents.
    • Maintains table relationships and referential integrity after you upsize.


    http://answers.microsoft.com/en-us/office/forum/office_2007-access/export-access-table-schema-to-sql/8a6d1052-86b0-4080-9147-6c2c64ba1d9c

    MSDN downloads without Akami download manager

    I was trying to get some bits off of the MSDN site today and hit the dreaded AKAMI block!

    Our local policies do not permit the installation of Active X controls on our local machines.  Surfing directly to the MSDN site and hitting the download button will either load the Akami manager or prompt you to install the control.  Of course, this fails since we do not have the permissions to load on our local machines.  So what to do??

    The help on MSDN was kind enough to elaborate on the issue

    Direct download option

    Files are also available from Subscriber Downloads using your browser only, rather than any download manager. You may use this option if you prefer downloading with your browser, or if you are unable to run ActiveX-based download managers due to the security or proxy settings at your organization.
    To find the Direct Download link for a particular file, select Details under the filename. From the Permalinks displayed under Details, select Direct Download to start a file download using your browser’s download manager.




    Wednesday, August 7, 2013

    A service application database was deleted in SQL Server Management Studio


    Solution
    Using PowerShell, run the following command:
    Get-SPDatabase | where {$_.exists -eq $false}
    This will list all databases in SharePoint that no longer exist on the database server. If you are happy with the result and wish to remove the orphaned databases, run the following command:
    Get-SPDatabase | where {$_.exists -eq $false} | foreach {$_.delete()}

    Source:
    http://www.mysharepointadventures.com/2012/02/cleaning-up-deleted-databases-in-sharepoint/

    Event 5402, SharePoint Foundation - SeSecurityPrivilege - Tracing Service failed

    Installing a new instance of SharePoint 2010. We will be migrating some 2007 content database using the attach and upgrade method. For now we are just trying to get the box set up and running.

    Using Powershell:
    New-SPConfigurationDatabase -DatabaseName SharePoint_Config -DatabaseServer DBNAME\INSTANCE -AdministrationContentDatabaseName SharePoint_Admin_Content

    I am running powershell as the service account which is installing the application. This account has been granted permissions on SQL (db_creator, security Admin)

    Each time it runs I get flagged with this error:
    Tracing Service failed to create the usage log file at ...\14\Logs. Error 0x0: The process does not possess the 'SeSecurityPrivilege' privilege which is required for this operation.

    Clinton Cherry at Cherry Bytes put me on to the fix for my configuration:

    In order to fix this you will need to do the following:
    Go to > Local Security Policy- > Local Policies -> User Rights Assignment on the server you are trying to install on.
    Assign your logged in account (eg [domain]/[username]) the following rights:
    • Back up files and directories
    • Debug Programs
    • Manage auditing and Security log
    • Restore files and directories
    • Take ownership of files or other objects

    What if your box locks down these policies.

    The SeSecurityPriv is tied to the Manage auditing and Security Log policy.  This was granted to only the members of the local Auditors group.  I added our service account to the auditor's group and rebooted the box.  I then reran the New-SPConfigurationDatabase command and successfully created the Admin and AdminContent dbs.

    Migration Guide SharePoint 2007 to 2010

    This document outlines the setup for a migration from 2007 to 2010
    SharePoint 2010 Installation with Powershell_Sep2012.docx


    Update:  Plenty of good sites on the how tos.  This site lays out
    the steps well

    http://www.sharepointdiary.com/2011/09/migrate-from-moss-2007-to-sharepoint-2010.html