Share via


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