Activating all Publishing Feature – Programmatically & Powershell – SharePoint 2010, 2013, 2016 & Online:

Hi Everyone!!!

Today i will talk about Publishing Features!!! During this afternoon I was trying to activate Publishing Features but i wasn’t having success because Page Library not was created on activation! So there are more than two Publishing Feature that we need have in consideration, it’s not enough Activate Publishing Infrastructure Feature and Publishing Feature. If you want activate all Publishing Features you can do it pragmatically or using Powershell script:

SharePoint Server – Powershell:

 
Disable-SPFeature –identity 'publishingSite' -URL http://server/ -force
Disable-SPFeature –identity 'PublishingResources' -URL http://server/-force
Disable-SPFeature –identity 'Publishing' -URL http://server/ -force
Disable-SPFeature –identity 'PublishingLayouts' -URL http://server/ -force
Disable-SPFeature –identity 'publishingweb' -URL http://server/ -force

Enable-SPFeature –identity 'publishingSite' -URL http://server/ -force
Enable-SPFeature –identity 'PublishingResources' -URL http://server/ -force
Enable-SPFeature –identity 'Publishing' -URL http://server/ -force
Enable-SPFeature –identity 'PublishingLayouts' -URL http://server/ -force
Enable-SPFeature –identity 'publishingweb' -URL http://server/ -force

SharePoint Online – Powershell:

 
Disable-SPOFeature –Identity "F6924D36-2FA8-4f0b-B16D-06B7250180FA" -Scope Site
Disable-SPOFeature –Identity "AEBC918D-B20F-4a11-A1DB-9ED84D79C87E" -Scope Site
Disable-SPOFeature –Identity "22A9EF51-737B-4ff2-9346-694633FE4416" -Scope Web
Disable-SPOFeature –Identity "D3F51BE2-38A8-4e44-BA84-940D35BE1566" -Scope Site
Disable-SPOFeature –Identity "94C94CA6-B32F-4da9-A9E3-1F3D343D7ECB" -Scope Web

Enable-SPOFeature –Identity "F6924D36-2FA8-4f0b-B16D-06B7250180FA" -Scope Site
Enable-SPOFeature –Identity "AEBC918D-B20F-4a11-A1DB-9ED84D79C87E" -Scope Site
Enable-SPOFeature –Identity "22A9EF51-737B-4ff2-9346-694633FE4416" -Scope Web
Enable-SPOFeature –Identity "D3F51BE2-38A8-4e44-BA84-940D35BE1566" -Scope Site
Enable-SPOFeature –Identity "94C94CA6-B32F-4da9-A9E3-1F3D343D7ECB" -Scope Web

Also that you can activate Programmatically:

 

        private void ActivatePublishingFeatures(SPWeb web, SPSite site)
        {
            // Publishing Site
            string sharePointPublishingSite = "f6924d36-2fa8-4f0b-b16d-06b7250180fa";
            Guid sharePointPublishingSiteGuid = new Guid(sharePointPublishingSite);

            if (site.Features[sharePointPublishingSiteGuid] == null)
            {
                site.Features.Add(sharePointPublishingSiteGuid, true);
            }

            // Publishing Resources
            string sharePointPublishingResources = "aebc918d-b20f-4a11-a1db-9ed84d79c87e";
            Guid sharePointPublishingResourcesGuid = new Guid(sharePointPublishingResources);

            if (site.Features[sharePointPublishingResourcesGuid] == null)
            {
                site.Features.Add(sharePointPublishingResourcesGuid, true);
            }

            // Publishing
            string sharePointPublishing = "22a9ef51-737b-4ff2-9346-694633fe4416";
            Guid sharePointPublishingGuid = new Guid(sharePointPublishing);

            if (web.Features[sharePointPublishingGuid] == null)
            {
                web.Features.Add(sharePointPublishingGuid, true);
            }

            // Publishing Layouts
            string sharePointPublishingLayouts = "d3f51be2-38a8-4e44-ba84-940d35be1566";
            Guid sharePointPublishingLayoutsGuid = new Guid(sharePointPublishingLayouts);

            if (site.Features[sharePointPublishingLayoutsGuid] == null)
            {
                site.Features.Add(sharePointPublishingLayoutsGuid, true);
            }

            // Publishing Web
            string sharePointServerPublishingWeb = "94c94ca6-b32f-4da9-a9e3-1f3d343d7ecb";
            Guid sharePointServerPublishingWebGuid = new Guid(sharePointServerPublishingWeb);

            if (web.Features[sharePointServerPublishingWebGuid] == null)
            {
                web.Features.Add(sharePointServerPublishingWebGuid, true);
            }
        }

