martedì 17 giugno 2014

PowerGUI errore script sharepoint

Se con PowerGui provate ad eseguire dello script per SharePoint e ricevete questo errore:
 Get-SPWebApplication : Microsoft SharePoint is not supported with version 4.0.30319.2012 of the Microsoft .Net Runtim
At F:\PowerShellScripts\Get ContentTypes.ps1:3 char:31
+ $webapp = Get-SPWebApplication <<<<  $targetWebApp
    + CategoryInfo          : InvalidData: (Microsoft.Share...tWebApplication:SpCmdletGetWebApplication) [Get-SPWebA 
   pplication], PlatformNotSupportedException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SpCmdletGetWebApplication

Could you please try a workaround and let me know if it helps.
Close ScriptEditor
Find ScriptEditor.config file in the Installation directory.
By default it is placed in %ProgramFiles(x86)%\PowerGUI folder on 64bit OS or in %ProgramFiles%\PowerGUI on 32bit OS.
Comment the support of .NET 4 line:

lunedì 16 giugno 2014

Quale versione di Sharepoint hai installato?

Lanciare nella PowerShell di Sharepoint questo comando:

SharePoint 2010
BEED1F75-C398-4447-AEF1-E66E1F0DF91E: SharePoint Foundation 2010
1328E89E-7EC8-4F7E-809E-7E945796E511: Search Server Express 2010
B2C0B444-3914-4ACB-A0B8-7CF50A8F7AA0: SharePoint Server 2010 Standard Trial
3FDFBCC8-B3E4-4482-91FA-122C6432805C: SharePoint Server 2010 Standard
88BED06D-8C6B-4E62-AB01-546D6005FE97: SharePoint Server 2010 Enterprise Trial
D5595F62-449B-4061-B0B2-0CBAD410BB51: SharePoint Server 2010 Enterprise
BC4C1C97-9013-4033-A0DD-9DC9E6D6C887: Search Server 2010 Trial
08460AA2-A176-442C-BDCA-26928704D80B: Search Server 2010
84902853-59F6-4B20-BC7C-DE4F419FEFAD: Project Server 2010 Trial
ED21638F-97FF-4A65-AD9B-6889B93065E2: Project Server 2010
926E4E17-087B-47D1-8BD7-91A394BC6196: Office Web Companions 2010

lunedì 26 maggio 2014

SharePoint 2013 - Installazione Completa su macchina non registrata a dominio (WORKGROUP)

Se avete la necessità di installare SharePoint 2013 Foundation i modo completo su una macchina non registrata a dominio, su cui gira anche SQL Server bisogna:

  1. quando viene richiesto disabilitare il flag "Run the SharePoint Products Configuration Wizard now."
  2. aprire la console "PowerShell" di SharePoint 2013 ed eseguire questo comando:
  3. New-SPConfigurationDatabase

  4.  dopo ricordatevi di lanciare "SharePoint 2013 Products Configuration Wizard" e di fare in modo che si connetta al database appena creato.

lunedì 31 marzo 2014

SharePoint 2010 - Configurare e abilitare Windows WorkSpace

fonte di questo articolo Jeff Widmer's Blog

Configuring SharePoint Foundation 2010 for SharePoint Workspace 2010

SharePoint Workspace 2010 is the new version of Groove that will give you an offline copy of a SharePoint website and also allow you to work with a SharePoint site outside of a browser.  SharePoint Workspace 2010 is especially nice for editing documents in a SharePoint Document library.  SharePoint Workspace makes the SharePoint Document Library work just like a folder on your computer and will handle the synchronization of the documents back to the SharePoint server for you.
If you try connecting SharePoint Workspace 2010 to a default SharePoint Foundation 2010 installation you may get an error like this one:
Sync to SharePoint Workspace 
SharePoint Workspace was unable to interpret the SharePoint location. Please check and ensure the location contains no typing errors. 
OK Help 
This is because the default configuration of SharePoint Foundation 2010 requires two configuration changes to allow SharePoint Workspace 2010 to work.
The first is to enable the Remote Differential Compression feature on the server that is hosting SharePoint.  This is used by SharePoint Workspace 2010 to send and receive the files for synchronization.
To enable Remote Differential Compression go to the Server Manager > Features and choose Add Features.
Check the box for the Remote Differential Compression feature and then click Install to enable this feature.

