Thursday, 30 June 2016

Add Operations in SharePoint On Premise with POwerShell

Help Add-SPProjectLogLevelManager -examples
#Add Project entity to Project Sharepoint Site
Add-SPProjectLogLevelManager -Url http://w15-sp/pwa -EntityType Project -EntityUID "0798BF6A-F248-4F0F-8957-4D73993265BC"-LogLevel Verbose -Comments "xyz"
Get-SPProjectLogLevelManager -Url http://w15-sp/pwa
help Add-SPRoutingMachineInfo -examples
#Add routing target to specified identity to farm
$web = Get-SPWebApplication -Identity "http://w15-sp"
$rm = Get-SPRequestManagementSettings -Identity $web
Add-SPRoutingMachineInfo -RequestManagementSettings $rm -Name "w15-dc" -Availability Available
Get-SPRoutingMachineInfo -RequestManagementSettings $rm

#Adds a new machine pool.
 $web=Get-SPWebApplication -Identity "http://w15-sp"
   
 $rm=Get-SPRequestManagementSettings -Identity $web
   
 Add-SPRoutingMachinePool -RequestManagementSettings $rm -Name "w15-dc"
 Get-SPRoutingMachinePool -RequestManagementSettings $rm
   
   
help Add-SPRoutingRule -examples
# This examples adds a routing rule to the farm by using the $rm 
#   variables.
Add-SPRoutingRule -RequestManagementSettings $rm -Name "SampleRule"
Get-SPRoutingRule -RequestManagementSettings $rm

Note: The following content is in progress and please DO NOT use in production

Add-SPRoutingRule -RequestManagementSettings $rm -Name "SampleRule"

Get-SPRoutingRule -RequestManagementSettings $rm

#Add Scaleout database(IN Progress)

$appService = Get-SPServiceApplication |?{$_.DisplayName -like  "*App Management*"}

Add-SPScaleOutDatabase -ServiceApplication $appService -DatabaseName "sample"

 $appServiceProxy=Get-SPServiceApplicationProxy| ?{$_.DisplayName -like  "*App Management*"}

 Add-SPServiceApplicationProxyGroupMember -Identity 66c958d1-d10a-4880-bfc3-8b2646b8e4cd -Member fc413acb-f0b1-4617-b2f3-f2ef93c7f8bb

 Get-SPServiceApplicationProxyGroup

#Add new account

Add-SPSecureStoreSystemAccount -AccountName "contoso\garthf"

Get-SPSecureStoreSystemAccount

#Adds a user to the SharePoint_Shell_Access role for the specified database.
<#This example adds a new user named User1 to the SharePoint_Shell_Access role in 
    the farm configuration database only, and also ensures the user is added to the 
    WSS_Admin_WPG local group on each server in the farm.
    #>
Add-SPShellAdmin -UserName "contoso\garthf"

    
#This example adds a new user named garthf to the SharePoint_Shell_Access role in 
    #the farm configuration database only, and also ensures the user is added to the 
    #WSS_Admin_WPG local group on each server in the farm.

Add-SPShellAdmin -UserName CONTOSO\garthf
    
#This example adds a new user named User1 to the SharePoint_Shell_Access role in 
 # both the specified content database and the configuration database by passing a 
 #  database GUID to the cmdlet.   
$spDatabase = Get-SPContentDatabase |?{$_.Name –like “*Project*”}    
Add-SPShellAdmin -UserName CONTOSO\User1 -database $spDatabase.ID 
    
#This example adds a new user named garthf to the SharePoint_Shell_Access role in 
  #  both the specified Central Administration content database and the configuration 
  #  database.    
Get-SPDatabase | Where-Object {$_.WebApplication -like 
    "SPAdministrationWebApplication"} | Add-SPShellAdmin CONTOSO\garthf
    
   # This example adds a new user named garthf  to the SharePoint_Shell_Access role of 
    #both the specified content database and the configuration database by passing the 
    #name of the database to the cmdlet.

Get-SPDatabase | ?{$_.Name -eq "WSS_Content"} | Add-SPShellAdmin -Username 
    CONTOSO\garthf

Tuesday, 28 June 2016

Add/Update Operations on User Profile

#Turn on Security Trimming in Service Application
$upProxy = Get-SPServiceApplicationProxy |?{$_.DisplayName -like "*Profile*"}
Add-SPPluggableSecurityTrimmer -UserProfileApplicationProxyId $upProxy.ID
Get-SPPluggableSecurityTrimmer -UserProfileApplicationProxyId $upProxy.ID
Get-Help Add-SPPluggableSecurityTrimmer -examples

#Add Profile Leader
Add-SPProfileLeader -ProfileServiceApplicationProxy $upProxy -Name "contoso\alexd"
Get-SPProfileLeader -ProfileServiceApplicationProxy $upProxy
#Add User Profiel from different domain
Get-Help Add-SPProfileSyncConnection -examples
Add-SPProfileSyncConnection -ProfileServiceApplication $upProxy`
    -ConnectionForestName "fabrikam.com" -ConnectionDomain "Fabrikam" -ConnectionUserName "Testupa" `
    -ConnectionPassword convertto-securestring "Password1" -asplaintext -force `
    -ConnectionSynchronizationOU "OU=SharePoint Users,DC=fabrikam,DC=com"`

Saturday, 25 June 2016

Adds a user agent to a farm


Add-PSSnapin "Microsoft.SharePoint.PowerShell"                                  

Get-Help Add-SPInfoPathUserAgent -examples                                      

Get-SPInfoPathUserAgent                                                        

Add-SPInfoPathUserAgent -Name "something"

#View new agent

Get-SPInfoPathUserAgent

Thursday, 23 June 2016

Display all the lists in a SharePoint Site collection

This is a very simple set of code in PowerShell to find all the lists in SharePoint which are not default/hidden for all web sites under a site collection.


http://contoso.sharepoint.com


$spSite = Get-SPSite -Identity http://contoso.sharepoint.com

$spWebs = $spSite.AllWebs




Get-Date


foreach($spWeb in $spWebs)



{

$spWebTitle = $spWeb.Title

"Displaying Lists in Site::"+$spWebTitle

$spLists = $spWeb.Lists

foreach ($spList in $spLists)



{

$spList.Title



}

"List Count in site ::"+$spWebTitle + "::" + $spLists.Count

#Get-Date;



}



Tuesday, 14 June 2016

Creating a SharePoint Education Site

As I was exploring the SharePoint PowerShell commandlets, I got stuck with an interesting command related to SharePoint Education site.Add-SpEdu...
[In Progress[

References
http://blog.furuknap.net/sharepoint-education-installing-and-configuring

CRUD Operations in SharePoint using PowerShell

The following is a series of commands in SharePoint using PowerShell helping to perform many administrative tasks or even development tasks with ease.

Get-HElp Add-SPAppDeniedEndpoint -examples
#Stop Apps from accessing an endpoint
Add-SPAppDeniedEndpoint -Endpoint "_vti_bin/contoso/service.asmx"
Get-SPAppDeniedEndpointList
Get-Help Add-SPClaimTypeMapping -Examples
#Add a claim-https://technet.microsoft.com/en-us/library/ff607650.aspx
#Note: the New-SPClaimTYpeMapping worked and Add-SPClaimTYpeMapping is an example from msdn site.
Get-TrustedIdentityTokenIssuer -Identity "LiveIDSTS" | Add-SPClaimTypeMapping -IncomingClaimType "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier" -IncomingClaimTypeDisplayName "PUID" -LocalClaimType "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/thumbprint"
$map1 = New-SPClaimTypeMapping -IncomingClaimType "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress" -IncomingClaimTypeDisplayName "EmailAddress" -SameAsIncoming
Get-Help Add-SPDiagnosticsPerformanceCounter -examples
<#This example adds the _Total instance of the counter % Processor Time in the
    category Processor on database servers.#>
Add-SPDiagnosticsPerformanceCounter -category Processor -counter "%Processor Time" -instance "_Total" -databaseserver
Get-SPDiagnosticsPerformanceCounter
Get-Help Add-SPDistributedCacheServiceInstance -examples -Online
#Add Distributed Cache
Add-SPDistributedCacheServiceInstance

SharePoint Actions or SharePoint Verbs in PowerShell

I just finished with the huge list of Get commands in SharePoint. Below is the list of all other verbs.
Please do not use them on a Production server directly. After a Add/Update/Delete, the Get commands are extremely powerful to view the results. And, wow, SharePoint Development team has done a wonderful job in creating such simple and powerful commandlets..Thanks a ton!
Add
BackUp
Clear
Connect
Convert
Copy
Disable
Disconnect
Dismount
Enable
Export
Get
Grant
Import
Initialise
Install
Invoke
Merge
Mount
Move
New
Pause
Publish
Receive
Register
Remove
Repair
Reset
Restart-SPAppInstanceJob
Restore
Resume
Revoke
Set
Split
Start
Stop
Suspend
Sync
Test
Unistall
Unpublish
Update
Upgrade

Saturday, 11 June 2016

SharePoint LIst of all Web Templates - GEt-SPWebTemplate

Title                                       Name                                      
-----                                       ----                                      
Globale Vorlage                             GLOBAL#0                                  
Teamwebsite                                 STS#0                                     
Leere Website                               STS#1                                     
Dokumentarbeitsbereich                      STS#2                                     
Standard-Besprechungsarbeitsbereich         MPS#0                                     
Leerer Besprechungsarbeitsbereich           MPS#1                                     
Entscheidung-Besprechungsarbeitsbereich     MPS#2                                     
Sozialer Besprechungsarbeitsbereich         MPS#3                                     
Mehrseitiger Besprechungsarbeitsbereich     MPS#4                                     
Zentrale Verwaltungssite                    CENTRALADMIN#0                            
Wiki-Website                                WIKI#0                                    
Blog                                        BLOG#0                                    
Gruppenarbeitssite                          SGS#0                                     
Mandantenverwaltungswebsite                 TENANTADMIN#0                             
App-Vorlage                                 APP#0                                     
App-Katalogwebsite                          APPCATALOG#0                              
Access Services-Site                        ACCSRV#0                                  
Access Services-Website (intern)            ACCSVC#0                                  
Access Services-Website                     ACCSVC#1                                  
Dokumentcenter                              BDR#0                                     
Entwicklerwebsite                           DEV#0                                     
Akademische Bibliothek                      DOCMARKETPLACESITE#0                      
eDiscovery Center                           EDISC#0                                   
eDiscovery-Fall                             EDISC#1                                   
(veraltet) Datenarchiv                      OFFILE#0                                  
Datenarchiv                                 OFFILE#1                                  
Verwaltungssite der gemeinsamen Dienste     OSRV#0                                    
PowerPivot-Site                             PowerPivot#0                              
PerformancePoint                            PPSMASite#0                               
Business Intelligence Center                BICenterSite#0                            
Project Web App-Site                        PWA#0                                     
Microsoft Project-Website                   PWS#0                                     
SharePoint Portal Server-Website            SPS#0                                     
Persönlicher SharePoint Portal Server-Sp... SPSPERS#0                                 
Persönlicher SharePoint Portal Server-Be... SPSPERS#2                                 
Persönlicher SharePoint Portal Server-Be... SPSPERS#3                                 
Persönlicher SharePoint Portal Server-Be... SPSPERS#4                                 
Leerer persönlicher SharePoint Portal Se... SPSPERS#5                                 
Personalisierungswebsite                    SPSMSITE#0                                
Bereichsvorlage 'Inhalt'                    SPSTOC#0                                  
Bereichsvorlage 'Thema'                     SPSTOPIC#0                                
Website 'Nachrichten'                       SPSNEWS#0                                 
Veröffentlichungswebsite                    CMSPUBLISHING#0                           
Veröffentlichungssite                       BLANKINTERNET#0                           
Website für Presseerklärungen               BLANKINTERNET#1                           
Veröffentlichungssite mit Workflow          BLANKINTERNET#2                           
Website 'Nachrichten'                       SPSNHOME#0                                
Websiteverzeichnis                          SPSSITES#0                                
Bereichsvorlage 'Community'                 SPSCOMMU#0                                
Berichtscenter                              SPSREPORTCENTER#0                         
Zusammenarbeitsportal                       SPSPORTAL#0                               
Unternehmenssuchcenter                      SRCHCEN#0                                 
Profile                                     PROFILES#0                                
Veröffentlichungsportal                     BLANKINTERNETCONTAINER#0                  
Mein Websitehost                            SPSMSITEHOST#0                            
Unternehmenswiki                            ENTERWIKI#0                               
Projektwebsite                              PROJECTSITE#0                             
Produktkatalog                              PRODUCTCATALOG#0                          
Communitywebsite                            COMMUNITY#0                               
Communityportal                             COMMUNITYPORTAL#0                         
Basissuchcenter                             SRCHCENTERLITE#0                          
Basissuchcenter                             SRCHCENTERLITE#1                          
Visio-Prozessrepository                     vispr#0                                   
Globale Vorlage                             GLOBAL#0                                  
Teamwebsite                                 STS#0                                     
Leere Website                               STS#1                                     
Dokumentarbeitsbereich                      STS#2                                     
Standard-Besprechungsarbeitsbereich         MPS#0                                     
Leerer Besprechungsarbeitsbereich           MPS#1                                     
Entscheidung-Besprechungsarbeitsbereich     MPS#2                                     
Sozialer Besprechungsarbeitsbereich         MPS#3                                     
Mehrseitiger Besprechungsarbeitsbereich     MPS#4                                     
Zentrale Verwaltungssite                    CENTRALADMIN#0                            
Wiki-Website                                WIKI#0                                    
Blog                                        BLOG#0                                    
Gruppenarbeitssite                          SGS#0                                     
Mandantenverwaltungswebsite                 TENANTADMIN#0                             
Access Services-Site                        ACCSRV#0                                  
Posten-Webdatenbank                         ACCSRV#1                                  
Gemeinnützige Spenden-Webdatenbank          ACCSRV#3                                  
Kontakte-Webdatenbank                       ACCSRV#4                                  
Probleme-Webdatenbank                       ACCSRV#6                                  
Projekte-Webdatenbank                       ACCSRV#5                                  
Dokumentcenter                              BDR#0                                     
(veraltet) Datenarchiv                      OFFILE#0                                  
Datenarchiv                                 OFFILE#1                                  
Verwaltungssite der gemeinsamen Dienste     OSRV#0                                    
PerformancePoint                            PPSMASite#0                               
Business Intelligence Center                BICenterSite#0                            
Project Web App-Site                        PWA#0                                     
Microsoft Project-Website                   PWS#0                                     
SharePoint Portal Server-Website            SPS#0                                     
SharePoint Portal Server - Persönlicher ... SPSPERS#0                                 
Personalisierungswebsite                    SPSMSITE#0                                
Bereichsvorlage 'Inhalt'                    SPSTOC#0                                  
Bereichsvorlage 'Thema'                     SPSTOPIC#0                                
Website 'Nachrichten'                       SPSNEWS#0                                 
Veröffentlichungswebsite                    CMSPUBLISHING#0                           
Veröffentlichungssite                       BLANKINTERNET#0                           
Website für Presseerklärungen               BLANKINTERNET#1                           
Veröffentlichungssite mit Workflow          BLANKINTERNET#2                           
Website 'Nachrichten'                       SPSNHOME#0                                
Websiteverzeichnis                          SPSSITES#0                                
Bereichsvorlage 'Community'                 SPSCOMMU#0                                
Berichtscenter                              SPSREPORTCENTER#0                         
Zusammenarbeitsportal                       SPSPORTAL#0                               
Unternehmenssuchcenter                      SRCHCEN#0                                 
Profile                                     PROFILES#0                                
Veröffentlichungsportal                     BLANKINTERNETCONTAINER#0                  
Mein Websitehost                            SPSMSITEHOST#0                            
Unternehmenswiki                            ENTERWIKI#0                               
Basissuchcenter                             SRCHCENTERLITE#0                          
Basissuchcenter                             SRCHCENTERLITE#1                          
FAST Search-Center                          SRCHCENTERFAST#0                          
Visio-Prozessrepository                     vispr#0                                   
Global template                             GLOBAL#0                                  
Team Site                                   STS#0                                     
Blank Site                                  STS#1                                     
Document Workspace                          STS#2                                     
Basic Meeting Workspace                     MPS#0                                     
Blank Meeting Workspace                     MPS#1                                     
Decision Meeting Workspace                  MPS#2                                     
Social Meeting Workspace                    MPS#3                                     
Multipage Meeting Workspace                 MPS#4                                     
Central Admin Site                          CENTRALADMIN#0                            
Wiki Site                                   WIKI#0                                    
Blog                                        BLOG#0                                    
Group Work Site                             SGS#0                                     
Tenant Admin Site                           TENANTADMIN#0                             
App Template                                APP#0                                     
App Catalog Site                            APPCATALOG#0                              
Access Services Site                        ACCSRV#0                                  
Access Services Site Internal               ACCSVC#0                                  
Access Services Site                        ACCSVC#1                                  
Document Center                             BDR#0                                     
Developer Site                              DEV#0                                     
Academic Library                            DOCMARKETPLACESITE#0                      
eDiscovery Center                           EDISC#0                                   
eDiscovery Case                             EDISC#1                                   
(obsolete) Records Center                   OFFILE#0                                  
Records Center                              OFFILE#1                                  
Shared Services Administration Site         OSRV#0                                    
PowerPivot Site                             PowerPivot#0                              
PerformancePoint                            PPSMASite#0                               
Business Intelligence Center                BICenterSite#0                            
Project Web App Site                        PWA#0                                     
Microsoft Project Site                      PWS#0                                     
SharePoint Portal Server Site               SPS#0                                     
SharePoint Portal Server Personal Space     SPSPERS#0                                 
Storage And Social SharePoint Portal Ser... SPSPERS#2                                 
Storage Only SharePoint Portal Server Pe... SPSPERS#3                                 
Social Only SharePoint Portal Server Per... SPSPERS#4                                 
Empty SharePoint Portal Server Personal ... SPSPERS#5                                 
Personalization Site                        SPSMSITE#0                                
Contents area Template                      SPSTOC#0                                  
Topic area template                         SPSTOPIC#0                                
News Site                                   SPSNEWS#0                                 
Publishing Site                             CMSPUBLISHING#0                           
Publishing Site                             BLANKINTERNET#0                           
Press Releases Site                         BLANKINTERNET#1                           
Publishing Site with Workflow               BLANKINTERNET#2                           
News Site                                   SPSNHOME#0                                
Site Directory                              SPSSITES#0                                
Community area template                     SPSCOMMU#0                                
Report Center                               SPSREPORTCENTER#0                         
Collaboration Portal                        SPSPORTAL#0                               
Enterprise Search Center                    SRCHCEN#0                                 
Profiles                                    PROFILES#0                                
Publishing Portal                           BLANKINTERNETCONTAINER#0                  
My Site Host                                SPSMSITEHOST#0                            
Enterprise Wiki                             ENTERWIKI#0                               
Project Site                                PROJECTSITE#0                             
Product Catalog                             PRODUCTCATALOG#0                          
Community Site                              COMMUNITY#0                               
Community Portal                            COMMUNITYPORTAL#0                         
Basic Search Center                         SRCHCENTERLITE#0                          
Basic Search Center                         SRCHCENTERLITE#1                          
Visio Process Repository                    visprus#0                                 
Global template                             GLOBAL#0                                  
Team Site                                   STS#0                                     
Blank Site                                  STS#1                                     
Document Workspace                          STS#2                                     
Basic Meeting Workspace                     MPS#0                                     
Blank Meeting Workspace                     MPS#1                                     
Decision Meeting Workspace                  MPS#2                                     
Social Meeting Workspace                    MPS#3                                     
Multipage Meeting Workspace                 MPS#4                                     
Central Admin Site                          CENTRALADMIN#0                            
Wiki Site                                   WIKI#0                                    
Blog                                        BLOG#0                                    
Group Work Site                             SGS#0                                     
Tenant Admin Site                           TENANTADMIN#0                             
Access Services Site                        ACCSRV#0                                  
Assets Web Database                         ACCSRV#1                                  
Charitable Contributions Web Database       ACCSRV#3                                  
Contacts Web Database                       ACCSRV#4                                  
Issues Web Database                         ACCSRV#6                                  
Projects Web Database                       ACCSRV#5                                  
Document Center                             BDR#0                                     
(obsolete) Records Center                   OFFILE#0                                  
Records Center                              OFFILE#1                                  
Shared Services Administration Site         OSRV#0                                    
PowerPivot Site                             PowerPivot#0                              
PerformancePoint                            PPSMASite#0                               
Business Intelligence Center                BICenterSite#0                            
Project Web App Site                        PWA#0                                     
Microsoft Project Site                      PWS#0                                     
SharePoint Portal Server Site               SPS#0                                     
SharePoint Portal Server Personal Space     SPSPERS#0                                 
Personalization Site                        SPSMSITE#0                                
Contents area Template                      SPSTOC#0                                  
Topic area template                         SPSTOPIC#0                                
News Site                                   SPSNEWS#0                                 
Publishing Site                             CMSPUBLISHING#0                           
Publishing Site                             BLANKINTERNET#0                           
Press Releases Site                         BLANKINTERNET#1                           
Publishing Site with Workflow               BLANKINTERNET#2                           
News Site                                   SPSNHOME#0                                
Site Directory                              SPSSITES#0                                
Community area template                     SPSCOMMU#0                                
Report Center                               SPSREPORTCENTER#0                         
Collaboration Portal                        SPSPORTAL#0                               
Enterprise Search Center                    SRCHCEN#0                                 
Profiles                                    PROFILES#0                                
Publishing Portal                           BLANKINTERNETCONTAINER#0                  
My Site Host                                SPSMSITEHOST#0                            
Enterprise Wiki                             ENTERWIKI#0                               
Basic Search Center                         SRCHCENTERLITE#0                          
Basic Search Center                         SRCHCENTERLITE#1                          
FAST Search Center                          SRCHCENTERFAST#0                          
Visio Process Repository                    visprus#0