Thanks

Fábio Carvalho
SharePoint Consultant
|create|it|

 

 

Office 365 – New Microsoft Forms

Hi Everyone!!

Recently Microsoft introduce the new Microsoft Forms!!! I confess this solution it is amazing because provides a new way to build Forms and Surveys with a friendly interface and very rich in terms of features and potential… we at Create IT had the opportunity to explore and use it a lot to get some feedback about some events that we are planning.

Microsoft Forms is available on your App Launch of your Office 365.

It is easy to create a Form, you will have different types of question like Choice, Test, Rating and Date. Also you can apply a default Theme or you can upload your custom picture and will be the background of your Form.

You have a special tab – Response -where you can look all the responses of your team an get the results.

Today Microsoft introduce a new Feature – Excel Survey – this update allows Microsoft Excel users to easily create surveys and collect responses within their workbooks, and take advantage of most of the features available in Microsoft Forms.

 

A new type of question was introduced – Ranking –  users  can now ask respondents to rank answer choices, and their responses will be aggregated and visualized for easy analysis. Ranking is a great way for survey creators to understand their personal preferences.

Microsoft Forms and Microsoft Flow integration are connected, users can now define connectors for Microsoft Forms via Microsoft Flow. A great use case for this is setting up a connector to receive the email notifications whenever a new response is submitted for a survey or quiz.

 

Thanks

Fábio Carvalho
SharePoint Consultant
|create|it|

A minute’s silence in memory of Paint!

Hi Everyone!!!

Today i will talk about one of the funniest tool that contributed for my passion about Microsoft products when i had 8 years old!! PAINT!! Yes, Paint as we know it… a simplistic tool with 32 years my old friend, i confess I still use it for some tasks. And today was announced yours finish, the new update for Windows 10 will replace it for the new version Paint 3D! This version is more fun, totally re-branding with new 3D capabilities, so many of the MS Paint features people know and love like photo editing, line and curve tools, and 2D creation are in Paint 3D.

Download Paint 3D from the Windows Store

Thanks

Fábio Carvalho
SharePoint Consultant
|create|it|

SP Editor – Create and update SharePoint Online/SP2013/SP2016 css/js files, inject files to web, manage web properties and list Webhook

Hi Everyone!!!

Today i will share a fantastic Google Chrome Extension that you can use on your developments on SharePoint.

A Google Chrome Extension for creating and updating files (js, css), injecting files to sites, modifying web/list propertybag values (add, edit, remove, index) and creating webhook subscriptions, edit/add/remove webparts from publishing pages and run sp-pnp-js typescript snippets in SP2013, SP2016 and SharePoint Online from Chrome Developer Tools.

https://chrome.google.com/webstore/search/speditor

Take a look at  the great introduction video by Jeff Jones!

Thanks

Fábio Carvalho
SharePoint Consultant
|create|it|

 

SharePoint Online – Internal Fields Names & how to use SPServices to get them!!!

Hi Everyone,

Today i will show you how can you get internal field names in a SharePoint List Items.
As you know SharePoint have two types of Names – Internal Name and Display Name, it is extremity important when you are developing SharePoint solution get your fields by internal name, the InternalName never changes, you only can change DisplayName, this maintain your solution stable.

So let’s Look some ways to get the Internal Name:

  1. Open the List Settings page
  2. Under the Columns section, select a column to view the Edit Column page
  3. The URL of this page includes the internal name in the query string. For example, the URL for the Created By field includes the following query string List=%7BF641CEF1%2DCDE2%2D49E1%2D9800%2D861A408EF890%7D&Field=Author. The value for the Field parameter, Author, is the internal name for Created By.

You can also apply a sort order on your list view on the column that you want get the internal name, this will generate an URL that contains the Internal Name:

FolderCTID%3D0x012000DDDEBA09D4201845A62AEDBA6A906745-SortField%3DAuthor-SortDir%3DAsc-

Now i will demonstrate how you can get Internal Name by Display Name using SPGetStaticFromDisplay

 

var internalName = $().SPServices.SPGetStaticFromDisplay ({
  listName: "Cars",
  columnDisplayName: "Car Models"
});

Read more: http://sympmarc.com/2015/01/27/get-the-internalname-for-a-sharepoint-list-column/

Thanks

Fábio Carvalho
SharePoint Consultant
|create|it|

 

SharePoint – Get all alerts from a specific SP List/Library using Powershell

Hey Everyone!!!

Today i will talk about List and Library Alerts and how can you get all Active alerts for a specific list using powershell script and how can you disable all alerts.

This is very useful script, when you need move a large list of items on a maintenance routine and you don’t want send a large number of emails/ notifications for users who subscribe alerts, this script help you disable and enable them.

This first PowerShell Script get all SharePoint list alerts with state active.

 

Add-PSSnapin Microsoft.SharePoint.PowerShell –ErrorAction SilentlyContinue

#Variables
$WebURL = "http://YourWebUrl"
$ListName="YourListName"

#Function to Get All Active Alerts on a Given List
Function Get-ListAlerts($WebURL, $ListName)
{
  #Get the Web and List objects
  $Web = Get-SPWeb $WebURL
  $List = $web.Lists.TryGetList($ListName)

  #Get All Alerts created in the list - Which are Active
  $ListAlerts = $Web.Alerts | Where-Object {($_.List.Title -eq $List.Title) -and ($_.Status -eq "ON")}

  foreach($Alert in $ListAlerts)
  {
          write-host "Alert' - $($Alert.Title)' Created for User - '$($Alert.User.Name)'"
  }

 #Dispose web object
 $Web.Dispose()
}

#Call the function Appropriately to Disable or Enable Alerts 
Disable-ListAlerts $WebURL $ListName

 

 

If you want disable all alerts on this specific list you just need run the following script.

 

Add-PSSnapin Microsoft.SharePoint.PowerShell –ErrorAction SilentlyContinue

#Variables
$WebURL = "http://YourWebUrl"
$ListName="YourListName"

#Function to Disable All Active Alerts on a Given List
Function Disable-ListAlerts($WebURL, $ListName)
{
  #Get the Web and List objects
  $Web = Get-SPWeb $WebURL
  $List = $web.Lists.TryGetList($ListName)

  #Get All Alerts created in the list - Which are Active
  $ListAlerts = $Web.Alerts | Where-Object {($_.List.Title -eq $List.Title) -and ($_.Status -eq "ON")}

  Write-host "Total Number of Active Alerts Found in the list: $($ListAlerts.Count)" 
 
  #Iterate through each alert and turn it OFF
  foreach($Alert in $ListAlerts)
  {
     $Alert.Status="OFF"
     $Alert.Update()
     write-host "Disabled the Alert' $($Alert.Title)' Created for User '$($Alert.User.Name)'"
  }
 
 #Dispose web object
 $Web.Dispose()
}

#Call the function Appropriately to Disable or Enable Alerts 
Disable-ListAlerts $WebURL $ListName

 

Thanks

Fábio Carvalho
SharePoint Consultant
|create|it|

SharePoint – Using Flows on yours list items and documents

Hey Everyone!!

Today i will talk about Flows!!! March 2017 bring us a new capabilities about integrating Flows with modern libraries, allowing you create interactive in document libraries and list! Probably they will quickly replace the old Event Handler or Event Timer Jobs!…

Flows, introduce a new way to development scheduler to build and respond your business needs, it is very fast to implement them and very intuitive!…with the ability to build zero code processes directly from a SharePoint list. These Flows operate against the entire scope of a list, waiting for data-or driven triggers to launch each process. Flows operate on a single item or document selected in the modern user experience.

You could create Flows using templates or you could create your owns directly inside SharePoint. Selecting a Flow launches the browser based Flow designer. When you save the Flow it’s also added as a drop-down button in that list or library.

Take a look at the flow templates list that you can use:

https://flow.microsoft.com/en-us/services/shared_sharepointonline/sharepoint/

Thanks

Fábio Carvalho
SharePoint Consultant
|create|it|

SharePoint Online – Storage Metrics – Monitor storage usage in your Site Collection

Hey Everyone!!!

Today i will talk about Storage Metrics in your SharePoint Site Collection!!!

Everyone knows what is the main feature on SharePoint that you could interact with and Structure of SharePoint Site Collections! right!? Site Content and Struct (/_layouts/sitemanager.aspx)!!!

Site Content and Structure page, give you a great overview about all your Site Collection structure. This feature, available since Microsoft Office SharePoint Server 2007, give the capability to navigate dynamically on your site collection hierarchy, it is familiar to Windows Explorer in fact. You can see the site collection hierarchy in the navigation pane as a tree view on the left of the Site Content and Structure page.

But, if you need know more details about storage, probably don’t help you as you expect, so in this case you case access to Storage Metrics (/_layouts/storman.aspx).

 

Storage Metrics underneath Site Collection Administration, access to your all sub-sites and libraries in SharePoint Online ( also available for SharePoint 2010, SharePoint 2013 and SharePoint 2016) and give you the information about how much storage they are consuming.

It is great!!! Because Storage Metrics allows you to drill down to each site, library and even folder to show a very granular report on your storage consumption, this is very important if you need migrate a large lists or even you are planning an migration between SharePoint Versions without any 3rd Party tool.

Take a Look:

 

 

Thanks

Fábio Carvalho
SharePoint Consultant
|create|it|

SharePoint 2016 – Create Service Accounts using PowerShell script

Hey Everyone!!!

Today i will show you how can you create SharePoint 2016 Service Accounts using PowerShell script following the Best Practices.

The script not only create all the accounts but also create the respectives OU (Organizational Unit):

  • SharePoint Accounts
  • SQL Accounts

Service Accounts:

 Name Description Local Rights Domain Rights
SP_FarmThe server farm account is used to perform the following tasks:
-Configure and manage the server farm.
-Act as the application pool identity for the SharePoint Central Administration Web site.
-Run the Microsoft SharePoint Foundation Workflow Timer Service.
SecurityAdmin and DB_Creator rights on the SQL InstanceDomain User
SP_AdminThe server farm account is used to perform the following tasks:
-Setup
-SharePoint Products Configuration Wizard
Local Administrator on all the SharePoint Servers. SecurityAdmin and DB_Creator rights on the SQL InstanceDomain User
SP_PoolThe Pool account is used to run the Web Application PoolsNoneDomain User
SP_ServicesThe Services Account is used to run the Service Application PoolNoneDomain User
SP_CrawlThe Default Content Access Account for the Search Service ApplicationNoneDomain User
SP_SearchService Account to run the SharePoint Search “Windows Service”NoneDomain User
SP_UserProfilesThe User Profile Synchronization AccountNoneDomain User
SP_MySitePoolUsed for the My Sites Web ApplicationNoneDomain User
SP_CacheSuperUserObject Cache Service Account. The goals of the object cache are to reduce the load on the computer on which SQL Server is running, and to improve request latency and throughput. These user account must be properly configured to ensure that the object cache works correctly.None.
SharePoint: Must be an account that has Full Control access to the Web application.
Domain User
SP_CacheSuperReaderObject Cache Service Account. The goals of the object cache are to reduce the load on the computer on which SQL Server is running, and to improve request latency and throughput. These user account must be properly configured to ensure that the object cache works correctly.None.
SharePoint: Must be an account that has Full Read access to the Web application
Domain User
WF_ServiceWorkFlow Manager Service AccountLocal Administrator and SysAdmin rights on the SQL instance.Domain User
SP_MySitePoolUsed for the My Sites Web ApplicationNoneDomain User
SP_VisioUserVisio Unattended IDNoneDomain User
SP_ExcelUserExcel Unattended IDNoneDomain User
SP_PerfPointUserPerformance Point Unattended IDNoneDomain User
SQL_AdminSQL Admin on the SQL Server. Used to Install the SQL Server.Local Administrator on the SQL ServerDomain User
SQL_ServicesIt is the service account for the following SQL Server services: MSSQLSERVER SQLSERVERAGENTNoneDomain User


Script:

 

$mydom = (get-addomain).distinguishedname 
$password = "pass@word1" | ConvertTo-SecureString -AsPlainText -Force 

$ouNameSP = "SharePoint Accounts"
$oudnSP = "OU=$ounameSP,$mydom" 

$ouNameSQL = "SQL Accounts" 
$oudnSQL = "OU=$ounameSQL,$mydom" 

#----------------------------> Organizational Unit <---------------------------- 

New-ADOrganizationalUnit -Name $OUNameSP -Path $mydom 
Write-Host "OU $OUNameSP Created" -foregroundcolor green 

New-ADOrganizationalUnit -Name $OUNameSQL -Path $mydom 
Write-Host "OU $OUNameSQL Created" -foregroundcolor green 

#-----------------------------> SharePoint 2016 <-------------------------------

$usersArraySP = @("SP_Farm","SP_Admin","SP_Pool","SP_Services","SP_Crawl","SP_Search",
                  "SP_UserProfiles","SP_PortalSuperReader","SP_CacheSuperUser","SP_VisioUser",
                  "SP_PerfPointUser","WF_Service","SP_MySitePool","SP_PortalSuperUser")

foreach ($usp in $usersArraySP) {
        New-ADUser -Name $usp -DisplayName $usp -SamAccountName $usp -AccountPassword $password 
        -ChangePasswordAtLogon $false -PassThru -PasswordNeverExpires $true -Path $oudnSP 
        Write-Host "$usp Created" -foregroundcolor green
 }

#----------------------------------> SQL <--------------------------------------
$usersArraySQL = @("SQL_Admin","SQL_Service")

foreach ($usql in $usersArraySQL) {
       New-ADUser -Name $usql -DisplayName $usql -SamAccountName $usql -AccountPassword $password 
       -ChangePasswordAtLogon $false -PassThru -PasswordNeverExpires $true -Path $oudnSQL
       Write-Host "$usql Created" -foregroundcolor green
 }

 

Thanks

Fábio Carvalho
SharePoint Consultant
|create|it|

SharePoint Scenarios – Online, On-Premises or Hybrid!?

Hey Everyone!!!

Today i’m going to talk about SharePoint Scenarios and what are the main difference between this three types of scenarios and what scenario should be the option for your environment…

So, the three types of architecture scenario that you can have on your SharePoint environment are the following:

What should you choose?! Well in fact there are so many question that you need answered before take an decision!?

 

It isn’t easy take a decision, let’s analyse what are the main benefits each architecture:

SharePoint On-Premises:

  • Private Cloud
  • Dedicated environment
  • Internally hosted
  • Internally managed
  • Internal designed
 ProsCons
Control PerformanceCost of internal resources (staff, hardware, software, etc)
Scale Up and Scale OutAdditional Geographic redundancy costs
Reduces Bandwidth requirementsDisaster Recovery dependent on internal capabilities
Full CustomizationScale Up/Out Cost( SW/HW)
Full Server and SQL DatabasePatching Servers/farms
Migrate as NeededExtra configurations for External Collaboration
Seamless Single Sign on with Corporate Active Directory
  • Migration Flow:

SharePoint Online:

  • Public Cloud
  • Partially or fully dedicated
  • Externally hosted
  • Externally or Internally managed
  • Internally managed
  • Minimal customization

Cloud benefits according to cloud users?

  • Increase efficiency (55 %)
  • Improved employee mobility (49 %)
  • Increased ability to Innovate (32 %)
  • Freed current IT staff for other projects (31 %)
  • Reduce IT operation costs (25 %)
  • Enabled us to offer new products/ services (24 %)
 ProsCons
Uptime 99.99%More ISP Bandwidth
Multiple Data centersLimited Customizations
Shorted release cycleRecovery SLAs
Geographically redundant and ScalabilityNo Server access
Managed Services ( SaaS)
Pay as you go ( Low Cost )
Reduced impact on internal IT resources
  • Migration Flow:

SharePoint Hybrid Solution:

What is Hybrid SharePoint?

“Productivity services in SharePoint Online (Office 365) which are securely integrated with on-premises SharePoint Server 2016 to provide unified functionality and access to data.”

Why considering a Hybrid SharePoint Solution?

  • Large existing investments (customized SP deployments w/lots of data and settings,custom solutions, LOB systems, etc…)
  • Functionalities I can’t do in the Cloud that i can do on premises;
  • Keep Sensitive Data on Premise
  • Collaboration with External Partners
  • Capacity Flexibility
  • Intranet – Extranet
  • Geo Location

Same Benefits of Hybrid SharePoint Solution?

SharePoint Business to Business Collaboration: Extranet for Partners with Office 365

“on-premises extranet site involves complex configuration to establish security measures and governance, including granting access inside the corporate firewall, and expensive initial and on-going cost….SharePoint Online, partners connect directly to a members-only site in Office 365, without access to the corporate on-premises environment or any other Office 365 site. Office 365 Extranet sites can be accessed anywhere…”

SharePoint hybrid sites and search

“A hybrid environment can help your company get started in the cloud, taking a first step to explore the cloud functionality at own your pace. It also enables enterprise users to be connected from almost anywhere to the resources and content they need… SharePoint hybrid features, you can consolidate search results between SharePoint Server and Office 365, consolidate user profiles in Office 365, and offload your users’ personal storage to the cloud…”

  • Migration/Interactions Flow:

Thanks

Fábio Carvalho
SharePoint Consultant
|create|it|

 

Just another Blog IT site