The Future of SharePoint in AZURE/LINUX

Posted on Updated on

INTRO

Today we live in a world of of “Services”, The real deal is have focus on a Service and integrate our products. Microsoft AZURE It’s a really example of this new way of making global deals, innovate, learn and execute..

What is a “Servicizing”?

“Servicizing” is a transaction through which value is provided by a combination of products and services in which the satisfaction of customer needs is achieved either by selling the function of the product rather than the product itself, or by increasing the service component of a product offer. The concept is based on the idea that what customers want from products is not necessarily ownership, but rather the function that the product provides or the service the product can deliver. This means that the provider of “servicizing solutions” may get paid by the unit-of-service (or product function) delivered, as opposed to the (more traditional) unit-of-products sold…

Credit: Wikipedia

When Microsoft decide to open SPFx, vscode, and now SQL Server for Linux and Windows as “open source”, a light came out to me right away.

This means, in terms of  PROFICT & LOST PROJECTIONS a major step to Corporations realize that the CLOUD is Important, and have to be demystified. I remember a few years ago, I didn’t see any constructive brainstorm with “Open Source” and “Microsoft”, you simple give your opinion and 20 people reply as you were a “virus” or someone from another world.

My Azure VM is a Standard F2 (2 cores, 4 GB memory) = ~1,51€ day (8h) West Europe, so 1,51×22 = ~33,22€ month. A Corporation with 100 SP Developers = ~3,322 month based on 1 month ~90€ (Azure Calculator)

PS: Using 1 SSD 32GB + 1 HDD disk with 1TB

SCOPE

  1. Benefits of using Linux VM’s in Azure in order to improve profits, keeping in mind the future of SharePoint.
  2. Know how prepare and configure environments for SPFx,
  3. POC your SPFx WebParts.

TO DO

  1. Profits vs benefit
  2. Azure templates
  3. Linux configuration/connection
  4. SPFx WebParts on Linux, configuration and POCs

1. Profits vs benefit

  1. Mindset on Open Source Technologies (Projection of Azure VM’s – less is more) , more profit;
  2. Open Source Challenge for newly graduates, interns and students, more opportunities, more profit;
  3. Open mind Multidisciplinary Teams – more know-how, more value, more qualification, more profit.

As a consequence you can choose more assertively what’s best for your business and have more flexibility for AZURE budget.

2. Azure templates

  1. .Variety of Linux Templates (Debian, Ubuntu, RedHat, CentoOS, openSUSE, …)
  2. Open Source Tools like azure-cli the Source, and AzureRM PowerShell on Linux and Open Source, the Source

3. Linux configuration/connection

You can use azure-cli or create a VM from several templates on Microsoft AZURE

You can connect using puTTY. My opinion goes to Debian, in this case (8 Jessie) latest stable.

After Login via puTTY run the commands bellow

Bash

I’m using MATE DESKTOP and installing GParted to manage my 1 TB HDD disk

# LINUX ROOT AND ADMINS
sudo passwd root
# UBUNTU
sudo usermod -G admin spfx

# INSTALL MATE DESKTOP
sudo apt-get update
sudo apt-add-repository ppa:ubuntu-mate-dev/ppa
sudo apt-add-repository ppa:ubuntu-mate-dev/trusty-mate
sudo apt-get install mate-desktop-environment-core
sudo apt-get install mate-desktop-environment
#sudo apt-get install mate-desktop-environment-extras
sudo apt-get update && sudo apt-get upgrade

# INSTALL XRDP
sudo apt-get install xrdp
sudo apt-get update 
echo mate-session >~/.xsession
sudo service xrdp restart

# INSTALL GPARTED
sudo apt-get update && sudo apt-get install gparted

LIN

NEXT STEPS

Overview of the SharePoint Framework OFFICE DEV CENTER

Overview of the SharePoint Framework GIT DOCS

SharePoint Framework client-side web part samples & tutorial materials

Code samples and developer content targeted towards SharePoint Framework client-side web parts

DROP 5 USERS (LINUX)

Error – ‘tslint’ sub task errored after 871 ms
Error in plugin ‘gulp-cache’
Message:
Cannot find module ‘./h6’
Details:
code: MODULE_NOT_FOUND

https://github.com/SharePoint/sp-dev-docs/issues/246#issuecomment-255311473

Cannot find module ‘./h6’ (DROP 5)

Posted on Updated on