The second configuration change to allow SharePoint Workspace 2010 to work with your SharePoint Foundation 2010 server is to add an Alternate Access Mapping of the public facing DNS name (or IP address) to SharePoint using the SharePoint Central Admin.  If you are connecting to your SharePoint site using the machine name then this is not necessary, but if you are connecting over the Internet through either an IP address or DNS name then you will need to add this alternate access mapping.
The reason is that when SharePoint is first installed, the only way it thinks users are connecting to the server is through the machine name: http://machine_name (as if on a local intranet).  Since most likely SharePoint Workspace 2010 users will be connecting through a public facing DNS name (or IP address), you will need to add this DNS name (or IP address) as an alternate access mapping (indicating that this DNS name is the same as the machine_name and should map to the SharePoint site).
To add an Alternate Access Mapping to SharePoint Foundation 2010, visit the SharePoint Central Administration on the SharePoint Foundation 2010 server:
Once in the SharePoint Central Administration website, click on the Application Management link
Then under the Web Applications heading choose Configure alternate access mappings
Choose Edit Public URLs
And then select the public facing SharePoint website that you want to add an access mapping to.  You do this by changing the Alternate Access Mapping Collection (clicking on the “No selection” drop down button) to the website that is running on Port 80.
The  default name of the public facing SharePoint site is “SharePoint – 80” but you may have changed that when you configured your SharePoint site.
Once you have switched the Alternate Access Mapping Collection to the public SharePoint website (SharePoint – 80) then you can specify the Public URL by adding the publically accessible IP Address or DNS name to the Internet field:
Click Save to apply the alternate access mapping and now you should be able to connect to your SharePoint Foundation 2010 site with SharePoint Workspace 2010:

SharePoint Foundation 2010 is the free version of SharePoint that installs on top of Windows Server 2008.  With SharePoint Workspace 2010 you can get an offline copy of your SharePoint team site allowing you to add/edit your documents in any SharePoint document library easily and allow SharePoint Workspace 2010 to handle the file synchronization for you. 
You can take a look at SharePoint Foundation 2010 quickly and easily by starting apreconfigured SharePoint Foundation 2010 Virtual Machine at is a new Internet startup that provides preconfigured virtual machines (such as a virtual machine with SharePoint Foundation 2010 already installed) that are ready for you to start and begin using right away. takes the hassle out of downloading and installing the Windows Server 2008 operating system and SharePoint Foundation 2010 so that you can quickly log in and begin trying out the new features of SharePoint Foundation 2010.

venerdì 28 marzo 2014

SharePoint 2010 - Personalizzare SPAlerts

fonte di questo articolo Bernd's blog

Custom SPAlerts

You can modify the SharePoint standard alerts by modifying an existing alert definition in the alerttemplates.xml. The following steps are useful:
  1. Create your copy template file in  \templates\xml.
  2. Register the new alerttemplates file using STSADM.
  3. Customize the alert template.
  4. Add the SPAlert objects in your application.
Step 1. Create your copy template file in  \templates\xml. It is a good idea to leave the alerttemplates.xml untouched. To implement your own template simply take a copy of the file and remove all but one alert template. Remember to rename the alert template.
Step 2. Register the new alerttemplates file using STSADM.
Before you can use the new template you need to register the newly created template file with the following command:
STSADM -o updatealerttemplates -url [SITECOLLECTIONURL] -filename "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\XML\alerttemplates_custom.xml"

Step 3. Customize the alert template. Refer to the following articles for an overview of the alert template.
These articles are not very specific. Therefore I will dive into the details here.
Basically there are three alert types in SharePoint: Immediate, Daily and Weekly. The alert template has only two elements: Immediate and Digest. Use the Digest section for both daily and weekly alert. You can use the following to implement daily or weekly functionality:

        <!– Daily –>
        <!– Weekly –>

        <!– Daily –>
        <!– Weekly –>


In general, the fields or rowFields section are the core of the template. All content type fields that you did not explicitly exclude (ImmediateNotificationExcludedFields or DigestNotificationExcludedFields) will have the mark-up specified here applied. Think of it as a foreach loop that iterates over all content type fields. If you want to make the rendering dependent on the field name you can use the following xml:
            <!– Title –> 
                    <!– Do something useful here. –> 
