Marios Welt des SharePoints

SharePoint forever

Analyzing the User Profile Storage or User sync


To get more useful informations about the active directory import you have to check the database itself:

/****** Script for SelectTopNRows command from SSMS ******/
SELECT [RecordID]
,[UserID]
,[NTName]
,[PreferredName]
,[Email]
,[SID]
,[Manager]
,[SipAddress]
,[LastUpdate]
,[LastUserUpdate]
,[LastImported]
,[bDeleted]
,[DataSource]
,[MasterRecordID]
,[ProfileSubtypeID]
,[DSGuid]
,[PictureUrl]
,[PartitionID]
FROM [ProfileDB].[dbo].[UserProfile]
where [LastUpdate] < ‚2017-11-04 13:00:00.157‘

In this database you can find more interesting tables like:

  • [ProfileDB].[dbo].[Profile_DeletedUsers]
  • [ProfileDB].[dbo].[MySiteDeletionStatus]
  • [Profile DB].[dbo].[ADImportFailedItems]
  • [Profile DB].[dbo].[UserProfileEventLog]
Advertisements

SharePoint 2016 Feature Pack2 First impressions


Finally i find the time to install the Feature Pack 2 on my SharePoint 2016 onPremise developer system. The first thing i want to test was the support of the SharePoint Framework (SPFX). To test this very quickly i decided to install the spfx-40-fantastics solution from https://github.com/OlivierCC/spfx-40-fantastics/. On github you will find a also find a wiki article for downloading and installing this great tools. The description is only based on Office 365 but i’ll be sure they will update this article soon.

What should i say… it works like a charme!

 

SharePoint People Picker showing orphaned user objects


SharePoint People Picker showing orphaned user objects and only a few people will be affected. If the problem exists for all users then the orphaned users mostly only old backgrounds in the „Userslist“ of the sitecollections. But the people picker also uses a client side cache. You can delete this cache for example by activating the developer tools on the IE or Chrome with the Key F12. Then you can directly type in the console something like this:

localStorage.clear();

Attention !!! With this command you will delete all localSotrage Data. So it’s like you kill a fly with an sledgehammer.

The more elegant solution is something like:

Add a new Page to a Web and add the Scripting WebPart to it with the following code inside:

ExecuteOrDelayUntilScriptLoaded(function () {
var mru = SPClientPeoplePickerMRU.GetSPClientPeoplePickerMRU();
mru.ResetCache();
}, “clientpeoplepicker.js”);
alert(„The local People Picker Cache is cleared. Have a nice day!“);

If a customer call for help you can send him the link to this page and everything is getting fine (I’ll hope so )

 

Monitoring SharePoint Systems Part 1


First of all you can monitor the following counters on a sharepoint server to check his performance and health:

\.NET CLR Memory(*)\% Time in GC
\ASP.NET\Application Restarts
\ASP.NET\Request Execution Time
\ASP.NET\Requests Rejected
\ASP.NET\Requests Queued
\ASP.NET\Worker Process Restarts
\ASP.NET\Request Wait Time
\ASP.NET Applications(*)\Requests/Sec
\LogicalDisk(*)\% Idle Time
\Memory\Available MBytes
\Memory\% Committed Bytes In Use
\Memory\Page Faults/sec
\Memory\Pages Input/sec
\Memory\Page Reads/sec
\Memory\Pages/sec
\Memory\Pool Nonpaged Bytes
\Network Interface(*)\Bytes Total/sec
\Network Interface(*)\Packets/sec
\Paging File(*)\% Usage
\PhysicalDisk(*)\Current Disk Queue Length
\PhysicalDisk(*)\% Disk Time
\PhysicalDisk(*)\Disk Transfers/sec
\PhysicalDisk(*)\Avg. Disk sec/Transfer
\Process(*)\% Processor Time
\Process(*)\Page Faults/sec
\Process(*)\Page File Bytes Peak
\Process(*)\Page File Bytes
\Process(*)\Private Bytes
\Process(*)\Virtual Bytes Peak
\Process(*)\Virtual Bytes
\Process(*)\Working Set Peak
\Process(*)\Working Set
\Processor(*)\% Processor Time
\Processor(*)\Interrupts/sec
\Redirector\Server Sessions Hung
\Server\Work Item Shortages
\System\Context Switches/sec
\System\Processor Queue Length
\Web Service(*)\Bytes Received/sec
\Web Service(*)\Bytes Sent/sec
\Web Service(*)\Total Connection Attempts (all instances)
\Web Service(*)\Current Connections
\Web Service(*)\Get Requests/sec

You can do this also by powershell with commands like this:

Get-Counter -ComputerName $server -Counter „\web service(_total)\Current Connections“ | Select Timestamp , Readings
Get-WmiObject -Class Win32_Processor -ComputerName $servers | select SystemName , Name , MaxClockSpeed , Manufacturer , status

Office Online Server


In the year 2016 Microsoft decides to change the name for the „Office Web Apps Server“ to „Office Online Server“. The second big change is that this server will continue the Excel Services functionality  for SharePoint 2016.

You can use the OOS with older Servers like SharePoint 2013 but not for all services!

Here is the compatibility list from Microsoft:

Compability

 

Products Office Web Apps Server Office Online Server
SharePoint Server 2013 Ja Ja
SharePoint Server 2016 Ja Ja
Lync Server 2013 Ja Ja
Skype for Business Server 2015 Ja Ja
Exchange Server 2013 Ja Nein
Exchange Server 2016 Nein Ja
Exchange Server 2010 Nicht genutzt Nicht genutzt
Lync Server 2010 Nicht genutzt Nicht genutzt

OOS has to be installed on a WINDOWS 2012 R2. I will inform you if you can install it on a WINDOWS 2016.

Prerequistions

To install the server you have to activate a few services und roles:

Install-WindowsFeature Web-Server, Web-Mgmt-Tools, Web-Mgmt-Console, Web-WebServer, Web-Common-Http, Web-Default-Doc, Web-Static-Content, Web-Performance, Web-Stat-Compression, Web-Dyn-Compression, Web-Security, Web-Filtering, Web-Windows-Auth, Web-App-Dev, Web-Net-Ext45, Web-Asp-Net45, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Includes, InkandHandwritingServices, Windows-Identity-Foundation

Don’t forget to restart the server after the installation is finished.

Binary Installation

Now install the server with the image, then install all Language Packs that you need. Immediately followed by the latest CU.

Configure

Now you can create a new Office Online Server Farm with a commandlet like this:

New-OfficeWebAppsFarm -InternalURL „https://oos.zed.com&#8220; -ExternalURL „https://oos.zed.com&#8220; -CertificateName „oos.zed.com“

The „CertificateName“ is the friendly name of the certificate. If the certificate have no friendly name

In my opinion it is the best choice to take the same name for internal and external access to this application. You have to take care for a splitting DNS entry only.

After the installation is completed you can test the functionality with this Url:

https://oos.zed.local/hosting/discovery

The result should look something like this:

hostingdiscovery

You can set more properties any time you want with the commandlet

Set-OfficeWebAppsFarm

The available Properties shown here are from technet: https://technet.microsoft.com/en-us/library/jj219442.aspx

Parameter Required Type Description
AllowCEIP Optional System.Management.Automation.SwitchParameter Enables Customer Experience Improvement Program (CEIP) reporting on all servers in the Office Web Apps Server farm.

ImportantImportant:
You must restart every server in the Office Web Apps Server farm for this change to take effect.
AllowHttp Optional System.Management.Automation.SwitchParameter Indicates that IIS sites should be provisioned on port 80 for HTTP access. Use AllowHTTP only in environments where all computers require IPSEC (full encryption) or in test environments that do not contain sensitive files.

Enabled automatically when you enable SSLOffloaded.

ImportantImportant:
You must restart every server in the farm for this change to take effect.
AllowHttpSecureStoreConnections Optional System.Management.Automation.SwitchParameter Indicates that secure store connections can be made by using non-SSL connections (such as HTTP). The default is False.

Use AllowHTTPSecureStoreConnections only in environments where all computers require IPSEC (full encryption) or in test environments that do not contain sensitive files.

CacheLocation Optional System.String Specifies the location of the global disk cache that is used to store rendered image files. The default location is %programdata%\Microsoft\OfficeWebApps\Working\d\.
CacheSizeInGB Optional System.Nullable Specifies the maximum size of the global disk cache in gigabytes.

The type must be an integer value in the range of 0 to any positive integer. The default size is 15 GB.