Error - 'tslint' sub task errored after 871 ms 
 Error in plugin 'gulp-cache'
Message:
    Cannot find module './h6'
Details:
    code: MODULE_NOT_FOUND

After compile node.js #SPFx

“It seems like H6 is the only rule written in uppercase. Renaming the file to lowercase fixes the bug.”

https://github.com/SharePoint/sp-dev-docs/issues/246#issuecomment-255311473

What to do Before and After CU Update? SP2016

Posted on Updated on

After the recent CU Update for SharePoint 2016, there is some points to keep in mind.

You downloaded and installed

SP1CU

Description:

KB 3118289 – Update for SharePoint Server 2016 September 2016 (language independent)

KB 3118295 – Update for SharePoint Server 2016 September 2016 (language dependent fixes)

For Office Server

KB 3118299 – Update for Office Online Server 2016 September 2016

Download

Download Update for SharePoint Server 2016 September 2016 (language independent)

Download SharePoint Server 2016 September 2016 (language dependent fixes)

Download Office Online Server 2016 September 2016

SP2CU

PSConfig.exe -cmd upgrade -inplace b2b -wait -cmd applicationcontent 
-install -cmd installfeatures -cmd secureresources -cmd services -install

PSCONFIG

Usage:
        PSCONFIG.EXE -cmd <Command> [Parameters]
        PSCONFIG.EXE -help [Command]
        PSCONFIG.EXE -?
Commands:
        configdb
        helpcollections
        secureresources
        services
        installfeatures
        adminvs
        upgrade
        applicationcontent
        quiet

Ensure everything is updated, don’t miss a thing

PSConfig.exe -cmd upgrade -inplace b2b -wait -cmd applicationcontent -install -cmd installfeatures -cmd secureresources -cmd services -install 

ANY PROBLEM just delete the “-” from “-install” and type again

  1. applicationcontent – Copies shared application data (for example, resource files and Web application binaries) to existing Web application virtual directories;
  2. installfeatures  – Registers any SharePoint Products and Technologies features located on the file system of this server with the server farm;
  3. secureresources  – Performs SharePoint Products resource security enforcement on the server. For example, security is enforced on files, folders, and registry keys.

SP5CU

SP6CU

If you are separating the CU install from the PSCONFIG, should be required to run the bellow command to unsure that all application content be upgraded.

Install-SPApplicationContent

In any case you should have some WARNINGS, it should be OK, the result it’s what you expect.

Attempted to set SchemaVersion to 16.0.4432.1000 < 16.0.4432.1003 on Database SOME_Content_CentralAdmin, Status = Online — skipping.

Attempted to set SchemaVersion to 16.0.4432.1000 < 16.0.4432.1003 on Database SOME_Content_Portal, Status = Upgrading — skipping.

Attempted to set SchemaVersion to 16.0.4432.1000 < 16.0.4432.1003 on Database SOME_Content_Dev, Status = Upgrading — skipping. Attempted to set SchemaVersion to 16.0.4432.1000 < 16.0.4432.1003 on Database SOME_Content_Store, Status = Upgrading — skipping.

SP7CU

Git Ingnore vscode for (SPFx)

Posted on Updated on

.gitignore file

# Logs
logs
*.log
npm-debug.log*

# Dependency directories
node_modules

# Build generated files
dist
lib
solution
temp
*.spapp

# Coverage directory used by tools like istanbul
coverage

# OSX
.DS_Store

# Visual Studio files
.ntvs_analysis.dat
.vs
bin
obj

# Resx Generated Code
*.resx.ts

# Styles Generated Code
*.scss.ts 

.npmignore file

# Folders
.vscode
coverage
node_modules
sharepoint
src
temp

# Files
*.csproj
.git*
.yo-rc.json
gulpfile.js
tsconfig.json

SFPx on Debian 8

Posted on Updated on

Debian 8 is a minimum consuming resources. Comparing with Ubuntu (Mate) i have allocated < 1 GB instead of 1.6 GB on MATE. This is very nice because with 12 GB of ram, i can allocate 6GB to Windows 10 on VirtualBox and 3 vCores, instead of 2.

screenshot

The real pain is configuring the environment to run npm and gulp so, here it is some tips:

 

sudo npm cache clean -f
sudo npm install -g n
sudo n stable
node -v
sudo npm rebuild node-sass

MORE FIXES