The above example renders only for the ‘Title’ field. I use this method to render a link to the created page for the title and normal text for the other fields.
Step 4. Add the SPAlert objects in your application. To add an alert programmically you can use the following code:
guid = channelWeb.Alerts.Add(list, SPEventType.Modify | SPEventType.Add, SPAlertFrequency.Immediate);
SPAlertTemplate alertTemplate = new SPAlertTemplate();
alertTemplate.Name = SP_ALERT_TEMPLATE_NAME;
channelWeb.Alerts[guid].AlertTemplate = alertTemplate;
channelWeb.Alerts[guid].Title = "Title";
channelWeb.Alerts[guid].EventTypeBitmask = 3;
channelWeb.Alerts[guid].Filter = "… some CAML query …";
I figured that it is quite important to do exatly as the example shows. You do not have to update the SPWeb or SPList object. Set both the EventType and EventTypeBitmask. If you are not sure of the correct value for the EventTypeBitmask create some standard SharePoint alerts and check the values with SharePoint Manager.
If you want to read back the alerts that were created use the SPWeb.Alerts property. You will have to run your code with ElevatedPriviliges to avoid an UnauthorizedException when the AlertCollection has alerts from ohter users as well. Use the SPAlert.User.Id to filter the alerts for the current user.
If you want to delete alerts from SPWeb.Alerts collection you also need to use ElevetatedPriviliges and set SPWeb.AllowUnsafeUpdates to true.
Setting the SPAlert.Filter property to a valid CAML query that was produced with U2U CAML Builder resulted consequently in this error:
SPAlert.Query = "";
Exception: Microsoft.SharePoint.SPException: Cannot complete this action.
Please try again. —> System.Runtime.InteropServices.COMException (0×80004005): Cannot complete this action.
This means in SharePoint language that you must not use the element in filter CAML queries. The following query works as expected:
SPAlert.Query = "";
It is important to set the SPAlert.EventTypeBitmask according to the SPAlert.EventType.

giovedì 27 marzo 2014

SharePoint - Segnalazione operazione lunga

Nel caso avete un'operazione custom che impiega qualche istante ad essere eseguita e si vuole fare in modo che l'utente capisca che il sistema ha preso in carico la vostra richiesta (es. click su un bottone), utilizzate questo codice per segnalare all'utente l'operazione che sta eseguendo il sistema e che ci vorrà qualche istante...

using (SPLongOperation provision = new SPLongOperation(this.Page))
    provision.LeadingHTML = "Operation description";
    provision.TrailingHTML = "Please wait...";

mercoledì 26 marzo 2014

lunedì 17 marzo 2014

Windows - Installazione certificato in "Autorità di certificazione radice attentibili" / "Trusted root certification authorities"

Se per caso cercate di installare un certificato all'interno dell'archivio "Autorità di certificazione radice attentibili" (Trusted root certification authorities) e ricevete questo messaggio di errore:

ITA: Importazione non riuscita per uno dei seguenti motivi: l'archivio era di sola lettura o pieno oppure si è verificato un errore in apertura dell'archivio

ENG: The import failed because the store was read-only, the store was full, or the store did not open correctly.

Provate ad importare il certificato in questo altro modo:

  1. Scaricare e salvare il certificato
  2. Aprire il Gestore dei certificati
  3. Aprire dal menu start "Esegui comando" (WindowsButton+R) e scrivete "certmgr.msc" (senza apostrofi).
  4. Avete aperto il gestore dei certificati
  5. Fate tasto destro su "Trusted Publishers" presente nella lista dei folder a sinistra, e selezionare la voce "All Tasks" >> "Import"
  6. Premsere sul bottone "Next" 
  7. Premere sul bottone "Browse" 
  8. Selezionare il certificato che avete scaricato precedentemente, e premete su "Open"
  9. Premere "Next"
  10. Selezionare "Place all certificates in the following store"
  11. Premere su "Browse" 
  12. Selezionare il check "Show physical stores"
  13. Espandere il folder "Trusted Publishers" 
  14. Selezionare "Local Computer"
  15. Selezionare il bottone "OK" 
  16. Selezionare il bottone "Next" 
  17. Selezionare il bottone "Finish" 
  18. Riceverete il messaggio "The import was successful".