Etykiety

Pokazywanie postów oznaczonych etykietą SharePoint 2013. Pokaż wszystkie posty
Pokazywanie postów oznaczonych etykietą SharePoint 2013. Pokaż wszystkie posty

niedziela, 21 czerwca 2015

Create SendTo connection programmatically

private const string CONTENT_ORGANIZER_URL = "/_vti_bin/officialfile.asmx";

/// To run this code without Access Denied error, RemoteAdministratorAccessDenied must be set False. Do it with PowerShell:
/// $contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
/// $contentService.RemoteAdministratorAccessDenied = $false
/// $contentService.Update()
SPSecurity.RunWithElevatedPrivileges(delegate()
{
SPWebApplication webapp = newRC.WebApplication;
       var newhost = new SPOfficialFileHost(true);
       newhost.OfficialFileUrl = new Uri("url of site with content organizer feature on" + CONTENT_ORGANIZER_URL);
       newhost.OfficialFileName = "Your connection name";
       newhost.Explanation = "Your connection description";
       newhost.ShowOnSendToMenu = false;
       newhost.Action = SPOfficialFileAction.Move;
webapp.OfficialFileHosts.Add(newhost);
webapp.Update();
});


wtorek, 10 września 2013

Przeniesienie SharePoint Server 2013 na nową maszynę wirtualną

Na poprzedniej maszynie:


  1. Sporządzić listę baz danych używanych przez SharePoint server: Central Administration -> Upgrade and Migration -> Review database status
  2. Shutdown IIS
  3. Zatrzymać wszystkie windows services związane z SharePoint-em.

Przenosiny:


  1. Przenieść wszystkie bazy danych na nowy SQL server (Backup+Restore)
  2. Przenieść obraz maszyny wirtualnej z SharePoint server. Jeśli była to instalacja SharePoint+SQL Express na jednej maszynie, poprzedni punkt jest oczywiście zbędny. 

Na nowej maszynie:

  1. Uruchomić Sql Server Configuration Manager w celu zdefiniowania aliasów. Należy utworzyć identyczne aliasy dla SQL Native Client [VERSION] Configuration (dla 32 i 64 bitowego):
    - w polu Alias Name wpisać nazwę Sql Servera z poprzedniej maszyny,
    - skopiować nazwę do pola Server i zmodyfikować wpis o nazwę bieżącej maszyny.
  2. Aby aliasy działały, trzeba używać protokołu TCP/IP. W Sql Server Configuration Manager wejść do SQL Server Network Configuration>Protocols for SHAREPOINT. TCP/IP powinien być włączony a Shared Memory wyłączony.
  3. Wykonać restart maszyny
  4. Uruchomić sharepoint-owe windows services,  
  5. Odszukać windows service SQL Server Browser i uruchomić/upewnić się że działa.
  6. Sprawdzić czy SharePoint łączy się z właściwym serwerem bazy danych za pomocą procedury składowanej sp_who,
  7. Należy zmienić nazwę serwera ShaerPointa za pomocą programu stsadm.exe. Dla wersji 2013 znajduje się on w folderze: C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\BIN.
    Polecenie zmiany nazwy serwera:
    stsadm -o renameserver -oldservername <YourOldServerName> -newservername <YourNewServerName>

czwartek, 23 maja 2013

Enable Session State in Sharepoint 2013

1. Run in PowerShell:
Enable-SPSessionStateService –DatabaseName "<your database name>"
or, if you don't mind guids in database names:
Enable-SPSessionStateService -DefaultProvision

2. Open web.config of the WebApplication where you want SessionState to be enabled and change line
<pages enableSessionState="false" (...)
to
<pages enableSessionState="true" (...)

3. Restart IIS

poniedziałek, 4 lutego 2013

Migrating WebApplication from SP2010 to SP2013

1. Take the backup of web application content database on SharePoint 2010  from sql server using Sql Server Management Studio

2. On SharePoint 2013 create new web application. Pay attention that on SharePoint 2010 your application probably has classic-mode authentication, while on SharePoint 2013 the default is claims-based authentication. To create classic-mode web application in a SharePoint 2013, execute this command in PowerShell:
New-SPWebApplication –name "<WebAppName>"
–Port <PortNumber>
–ApplicationPool "<AppPoolName>"
–ApplicationPoolAccount (Get-SPManagedAccount "<Domain>\<AccountName>")

To use an existing application pool, provide only application pool name, without account.


3. Deploy all required farm solutions to the new web application

4. Remove content database from newly created web application in Central Administration > Manage Content Databases

5. Detach or delete the content database using Sql Server Management Studio

6. Now restore the backuped database.

7. Attach the restored content database to new web application using PowerShell:

Mount-SPContentDatabase -Name <DatabaseName> -DatabaseServer <DBServerName> -WebApplication <WebAppURL>