#Pnp JS Core Typings Related
sudo npm install typings -g
#Now CLONE and
sudo npm install

#INSTALL VSCODE NOW

 

CONCLUSIONS

  1. With Debian I have 65% of RAM instead of 80% in MATE;
  2. Windows 10 will not push your vCores to 100%

Read the rest of this entry »

SPFx CRUD & Populating Options

Posted on Updated on

This article will help you to create a SharePoint WebPart using the new Framework SPFx and the PnP JS Core. My first though was how populate my PropertyPaneDropdown in the Properties Panel. After some research, there is and Interface, the IPropertyPaneDropdownOption that must be imported from the preview of ‘@microsoft/sp-client-preview’ This is great because you can populate OnInit before the DOM render. The other big deal is CRUD among Typescript. SPFx is flexibly enough to use your favorite Framework, but the preferred is React. All source code is in my Repository on GitHub, if i need help somehow please, comment here or Clone my project for SPFx demos CLONE

git clone https://github.com/jtlivio/jl-spfx-project-webparts.git

INSTRUCTIONS

https://github.com/jtlivio/jl-spfx-project-webparts

DEMO

Erros after upgrade node.js version (SPFx)

Posted on Updated on

I just recently upgrade node.js on Linux for version v6.6.0, so all my #SPFx webparts stoped working, try to run the command bellow, worked for me @OfficeDev #SPFx-webparts

sudo npm rebuild node-sass

image 1

Finally

image 2

SharePoint Framework (SPFX) and Linux

Posted on Updated on

Recently Microsoft released a the preview version of SPFx, as Microsoft say:

“The SharePoint Framework is a Page and Part model that enables client-side development for building SharePoint experiences. It facilitates easy integration with the SharePoint data, and provides support for open source tooling development.”

I’ve been use it in windows 10 1670, but in Linux also.

This Though, mini Article is a way to provide my experience and some suggestions for you. In my case I use Hyper-V with a VM for 1 processor and RAM defined for max (6GB)

Install Lubuntu, its lite and very user friendly. It’s based on Ubuntu but have a lite UI (LXDE).

For me the main problem was with the VM Screen resolution, for accomplish this, just run

Change this line

sudo nano /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT=

image

TO (in my case 1366×768)

GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash video=hyperv_fb:1366×768″

Then

sudo update-grubsudo update-grub

Save and restart

At this time, you must follow some procedures in the LXTerminal

Install node.js

sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm

Install Gulp and npm

sudo npm i -g yo gulp

image

Install the Compiler Tools

sudo apt-get install build-essential

Install Yeoman SharePoint Generator

sudo npm i -g @microsoft/generator-sharepoint

image

Install Visual Studio Code

https://code.visualstudio.com/#alt-downloads

image

Next just follow all procedures from the SPFx official Git and enjoy

https://github.com/SharePoint/sp-dev-docs/wiki

image

FIXES

Gulp give error installing

sudo npm install npm –g
sudo ln -s /usr/bin/nodejs /usr/bin/node

Install Gulp again and continue all points

The tool was unable to install Application Server Role, Web Server (IIS) Role

Posted on Updated on

For my experience, this error may happen in virtualized environments, manly in Azure.

There are many workarounds, but I,ll suggest this one:

Off-line Install

  1. Copy the sxs file from sources “Binaries”
  2. Run this PowerShell script (assuming D:\sxs), change last line
