Wednesday, August 29, 2018

Get-SPWeb can't find the site you were looking for

Error:
PS C:\Windows\system32> Get-SPWeb -Identity "https://mysite.com/docs/"
Get-SPWeb : Cannot find an SPSite object that contains the following Id or Url: https://mysite.com/docs/.

Fix:
In the Front-End machine(s) restart the application pool "SecurityTokenServiceApplicationPool".

Sign In As Different User Option In SharePoint 2016

On the front-end server(s) open file "Welcome.ascx", located at "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\TEMPLATE\CONTROLTEMPLATES".

Find the block with the content:
<SharePoint:MenuItemTemplate runat="server" id="ID_PersonalInformation"
Text="<%$Resources:wss,personalactions_personalinformation%>"
Description="<%$Resources:wss,personalactions_personalinformationdescription%>"
MenuGroupId="100"
Sequence="100"
ImageUrl="/_layouts/15/images/menuprofile.gif?rev=40"
UseShortId="true"
/> 

and add this on the next row:
<SharePoint:MenuItemTemplate runat="server" ID="ID_LoginAsDifferentUser" 
Text="<%$Resources:wss,personalactions_loginasdifferentuser%>" 
Description="<%$Resources:wss,personalactions_loginasdifferentuserdescription%>" 
MenuGroupId="100" 
Sequence="100" 
UseShortId="true" />

NB! The change must be made on every front-end server and always back-up!

Thursday, October 20, 2016

SharePoint 2016 ports list


ProtocolPort Usage Comment
TCP 80 http Client to SharePoint web server traffic
(SharePoint – Office Web Apps communication)
TCP 443 https/ssl Encrypted client to SharePoint web server traffic
(Encrypted SharePoint – Office Web Apps communication)
TCP 1433 SQL Server default communication port. May be configured to use custom port for increased security
UDP 1434 SQL Server default port used to establish connection May be configured to use custom port for increased security
TCP 445 SQL Server using named pipes When SQL Server is configured to listen for incoming client connections by using named pipes over a NetBIOS session, SQL Server communicates over TCP port 445
TCP 25 SMTP for e-mail integration Cannot be configured
TCP 16500-16519 Ports used by the search index component Intra-farm only
Inbound rule Added to Windows firewall by SharePoint
TCP 22233-22236 Ports required for the AppFabric Caching Service Distributed Cache…
TCP 808 Windows Communication Foundation communication WCF
TCP 32843 Communication between Web servers and service applications http (default) To use custom port, see references section
Inbound rule Added to Windows firewall by SharePoint
TCP 32844 Communication between Web servers and service applications https
Inbound rule Added to Windows firewall by SharePoint
TCP 32845 net.tcp binding: TCP 32845 (only if a third party has implemented this option for a service application)  Custom Service Applications
Inbound rule Added to Windows firewall by SharePoint
TCP 32846 Microsoft SharePoint Foundation User Code Service (for sandbox solutions)  Inbound on all Web Servers
Inbound rule Added to Windows firewall by SharePoint
Outbound on all Web and App servers with service enabled.
TCP 5725 User Profile Synchronization Service(FIM) Synchronizing profiles between SharePoint 2013 and Active Directory Domain Services (AD DS) on the server that runs the Forefront Identity Management agent
TCP + UDP 389 User Profile Synchronization Service(FIM) LDAP Service
TCP + UDP 88 User Profile Synchronization Service(FIM) Kerberos
TCP + UDP 53 User Profile Synchronization Service(FIM) DNS
UDP 464 User Profile Service(FIM) Kerberos change password
TCP 809 Office Web Apps Intra-farm Office Web Apps communication.


References:
https://blog.blksthl.com/2013/02/21/tcpip-ports-of-sharepoint-2013/
(Stole it from here)

Configure diagnostic logging in SharePoint 2016

Configure diagnostic logging location in SharePoint 2016 with PowerShell.

Example:
Change the location for Diagnostics log(ULS):
set-SPDiagnosticConfig -LogLocation “D:\Logs\ULS”

Disk space:
Set-SPDiagnosticConfig -LogDiskSpaceUsageGB 500

Change the location for Usage and Health log:
set-SPUsageService -UsageLogLocation “D:\Logs\Health”

Get current log levels:
Get-SPLogLevel

Set category to default:
Clear-SPLogLevel

References:
https://technet.microsoft.com/en-us/library/ee748656(v=office.16).aspx

ULS Viewer best tool for viewing SharePoint errors

ULS Viewer

ULS Viewer is a Windows application that provides a simplified view of ULS log files in SharePoint 2013 that supports aggregation, filtering, sorting, highlighting, append, and more. 

Dowload:
https://www.microsoft.com/en-us/download/details.aspx?id=44020

Deafult log location:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\LOGS\

Visual:

Wednesday, October 19, 2016

Scan open ports using CMD.exe

Open cmd.exe and run "netstat -an".

Parameters:
  • -a   : Displays all active TCP connections and the TCP and UDP ports on which the computer is listening.
  • -e   : Displays Ethernet statistics, such as the number of bytes and packets sent and received. This parameter can be combined with -s.
  • -n   : Displays active TCP connections, however, addresses and port numbers are expressed numerically and no attempt is made to determine names.
  • -o   : Displays active TCP connections and includes the process ID (PID) for each connection. You can find the application based on the PID on the Processes tab in Windows Task Manager. This parameter can be combined with -a, -n, and -p.
  • -p   Protocol   : Shows connections for the protocol specified by Protocol. In this case, the Protocol can be tcp, udp, tcpv6, or udpv6. If this parameter is used with -s to display statistics by protocol, Protocol can be tcp, udp, icmp, ip, tcpv6, udpv6, icmpv6, or ipv6.
  • -s   : Displays statistics by protocol. By default, statistics are shown for the TCP, UDP, ICMP, and IP protocols. If the IPv6 protocol for Windows XP is installed, statistics are shown for the TCP over IPv6, UDP over IPv6, ICMPv6, and IPv6 protocols. The -p parameter can be used to specify a set of protocols.
  • -r   : Displays the contents of the IP routing table. This is equivalent to the route print command.
  • Interval   : Redisplays the selected information every Interval seconds. Press CTRL+C to stop the redisplay. If this parameter is omitted, netstat prints the selected information only once.
  • /?   : Displays help at the command prompt.

Is the port status "LISTENING" indicated that the port is opened?
Yes. It means that some service is listening to that port on your computer for incoming connection i.e. this port is open for establishing new connections.

References:
https://technet.microsoft.com/en-us/library/bb490947.aspx

SharePoint AppFabric Error Failed to connect to hosts in the cluster

Error:
ErrorCode<ERRCAdmin040>:SubStatus<ES0001>:Failed to connect to hosts in the cluster

OR

cacheHostInfo is null

OR

A failure occurred in SPDistributedCacheServiceInstance::Provision. cacheHostInfo is null for host 'SPSERVER'.

Fix:
Check if your "Distributed Cache" servers can connect to each other trough ports „22236“, „22234“, „22235“ and „22233“.

References: