Category: Sharepoint

Turn on Previous Versions For All in Office 365 OneDrive for Business
article #976, updated 2790 days ago

There is a mixture of public reference statements as to whether or not Previous Versions, also called Versioning, is enabled in OneDrive for Business, which is really a second frontend for Sharepoint. Recently a new installation was studied and there was a mix of automatic activations of Versioning for different libraries and lists made, without clear logic behind. Versioning is essential as a backup method for many related uses, so it becomes essential to know how to turn it on automatically for all libraries and lists of an entire Office 365 tenant. And right now, this appears to be the only published way, a contributed script in the Office 365 Gallery:

https://gallery.technet.microsoft.com/office/Enable-versioning-for-all-ae5cfb5d

In order to use it, one first installs:

Then log into the Office 365 tenant as an administrator, and click Sharepoint. You’ll be looking at the page for a URL something like this:

https://partofmydomain.sharepoint.com/_layouts/15/sharepoint.aspx

Now run PowerShell as administrator, take the “partofmydomain” chunk of text from your browser, and form the SharePoint admin URL. Don’t browse to it, but you’ll need it shortly:

https://partofmydomain-admin.sharepoint.com

Now you’ll need the script from the web page referenced at the top of this article, saved to a location to which you can CD in PowerShell. Get to that location in the shell, and run ‘notepad versioning.ps1’, towards the end you’ll see two path lines:

Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"  
Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"

The 15’s need to be changed to 16’s to match the current version of the Sharepoint installables above. Once you have this, run:

Set-ExecutionPolicy Unrestricted

in PowerShell if you haven’t already, and then:

./Versioning.ps1

It will ask you for the URL; give it the one you constructed above. Then it will ask you for admin credentials. Once it has them, it will run through every list and library, and if Versioning can be turned on, it will be.

Categories:      

==============

Windows Search Server: initiate crawls by command line and scheduled task
article #965, updated 2814 days ago

The automatic crawl scheduler in Windows Search Server sometimes fails; you can get far more positive and creative control with scripting. Here’s how.

First you’ll need the name of the “Search Service Application”. I found these under “Farm Search Administration” in the SharePoint site; the default/built-in is named “Search Service Application”, but on the server being worked there was a second custom one for production work, which for this document we will call “SSAXYZ”.

Now we need the “Content Sources” list. Here’s where we learn whether it’s working or not.

Next step is to create the scripts below. You may want all of them. A usually working location and filename is in each initial comment. If your server doesn’t have an E:, you will need to rewrite just a tad.

The way it works is, you set your scheduled task to run the CMD, and the CMD starts up the PowerShell. It is possible to have the scheduled task run the PowerShell directly, but it’s much harder to read that way. There are two pairs of scripts below, one pair for incremental crawls, and one for full. It is often recommendable to run the incremental daily and the full weekly, if available server horsepower (most of all RAID) is enough for the fileset(s) involved.

The PowerShell comes from here, it stops any crawling which may be going on (or stalled) and restarts the desired (full or incremental), for every Search Service Application. So if you have multiple SSA’s you may want to modify so that it only does what you want.

REM E:\Search Server Scripts\Initiate-Full-Crawl.cmd
C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe  " & ' E:\Search Server Scripts\\Initiate-Full-Crawl.ps1 ' "
# E:\Search Server Scripts\Initiate-Full-Crawl.ps1
Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue
Get-SPEnterpriseSearchCrawlContentSource -SearchApplication "SSAXYZ" | ForEach-Object {
    if ($_.CrawlStatus -ne "Idle")
    {
        Write-Host "Stopping currently running crawl for content source $($_.Name)..."
        $_.StopCrawl()
        do { Start-Sleep -Seconds 1 }
        while ($_.CrawlStatus -ne "Idle")
    }
    Write-Host "Starting full crawl for content source $($_.Name)..."
    $_.StartFullCrawl()
}
REM E:\Search Server Scripts\Initiate-Incremental-Crawl.cmd
C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe  " & ' E:\Search Server Scripts\\Initiate-Incremental-Crawl.ps1 ' "
# E:\Search Server Scripts\Initiate-Incremental-Crawl.ps1
Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue
Get-SPEnterpriseSearchCrawlContentSource -SearchApplication "SSAXYZ" | ForEach-Object {
    if ($_.CrawlStatus -ne "Idle")
    {
        Write-Host "Stopping currently running crawl for content source $($_.Name)..."
        $_.StopCrawl()        
        do { Start-Sleep -Seconds 1 }
        while ($_.CrawlStatus -ne "Idle")
    }
    Write-Host "Starting full crawl for content source $($_.Name)..."
    $_.StartIncrementalCrawl()
}

Categories:      

==============

Sharepoint Diagnostic Studio
article #386, updated 4450 days ago

This looked rather interesting:

http://technet.microsoft.com/en-us/library/hh144782.aspx

Categories:      

==============

Sharepoint and other database services on IIS: owssvr.dll
article #385, updated 4450 days ago

If you get an error like “The module … owssvr.dll could not be loaded due to a configuration problem”, e.g. having to do with IIS and Sharepoint (including Microsoft Search Server 2010), try going into IIS manager, under Application Pools, and open up Advanced Settings for each of the items which may be malfunctioning. You’ll see “Enable 32-bit Applications”, and if that’s set to “True” on a 64-bit server, that’s the problem, set it to “False” and you’re probably in!

Categories:      

==============

Refresh Sharepoint in SBS 2008
article #281, updated 4714 days ago

The following command set appears to be able to perform a major refresh/upgrade/update to Sharepoint:

C:
cd \Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Bin
stsadm -o provisionservice -action stop -servicetype spwebservice -servicename ""
stsadm -o provisionservice -action start -servicetype spwebservice -servicename ""
psconfig -cmd upgrade -inplace b2b -wait -force 

I found that after running the above, I had to add binding ‘http://companyweb’ in IIS, on port 80.

In addition, the following pages seem to contain info for use when companyweb is not working:

http://davidcmoisan.wordpress.com/2009/05/08/sbs-2008-solving-four-sharepoint-problems-at-once/

http://forums.techarena.in/small-business-server/662096.htm

http://www.vistax64.com/sbs-server/272630-companyweb-has-gone-missing-sbs-2008-standard-sp2-sharepoint.html

Categories: