Pages

Showing posts with label Powershell. Show all posts
Showing posts with label Powershell. Show all posts

Monday, April 15, 2019

Re-Create WSS_Logging Database in the Sharepoint 2013 Server

My WSS_Logging Database is corrupted then I want to create new database.

My Central Admin --> Monitorng --> Configure usage and health data collection settings do point to WSS_Logging too, but this DB is not present.

you can create manually re-create WSS_Logging DB using in the following powershell script.

Looks like it will work. you should first delete Service Application since it already existed, but than you could recreate it + it created database. No complaints in the event log so far.

Try using this PowerShell:

#Configuration Variables
$UsageSAName = "Usage and Health Data Collection Service"
$DatabaseName = "WSS_Logging"
$DatabaseServer="SPSQL Servername\Instance Name"
$UsageLogPath = "C:\UsageLogs\"
 
#Get the Usage Service Application Service Instance
$ServiceInstance = Get-SPUsageService
 
#Create new Usage Service application
New-SPUsageApplication -Name $UsageSAName -DatabaseServer $DatabaseServer -DatabaseName $DatabaseName -UsageService $ServiceInstance #> $null
 
#Create Service Application Proxy..." 
$proxy = Get-SPServiceApplicationProxy | where {$_.TypeName -eq "Usage and Health Data Collection Proxy"}
$proxy.Provision()

Friday, March 22, 2019

Shrepoint Page library not created After activated Publishing feature. Unable to create any publishing pages

I have enabled SharePoint server publishing feature in the site, which is a site collection as well. But unfortunately the Pages library list is not appearing and i am unable to create any publishing pages.
Is there a way to solve this. I tried deactivating and activating via manually still i didnt get solution.

Solution:

Kindly find in the powershell script then deactivating and activating using powershell commands.
Finally, It will appear publishing feature and page library lists.

SharePoint Server:
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/PnP-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

Monday, July 30, 2018

Deploy Sharepoint 2013 Solution Package(WSP Packages) using powershell

Add WSP Solution

Add-SPSolution -LiteralPath "C:\DeployLDACPCustom\LDAPCPCustom.wsp"

Install-SPSolution -Identity "LDAPCPCustom.wsp" -GACDeployment


Install-SPFeature -path "LDAPCPCustom" -CompatibilityLevel 15


Enable-SPFeature -identity "LDAPCPCustom" -URL http://test:30000/

Update Solution Package

Update-SPSolution -GACDeployment -Identity "LDAPCP.wsp" -LiteralPath "C:\DeployLDACP\LDAPCP.wsp"

Remove WSP

De activate feature by manually in the site URL

Disable-SPFeature -identity "LDAPCP.Custom"

Uninstall-SPSolution -Identity "LDAPCPCustom.wsp"

Remove-SPSolution -Identity "LDAPCPCustom.wsp"

Tuesday, January 23, 2018

All Power shell Backup Commands for SharePoint Site


Backup Site Collection

Backup -SPSite http://spuat/sites/SG -Path C:\Backup\SGSite.bak

Restore Site Collection

Restore-SPSite http://spuat:222/sites/SG  -Path C:\Backup\SGSite.bak -Force

Tuesday, June 13, 2017

Using PowerShell to Get SharePoint Content database size

To get the all CONTENT_DB  size in SHAREPOINT server(MB), Using below commands power shell commands.


Get-SPDatabase | Sort-Object disksizerequired -desc | Format-Table Name, @{Label ="Size in MB"; Expression = {$_.disksizerequired/1024/1024}} >c:\Content_DBsize.txt

The above code will export to C drive and you can change drive for your requirement.

Tuesday, February 14, 2017

Add Active Directory Module for Windows Powershell

Add Active Directory Module for Windows Powershell

Open Server Manager and Add role for Windows Powershell








Wednesday, November 9, 2016

Incoming Email Sharepoint List workflow is not starting in the new item is created

1- First of all, we have check in SharePoint server setting if workflow trigger on email is enabled or not, and enable it.
Using STSADM 
Open the SharePoint 2010 Management Shell as administrator and run following command:

stsadm -o getproperty -pn declarativeworkflowautostartonemailenabled

Output should be:

PS 

If Value of property is “No” you have to enable it by typing following command:

stsadm -o setproperty -pn declarativeworkflowautostartonemailenabled -pv true.

Using PowerShell
st


This property was somewhat easier to set using STSADM, however keep in mind that STSADM is being retired. PowerShell is the command line administration tool to use moving forward.

Open the SharePoint 2010 Management Shell as administrator and run the following to determine the value of the DeclarativeWorkflowAutoStartOnEmailEnabled property:

$spWebService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$spWebService.DeclarativeWorkflowAutoStartOnEmailEnabled

If the Value of the property is "False" you have to enable it by typing the following commands:


Execute in the powershell script to set true in the DeclarativeWorkflowAutoStartOnEmailEnabled.
By default DeclarativeWorkflowAutoStartOnEmailEnabled property is false.


$spWebService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$spWebService.DeclarativeWorkflowAutoStartOnEmailEnabled = $true
$spWebService.Update()