Import-Module ServerManager `
Add-WindowsFeature `
	Net-Framework-Features, `
	Web-Server,Web-WebServer, `
	Web-Common-Http,Web-Static-Content, `
	Web-Default-Doc,Web-Dir-Browsing, `
	Web-Http-Errors,Web-App-Dev, `
	Web-Asp-Net, `
	Web-Net-Ext, `
	Web-ISAPI-Ext, `
	Web-ISAPI-Filter, `
	Web-Health, `
	Web-Http-Logging, `
	Web-Log-Libraries, `
	Web-Request-Monitor, `
	Web-Http-Tracing, `
	Web-Security, `
	Web-Basic-Auth, `
	Web-Windows-Auth, `
	Web-Filtering, `
	Web-Digest-Auth, `
	Web-Performance, `
	Web-Stat-Compression, `
	Web-Dyn-Compression, `
	Web-Mgmt-Tools, `
	Web-Mgmt-Console, `
	Web-Mgmt-Compat, `
	Web-Metabase, `
	Application-Server, `
	AS-Web-Support,
	AS-TCP-Port-Sharing, `
	AS-WAS-Support, `
	AS-HTTP-Activation, `
	AS-TCP-Activation, `
	AS-Named-Pipes, `
	AS-Net-Framework, `
	WAS,WAS-Process-Model, `
	WAS-NET-Environment, `
	WAS-Config-APIs, `
	Web-Lgcy-Scripting, `
	Windows-Identity-Foundation, `
	Server-Media-Foundation, `
	Xps-Viewer -Source D:sxs

2. Download Files in a PC with internet

#***************************************************************************************
# Written by Craig Lussier - http://craiglussier.com
#
# This script downloads SharePoint 2013 Prerequisites
#   
# -Only run this script on Windows Server 2012 (RTM, either Standard or Datacenter)
# -Do not run this script on a Windows Server 2008 R2 SP1 Server!
# ---These are the Prerequisites for Windows Server 2012
# -Run this script as a local server Administrator
# -Run PowerShell as Administrator
#
# Don't forget to: Set-ExecutionPolicy RemoteSigned
# If you have not done so already within you Windows Server 2012 server
#****************************************************************************************
param([string] $SharePoint2013Path = $(Read-Host -Prompt "Please enter the directory path to where you wish to save the SharePoint 2013 Prerequisite files.")) 
 
# Import Required Modules
Import-Module BitsTransfer 


# Specify download url's for SharePoint 2013 prerequisites
$DownloadUrls = (
            "http://download.microsoft.com/download/9/1/3/9138773A-505D-43E2-AC08-9A77E1E0490B/1033/x64/sqlncli.msi", # Microsoft SQL Server 2008 R2 SP1 Native Client
            "http://download.microsoft.com/download/E/0/0/E0060D8F-2354-4871-9596-DC78538799CC/Synchronization.msi", # Microsoft Sync Framework Runtime v1.0 SP1 (x64)
            "http://download.microsoft.com/download/A/6/7/A678AB47-496B-4907-B3D4-0A2D280A13C0/WindowsServerAppFabricSetup_x64.exe", # Windows Server App Fabric
            "http://download.microsoft.com/download/7/B/5/7B51D8D1-20FD-4BF0-87C7-4714F5A1C313/AppFabric1.1-RTM-KB2671763-x64-ENU.exe", # Cumulative Update Package 1 for Microsoft AppFabric 1.1 for Windows Server (KB2671763)
            "http://download.microsoft.com/download/D/7/2/D72FD747-69B6-40B7-875B-C2B40A6B2BDD/Windows6.1-KB974405-x64.msu", #Windows Identity Foundation (KB974405)
            "http://download.microsoft.com/download/0/1/D/01D06854-CA0C-46F1-ADBA-EBF86010DCC6/rtm/MicrosoftIdentityExtensions-64.msi", # Microsoft Identity Extensions
            "http://download.microsoft.com/download/9/1/D/91DA8796-BE1D-46AF-8489-663AB7811517/setup_msipc_x64.msi", # Microsoft Information Protection and Control Client
            "http://download.microsoft.com/download/8/F/9/8F93DBBD-896B-4760-AC81-646F61363A6D/WcfDataServices.exe" # Microsoft WCF Data Services 5.0
                ) 


function DownLoadPreRequisites() 
{ 

    Write-Host ""
    Write-Host "====================================================================="
    Write-Host "      Downloading SharePoint 2013 Prerequisites Please wait..." 
    Write-Host "====================================================================="
     
    $ReturnCode = 0 
 
    foreach ($DownLoadUrl in $DownloadUrls) 
    { 
        ## Get the file name based on the portion of the URL after the last slash 
        $FileName = $DownLoadUrl.Split('/')[-1] 
        Try 
        { 
            ## Check if destination file already exists 
            If (!(Test-Path "$SharePoint2013Path\$FileName")) 
            { 
                ## Begin download 
                Start-BitsTransfer -Source $DownLoadUrl -Destination $SharePoint2013Path\$fileName -DisplayName "Downloading `'$FileName`' to $SharePoint2013Path" -Priority High -Description "From $DownLoadUrl..." -ErrorVariable err 
                If ($err) {Throw ""} 
            } 
            Else 
            { 
                Write-Host " - File $FileName already exists, skipping..." 
            } 
        } 
        Catch 
        { 
            $ReturnCode = -1 
            Write-Warning " - An error occurred downloading `'$FileName`'" 
            Write-Error $_ 
            break 
        } 
    } 
    Write-Host " - Done downloading Prerequisites required for SharePoint 2013" 
     
    return $ReturnCode 
} 


 