CertificateName Optional System.String Specifies the friendly name of the certificate that Office Web Apps Server uses to create HTTPS bindings.

If the specified certificate is not found or has expired, or if the specified value is associated with more than one certificate, an error is logged and the farm is not created.

ImportantImportant:
This value is used on every server that joins the Office Web Apps Server farm. Therefore, every server in the farm must have a certificate that has this friendly name.

You don’t have to specify the CertificateName parameter if you are using either the AllowHttp or SSLOffloaded parameter.

ImportantImportant:
You must restart every server in the farm for this change to take effect.
ClipartEnabled Optional System.Management.Automation.SwitchParameter Enables support for inserting clip art from Office.com into Office documents. This feature requires server-to-web communication, configured either directly or by using a proxy that you specify by using the Proxy parameter.
Confirm Optional System.Management.Automation.SwitchParameter Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters.
DocumentInfoCacheSize Optional System.Nullable Specifies the maximum number of document conversion records that are stored in a memory cache.

The default value is 5000 records.

EditingEnabled Optional System.Management.Automation.SwitchParameter Enables support for editing in the browser. The default is False. Only set to True if you have the appropriate licensing to use the edit functionality.
ExcelAllowExternalData Optional System.Management.Automation.SwitchParameter Enables the refresh of supported external data in Excel Web App workbooks where workbooks contain connections to external data. The default is True.
ExcelConnectionLifetime Optional System.Nullable Specifies the duration, in seconds, of external data connections for Excel Web App. The default is 1800 seconds.
ExcelExternalDataCacheLifetime Optional System.Nullable Specifies the duration, in seconds, of the external data cache lifetime in Excel Web App. The default is 300 seconds.
ExcelPrivateBytesMax Optional System.Nullable Specifies the maximum private bytes, in megabytes, used by Excel Web App. When set to -1, the maximum private bytes use 50 percent of physical memory on the computer.

The type must be -1 or any positive integer. The default value is -1.

ImportantImportant:
You must restart every server in the farm for this change to take effect.
ExcelRequestDurationMax Optional System.Nullable Specifies the maximum duration, in seconds, for a single request in a session. After this time elapses, the request times out.

The type must be -1 (no limit) or an integer in the range of 1 to 2073600. The default value is 300.

ExcelSessionTimeout Optional System.Nullable Specifies the time, in seconds, that a session remains active in Excel Web App when there is no user activity. Valid values include the following:

-1 Session never expires.

0 Session expires at the end of a single request.

1 to 2073600 Session remains active for 1 second to 24 days. The default value is 450.

ExcelWarnOnDataRefresh Optional System.Management.Automation.SwitchParameter Turns off or on the warning dialog box that is displayed when data refreshes in Excel Web App.
ExcelWorkbookSizeMax Optional System.Nullable Specifies the maximum size, in megabytes, of a workbook that can be loaded.

The type must be an integer value in the range of 1 to 2000. The default value is 10.

ExternalURL Optional System.String Specifies the URL root that clients use to access the Office Web Apps Server farm from the Internet. In the case of a load-balanced, multiserver Office Web Apps Server farm, the external URL is bound to the IP address of the external-facing load balancer.

An Office Web Apps Server farm requires at least one URL,that isset by using either ExternalURL or InternalURL. You can also set both internal and external URLs.

FarmOU Optional System.String Specifies the name of the Active Directory organizational unit (OU) that servers must be a member of to join the Office Web Apps Server farm. Use this parameter to prevent unauthorized servers (that is, servers that are not in the OU) from joining an Office Web Apps Server farm.
Force Optional System.Management.Automation.SwitchParameter Suppresses any user prompts by answering „Yes.“
InternalURL Optional System.String Specifies the URL root that clients must use to access the Office Web Apps Server farm from the intranet.

An Office Web Apps Server farm requires at least one URL. It is set using either ExternalURL or InternalURL. You can also set both internal and external URLs.

LogLocation Optional System.String Specifies the location on the local computer where activity logs are stored.

The location applies for every server in the farm and cannot be customized on a per-server basis. The default location is %programdata%\Microsoft\OfficeWebApps\Data\Logs\ULS\.

Be sure to allow sufficient disk space on the drive where logs are stored.

ImportantImportant:
You must restart every server in the farm for this change to take effect.
LogRetentionInDays Optional System.Nullable Specifies the number of days that log entries are stored. Log entries older than the configured date are trimmed.

The type must be an integer value in the range of 0 to 365. The default value is 7 days.

ImportantImportant:
You must restart every server in the farm for this change to take effect.
LogVerbosity Optional System.String Specifies how much information is stored in the trace log files. The values are as follows:

VerboseEX writes low-level detail to the trace log file. Useful for traces that are likely to be high volume.

Verbose writes low-level detail to the trace log file.

Medium writes medium-level detail to the trace log file.

High writes high-level detail to the trace log file.

Monitorable writes traces that represent an unusual code path and actions that should be monitored.

Unexpected writes traces that represent an unexpected code path and actions that should be monitored.

None writes no trace information to the trace log file.

ImportantImportant:
Leaving the LogVerbosity at a low level for a long time will adversely affect performance.
ImportantImportant:
You must restart every server in the farm for this change to take effect.
MaxMemoryCacheSizeInMB Optional System.Nullable Specifies, in megabytes, the maximum amount of memory that the rendering cache can use.

The type must be an integer value in the range of 0 to any positive integer. The default size is 1024 MB.

MaxTranslationCharacterCount Optional System.Nullable Specifies the maximum number of characters a document can have in order to be translated.

The type must be an integer value. The value can be set to 0 to indicate no limit or a value from 2000 to 2,000,000. The default value is 125,000.

OpenFromUncEnabled Optional System.Management.Automation.SwitchParameter Turns on or off the ability to use Online Viewers to view Office files from a UNC path.

You must first set OpenFromUrlEnabled to True to allow Online Viewers to display files in UNC paths.

OpenFromUrlEnabled Optional System.Management.Automation.SwitchParameter Turns on or off the ability to use Online Viewers to view Officefiles from a URL or UNC path.
OpenFromUrlThrottlingEnabled Optional System.Management.Automation.SwitchParameter Throttles the number of Open From URL requests from any given server in a time period. The default throttling values, which are not configurable, make sure that an Office Web Apps Server farm will not overwhelm a single server with requests for content to be viewed in the Online Viewers.
PicturePasteDisabled Optional System.Management.Automation.SwitchParameter Turns off the ability for users to paste images from a web page into Office Web Apps. The default is False. If OpenFromURLEnabled is set to True and PicturePasteDisabled is not set or set to False, users can paste images into Office Web Apps.
Proxy Optional System.String Specifies the URL of the proxy server that is configured to allow HTTP requests to external sites. Typically configured together with the ClipartEnabled and TranslationEnabled parameters.
RecycleActiveProcessCount Optional System.Nullable Specifies the number of files that a single Word or PowerPoint process can render before the process is recycled.

The type must be an integer value in the range of 1 to 1000. The default value is 5.

ImportantImportant:
You must restart every server in the farm for this change to take effect.
RemovePersonalInformationFromLogs Optional System.Management.Automation.SwitchParameter Provides a best effort scrub of personal information from Office Web Apps Server logs and replaces values with a SHA256 hash. Potentially scrubbed information can be:

  • Document names and URLs
  • IP addresses
  • Email addresses
  • User names

The default is False. Note that enabling this parameter doesn’t guarantee that personal information won’t be logged to the Office Web Apps Server logs.

RenderingLocalCacheLocation Optional System.String Specifies the location of the temporary cache for use by the Word and PowerPoint Viewing Services.

The default location is %programdata%\Microsoft\OfficeWebApps\Working\waccache\.

SSLOffloaded Optional System.Management.Automation.SwitchParameter Indicates to the servers in the Office Web Apps Server farm that SSL is offloaded to the load balancer. When SSLOffloaded is enabled, web applications are bound to port 80 (HTTP) on the local server. However, HTML that references other resources, such as CSS or images, uses HTTPS URLs for those references.

ImportantImportant:
You must restart every server in the farm for this change to take effect.
TranslationEnabled Optional System.Management.Automation.SwitchParameter
ImportantImportant:
Enables support for automatic document translation using Microsoft Translator, an online service that translates text between languages. The translated file is shown in the Word Web App. Because Microsoft Translator is an online service, you must enable server-to-web communication directly or by using a proxy that you specify by using the Proxy parameter.
Microsoft Translator may collect data to improve the quality of translations.
TranslationServiceAddress Optional System.String Specifies the URL of the translation server that translation requests are sent to. The default is the Microsoft Translator online service. Typically you will not use this parameter unless you must change translation services.

ImportantImportant:
You must restart every server in the Office Web Apps Server farm for this change to take effect.
TranslationServiceAppId Optional System.String Specifies the application ID for the translation service. The default is the public application ID for Office Web Apps. Typically you will not use this parameter unless you have negotiated with Microsoft Translator for additional services and they have provided you with a private application ID.
WhatIf Optional System.Management.Automation.SwitchParameter Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

To connect the OOS to a SharePoint 2013 or SharePoint 2016 do this on a member server of the farm:

New-SPWOPIBinding -ServerName "oos.zed.com"
Set-SPWOPIZone –zone "external-https"
$config = (get-spsecuritytokenserviceconfig)
$config.allowoauthoverhttp = $true
$config.update()

if necassary you can define the WOPI-Zone

Set-SPWOPIZone -zone "external-https"

Using the Excel-SOAP-API

$Farm = Get-SPFarm
$Farm.Properties.Add("WopiLegacySoapSupport", "https://oos.zed.local/x/_vti_bin/ExcelServiceInternal.asmx");
$Farm.Update();

divorce connection to the Office Online Server in SharePoint

Remove-SPWOPIBinding -All:$true

To connect the server to a Exchange 2016 on Mailbox level

Set-MailboxServer MBX -WacDiscoveryEndpoint „https://oos.zed.com/hosting/discovery&#8220;
Restart-WebAppPool MsExchangeOwaAppPool

to connect the server to a Exchange 2016 on a organizational level

Set-OrganizationConfig -WacDiscoveryEndpoint „https://oos.zed.com/hosting/discovery&#8220;
Restart-WebAppPool MsExchangeOwaAppPool

and last but not least Skype for Business

on the topology builder
s4btopologybuilder

 How to detect the installed buildversion?

In a Powershell console you can use the following command to invoke a webrequest

(Invoke-WebRequest https://oos.zed.local/op/servicebusy.htm).Headers

 

or you can look at the configuration file for example with

Get-Content ‚C:\ProgramData\Microsoft\OfficeWebApps\Data\local\OfficeVersion.inc‘

Renew the certificate

# Install the new Certificate to all Servers in OOS Farm
# If necessary set the certificates FriendlyName to NewCertificate-FriendlyName
# After the new setting are confirmed you need to restart every server in this farm
Set-OfficeWebappsFarm -CertificateName „NewCertificate-FriendlyName“

Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)


After rebooting a sharepoint server 2016 the sharepoint websites breaks with this error message.

In the event viewer i found this:

i am testing my guess by changing the web.Config (not supported bei MS deswegen nur testen und dann wieder zurücksetzen)

</providers>
</siteMap>
<trust level=“Full“ originUrl=““ legacyCasModel=“true“ />
<webParts>
<transformers>

 

Change it to

</providers>
</siteMap>
<trust level=“Full“ originUrl=““ legacyCasModel=“false“ />
<webParts>
<transformers>

If this works then you can add an key to the regedit

LoadOptimization DWORD Value 1  und dann noch ein IISRESET

 

How to delete all mysites on a webapplication


$wa = Get-SPWebApplication -Identity https://mysites.zed2016.de/
$counter = $wa.Sites.Count
$nodeletes = 0
$deletes = 0
Write-Host -ForegroundColor Green „Number of Sitecollections in Webapplication: “ + $counter
for($i= $counter-1; $i -gt 0 ; $i–){
$site = $wa.Sites[$i]
Write-Host -BackgroundColor Yellow „Sitecollection Url: “ + $site.Url
if( ($site.RootWeb.WebTemplate -eq ‚SPSPERS‘) -and ($site.isSiteMaster -ne $true)){
Write-Host -BackgroundColor Green -NoNewline „Is a OneDrive and will be deleted“
$site.Delete()
$deletes++
}
else {
Write-Host -BackgroundColor Yellow -NoNewline „No OneDrive detected“
$nodeletes++
}
}
Write-Host „Number of deleted Sites: “ + $deletes
Write-Host „Number of none deleted Sites: “ + $nodeletes
Write-Host „Done!“