function CheckProvidedDownloadPath()
{


    $ReturnCode = 0

    Try 
    { 
        # Check if destination path exists 
        If (Test-Path $SharePoint2013Path) 
        { 
           # Remove trailing slash if it is present
           $script:SharePoint2013Path = $SharePoint2013Path.TrimEnd('\')
       $ReturnCode = 0
        }
        Else {

       $ReturnCode = -1
           Write-Host ""
       Write-Warning "Your specified download path does not exist. Please verify your download path then run this script again."
           Write-Host ""
        } 


    } 
    Catch 
    { 
         $ReturnCode = -1 
         Write-Warning "An error has occurred when checking your specified download path" 
         Write-Error $_ 
         break 
    }     
    
    return $ReturnCode 

}


 
function DownloadPreReqs() 
{ 

    $rc = 0 
    
    $rc = CheckProvidedDownloadPath  

    # Download Pre-Reqs  
    if($rc -ne -1) 
    { 
        $rc = DownLoadPreRequisites 
    } 
     

    if($rc -ne -1)
    {

        Write-Host ""
        Write-Host "Script execution is now complete!"
        Write-Host ""
    }


} 

DownloadPreReqs

3. Install Pre files (Servers)

#***************************************************************************************
# Written by Craig Lussier - http://craiglussier.com
#
# This script downloads and instals SharePoint 2013 Prerequisites
#  
# -Only run this script on Windows Server 2012 (RTM, either Standard or Datacenter)
# -Do not run this script on a Windows Server 2008 R2 SP1 Server!
# ---These are the Prerequisites for Windows Server 2012
# -Run this script as a local server Administrator
# -Run PowerShell as Administrator
# 
# IMPORTANT NOTES:
# -The $SharePoint2013Path is the path to your SharePoint 2013 installation media
# -This script utilizes the PrerequisiteInstaller.exe in your SharePoint 2013 media
# -The script points to your $SharePoint2013Path\PrerequisiteInstallerFiles directory.
# ---BE SURE TO COPY THE PREREQ FILES INTO THIS DIRECTORY IF THEY ARE NOT ALREADY THERE FROM THE Download-SP2013PreReqFiles.ps1 script
#
# Don't forget to: Set-ExecutionPolicy RemoteSigned
# If you have not done so already within you Windows Server 2012 server
#****************************************************************************************
param([string] $SharePoint2013Path = $(Read-Host -Prompt "Please enter the directory path to where your SharePoint 2013 installation files exist.")) 
 

 
function InstallPreReqFiles() 
{ 

    $ReturnCode = 0

    Write-Host ""
    Write-Host "====================================================================="
    Write-Host "Installing Prerequisites required for SharePoint 2013" 
    Write-Host ""
    Write-Host "This uses the supported installing offline method"
    Write-Host ""
    Write-Host "If you have not installed the necessary Roles/Features"
    Write-Host "this will occur at this time."
    Write-Host "=====================================================================" 
     
     
        Try 
        { 
        

             Start-Process "$SharePoint2013Path\PrerequisiteInstaller.exe" -ArgumentList "`
                                                                                             /SQLNCli:`"$SharePoint2013Path\PrerequisiteInstallerFiles\sqlncli.msi`" `
                                                                                             /IDFX:`"$SharePoint2013Path\PrerequisiteInstallerFiles\Windows6.1-KB974405-x64.msu`" `
                                                                                             /IDFX11:`"$SharePoint2013Path\PrerequisiteInstallerFiles\MicrosoftIdentityExtensions-64.msi`" `
                                                                                             /Sync:`"$SharePoint2013Path\PrerequisiteInstallerFiles\Synchronization.msi`" `
                                                                                             /AppFabric:`"$SharePoint2013Path\PrerequisiteInstallerFiles\WindowsServerAppFabricSetup_x64.exe`" `
                                                                                             /KB2671763:`"$SharePoint2013Path\PrerequisiteInstallerFiles\AppFabric1.1-RTM-KB2671763-x64-ENU.exe`" `                                                                                             
                                                                                             /MSIPCClient:`"$SharePoint2013Path\PrerequisiteInstallerFiles\setup_msipc_x64.msi`" `
                                                                                             /WCFDataServices:`"$SharePoint2013Path\PrerequisiteInstallerFiles\WcfDataServices.exe`""
        } 
        Catch 
        { 
            $ReturnCode = -1 
            Write-Error $_ 
            break 
        }     
 
    return $ReturnCode 
} 
 
function CheckProvidedSharePoint2013Path()
{


    $ReturnCode = 0

    Try 
    { 
        # Check if destination path exists 
        If (Test-Path $SharePoint2013Path) 
        { 
           # Remove trailing slash if it is present
           $script:SharePoint2013Path = $SharePoint2013Path.TrimEnd('\')
       $ReturnCode = 0
        }
        Else {

       $ReturnCode = -1
           Write-Host ""
       Write-Warning "Your specified download path does not exist. Please verify your download path then run this script again."
           Write-Host ""
        } 


    } 
    Catch 
    { 
         $ReturnCode = -1 
         Write-Warning "An error has occurred when checking your specified download path" 
         Write-Error $_ 
         break 
    }     
    
    return $ReturnCode 

}


 
function InstallPreReqs() 
{ 

    $rc = 0 
    
    $rc = CheckProvidedSharePoint2013Path  

     
    # Install the Pre-Reqs 
    if($rc -ne -1) 
    { 
       $rc = InstallPreReqFiles 
    } 

    if($rc -ne -1)
    {

        Write-Host ""
        Write-Host "Script execution is now complete!"
        Write-Host ""
    }


} 

InstallPreReqs

4. Install Roles (Servers)

#***************************************************************************************
# Written by Craig Lussier - http://craiglussier.com
#
# This script installs SharePoint 2013 Roles/Features for Windows Server 2012
#  
# -Only run this script on Windows Server 2012 (RTM, either Standard or Datacenter)
# -If you are running this script 'offline' have your Windows Server 2012 installation
#  Media mounted/copied to this machine. You can also use a network UNC path.
# -Do not run this script on a Windows Server 2008 R2 SP1 Server!
# ---These are the Prerequisites for Windows Server 2012
# -Run this script as a local server Administrator
# -Run PowerShell as Administrator
#
# Don't forget to: Set-ExecutionPolicy RemoteSigned
# If you have not done so already within you Windows Server 2012 server 
#****************************************************************************************
# Import Required Module
Import-Module ServerManager

function AddWindowsFeatures() 
{ 
    Write-Host "==================================================================================="
    Write-Host "Install required Windows Roles/Features for SharePoint 2013 on Windows Server 2012"
    Write-Host ""
    Write-Host "Note: You'll receive prompt to restart your server when the"
    Write-Host "      Windows Server 2012 Role/Feature installation is complete."
    Write-Host "==================================================================================="        
     
      
    # Note: You can use the Get-WindowsFeature cmdlet (its in the ServerManager module) 
    #       to get a listing of all features and roles.
    $WindowsFeatures = @(
            "Net-Framework-Features",
            "Web-Server",
            "Web-WebServer",
            "Web-Common-Http",
            "Web-Static-Content",
            "Web-Default-Doc",
            "Web-Dir-Browsing",
            "Web-Http-Errors",
            "Web-App-Dev",
            "Web-Asp-Net",
            "Web-Net-Ext",
            "Web-ISAPI-Ext",
            "Web-ISAPI-Filter",
            "Web-Health",
            "Web-Http-Logging",
            "Web-Log-Libraries",
            "Web-Request-Monitor",
            "Web-Http-Tracing",
            "Web-Security",
            "Web-Basic-Auth",
            "Web-Windows-Auth",
            "Web-Filtering",
            "Web-Digest-Auth",
            "Web-Performance",
            "Web-Stat-Compression",
            "Web-Dyn-Compression",
            "Web-Mgmt-Tools",
            "Web-Mgmt-Console",
            "Web-Mgmt-Compat",
            "Web-Metabase",
            "Application-Server",
            "AS-Web-Support",
            "AS-TCP-Port-Sharing",
            "AS-WAS-Support",
            "AS-HTTP-Activation",
            "AS-TCP-Activation",
            "AS-Named-Pipes",
            "AS-Net-Framework",
            "WAS",
            "WAS-Process-Model",
            "WAS-NET-Environment",
            "WAS-Config-APIs",
            "Web-Lgcy-Scripting",
            "Windows-Identity-Foundation",
            "Server-Media-Foundation",
            "Xps-Viewer"
    )


    #Prompt To Start Role/Feature Installation
    $title = "Do you wish to perform an online or offline installation?"
    $message = "Please ensure that you have read and understand the instructions located at http://gallery.technet.microsoft.com/DownloadInstall-SharePoint-e6df9eb8. 'Online' means Windows Server 2012 is connected to the Internet and Windows Update is used to download supporting files, Offline means Windows Server 2012 is not connected to the Internet and you have your Windows Server 2012 installation media mounted/copied to this server to install supporting files."

    $yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Online", `
       "Uses Windows Update to download and install necessary components related to .NET 3.5 feature (NET-Framework-Core)"

    $no = New-Object System.Management.Automation.Host.ChoiceDescription "O&ffline", `
           "Uses Windows Server 2012 media to install necessary components related to .NET 3.5 feature (NET-Framework-Core)"

    $options = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no)

    $result = $host.ui.PromptForChoice($title, $message, $options, 0) 

    $windowsServer2012MediaPath = ""
    Write-Host ""

    switch ($result)
    {
        
        0 {"You will be using Windows Update to download the necessary components to install features related to .NET 3.5. This will extend the duration of your Role/Feature installation."}
        1 {$windowsServer2012MediaPath = $(Read-Host -Prompt "Please enter the directory pointing to the directory of your Windows Server 2012 installation media. Fore example, D:\sources\sxs")}
    }
    Write-Host ""


    Try 
    { 
    # Create PowerShell to execute 

        $source = "" 

        if($windowsServer2012MediaPath -ne "") {
           $source = ' -source ' + $windowsServer2012MediaPath
        }
        

        $myCommand = 'Add-WindowsFeature ' + [string]::join(",",$WindowsFeatures) + $source

        # Execute $myCommand
        $operation = Invoke-Expression $myCommand    

        if ($operation.RestartNeeded -eq "Yes") { 
        
             #Prompt User for Restart
       $title = "Restart your server now?"
       $message = "Would you like to restart your server now? It is required to complete the Windows Role/Feature Installation."

       $yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes", `
             "Restarts your Windows Server 2012 server now to complete the Role/Feature installation."

       $no = New-Object System.Management.Automation.Host.ChoiceDescription "&No", `
        "Does not restart your server now... But you should..."

       $options = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no)

       $result = $host.ui.PromptForChoice($title, $message, $options, 0) 

       switch ($result)
       {
            0 {Restart-Computer;}
            1 {"Your server will not restart at this time. Before installing the Pre-requisite files, restart your computer."}
       }


        }

    } 
    Catch 
    { 
        Write-Warning "Error when Adding Windows Features. Error details are below:" 
        Write-Error $_ 
        break 
    } 
      
} 

AddWindowsFeatures

References:

REF1 – http://kx.cloudingenium.com/
REF2 – https://gallery.technet.microsoft.com 

Next Steps:

https://autospinstaller.com/

SharePoint Farm Task List Sample

Posted on

Farm:

Capacity planning and sizing.
Server acquisition and setup.
Deployment.
Scaling out, patching, and operations.
Backing up data.
Maintaining a disaster recovery environment.

Server Operating System:

SQL Server
SharePoint 2014 Server License
SharePoint 2014 Client Access License

Design the SharePoint environment on-premises environment:

SharePoint farm topology and logical architecture.
Server hardware.
Virtual environment
Load balancing.
Integration with Active Directory and DNS.
Design the disaster recovery environment.

Deploy and manage the SharePoint on premises environment:

Provision servers.
Deploy the SharePoint environment.
Update SharePoint farm servers.
Add or remove farm servers as needed based on farm utilization.
Backup the SharePoint environment.
Implement the disaster recovery environment and protocol.

Front-end servers:

Service applications, services, and components that serve user requests directly are placed on front-end servers.
These servers are optimized for fast performance.

Batch-processing servers:

Service applications, services, and components that process background tasks are placed on a middle-tier of servers referred to as batch processing servers.
These servers are optimized to maximize system resources.
These servers can tolerate greater loads because these tasks do not affect performance observed by users.

Database-servers:

Guidance for deploying database servers remains the same.
In a small farm, server roles can be combined on one or two servers.
For example, front-end services and batch-processing services can be combined on a single server or on two or more servers to achieve redundancy.