Skip to main content

Tech Blog

Go Search
Tech Blog
News
  

Disable the Loopback Check via PowerShell

You will get a 401.1 error when trying to access the fully qualified domain name (FQDN) of your SharePoint site from the server. This is due to the loopback security check found in Windows Server 2003 SP1 or later, as well as Windows Server 2008 and Windows Server 2008 R2. To fix this you need to add a registry key to disable the loopback check. You could do this via the Registry Editor, but where is the fun in that?! Pop open a PowerShell console and enter the following:

New-ItemProperty HKLM:\System\CurrentControlSet\Control\Lsa -Name “DisableLoopbackCheck”  -Value “1″ -PropertyType dword

Make sure to reboot your server afterwards. Then, try your SharePoint site again and you should be good to go!

How to see if the crawl is still running or stuck using Perfmon?

The perfmon counters can offer useful information about the current state of search.  Add the perfmon objects for “Office Server Search Archival Plugin”, “Office Server Search Gatherer”, and “Office Server Search Gatherer Projects” (or for WSS, replace “Office Server Search” with “SharePoint Search”).  I always just take all the instances and all the counters for these.

The counters in “Search Archival Plugin” come from the Archival Plug-in (ARPI) and are useful in seeing the general crawl progress.  If the crawl is progressing then the counters for “Total Docs in XXX Queue” will increase, stop while the properties are being flushed, and then start again from zero.  One of our bigger bottlenecks is the time to flush the properties in the Archival Plug-in (ARPI).

The main counters to look at in “Search Gatherer” are “Threads Accessing Network” (in the protocol handlers) and “Thread in Plugins”.  These tell you where in the pipeline the active transactions are and where the possible problems are if the transactions are all stuck in one place.  If all of the threads are in plug-in or on network, there could be a problem there.  These should be moving and fluctuating when crawl is running.

Propagation is failing not getting Search results on the website

ERROR MESSAGE:

1.  Search services Offline

2.    Event ID: 6482 “Reason: The underlying connection was closed: An unexpected error occurred on a send”

3.    Event ID: 6482 “Unable to connect to remote computer”.

RESOLUTION:

1.    On the search administration page getting Server Status as error for Index & Query server.

2.    When click on the Search settings page getting search services offline error.

3.    Followed the below action plan:

• Stsadm –o osearch –action stop -role Index.

• Stsadm –o osearch –action stop –role Query.

• Delete the GUID folder from the Index location on Index & query server.

• This will start the Index service

stsadm -osearch -action start -role Index -farmcontactemail  -farmserviceaccount -farmservicepassword -defaultindexlocation.

• This will start the Query service.
stsadm -o osearch -action start -role Query -defaultindexlocation DRIVE:\PathToIndex

• This will configure the share.
stsadm -o osearch -propagationlocation DRIVE:\PathToIndex

• To be sure the service is properly provisioned, run the following:
stsadm -o provisionservice -action start -servicetype "Microsoft.Office.Server.Search.Administration.SearchService, Microsoft.Office.Server.Search, Version=12.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c" -servicename osearch

• stsadm -o execadmsvcjobs

4.    We were able to see the Index server on the search administration but the Query server was showing as error.

5.    There was no search services offline error when we go to Search settings page.

6.    On Query server found that the 6482 event id occurred every minute “Reason: The underlying connection was closed: An unexpected error occurred on a send”

7.    Followed the http://support.microsoft.com/default.aspx?scid=kb;EN-US;962928 and ran the below command:

selfssl /s:951338967 /v:1000

8.    The server status error was disappeared and we were able to see the Query server name.

9.    In the propagation status it was showing “waiting for initialization”.

10. Found the event id 6482 with different description “Unable to connect to remote computer”

11. Browsed to the below url made sure that the port is opened from Index to query:

 https://queryservername:56738/SharedServices1(whatever_ssp_name_is)/Search/Searchadmin.asmx 

12. But when we accessed the same site from the Query server using the below URL got 404 page cannot be displayed:

https://Indexservername:56738/SharedServices1(whatever_ssp_name_is)/Search/Searchadmin.asmx

13. Checked the IIS of Index server found that the port was 443 for “office server web services”.

14. Changed the port to 56738.

15. Found that the event id was disappeared and got one more Event Id:6482 “Object Id not found”.

16. Still we were getting the propagation status was “Waiting for initialization”.

17. Checked the both the servers add/remove programs and found that the Query box had .NET 3.5 SP1 but TCCINDEX does not.

18. Installed the http://support.microsoft.com/kb/959209 updates on the Query server.

19. Restarted the server and started the Osearch through command line.

20. Browsed to search administration It opened without any error message.

21. Started the crawl on the content source and waited some time.

22. The status of propagation was showing propagating.

23. The Crawl successfully completed with 10000 Items and we were able to get the search results on the website.

Ports and Protocols Used by Microsoft SQL Server 2008
Service / Purpose Protocol Port
Analysis Services connections via HTTP (default) TCP 80
Analysis Services connections via HTTPS (default) TCP 443
Clustering UDP 135
Clustering TCP 135 (RPC) / 3343 (Cluster Network Driver) / 445 SMB / 139 NetBIOS / 5000-5099 (RPC) / 8011-8031 (RPC)
Database Mirroring TCP There is no default port for this service. Use the following T-SQL statements to identify which ports are in use: SELECT name, port FROM sys.tcp_endpoints.
Dedicated Administrator Connection TCP 1434 by default (local port). But this port is assigned dynamically by SQL Server during startup.
Filestream TCP 139 y 445.
Microsoft Distributed Transaction Coordinator (MS DTC) TCP 135
Reporting services Web Services TCP 80
Reporting Services configured for use through HTTPS TCP 1433
Service Broker TCP 4022
SQL Server 2008 Analysis Services TCP 2383
SQL Server Browser Service (Database Engine) UDP 1434. Might be required when using named instances.
SQL Server Browser Service TCP 2382
SQL Server default instance running over an HTTPS endpoint. TCP 443
SQL Server Instance (Database Engine) running over an HTTP endpoint. TCP 80 y 443 (SSL).
SQL Server Integration Services TCP 135 (DCOM).
SQL over TCP (default instance) TCP 1433
Transact-SQL Debugger TCP 135
Windows Management Instrumentation TCP 135 (DCOM)



References.


Configuring the Windows Firewall to Allow SQL Server Access.
http://msdn.microsoft.com/en-us/library/cc646023.aspx

Enable a network for cluster use.
http://technet.microsoft.com/en-us/library/cc728293(WS.10).aspx

How To Schedule a Windows Powershell Script

Basically all you need to do is create a batch file that calls your Powershell script and schedule the batch file.  Your batch file should contain something similar to the following:

powershell -command "& 'MyScript.ps1' "

SharePoint Warm Up Script
############################################################################
#Assumptions:
#-Running on machine with WSS/MOSS
#-C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN in path
############################################################################
function get-webpage([string]$url,[System.Net.NetworkCredential]$cred=$null)
{
    $wc = new-object net.webclient
    if($cred -eq $null)
    {
        $cred = [System.Net.CredentialCache]::DefaultCredentials;
    }
    $wc.credentials = $cred;
    return $wc.DownloadString($url);
}
#This passes in the default credentials needed. If you need specific stuff you can use something else to
#elevate basically the permissions. Or run this task as a user that has a Policy above all the Web Applications
#with the correct permissions
$cred = [System.Net.CredentialCache]::DefaultCredentials;
#$cred = new-object System.Net.NetworkCredential("username","password","machinename")
[xml]$x=stsadm -o enumzoneurls
foreach ($zone in $x.ZoneUrls.Collection) {
    [xml]$sites=stsadm -o enumsites -url $zone.Default;
    foreach ($site in $sites.Sites.Site) {
        write-host $site.Url;
        $html=get-webpage -url $site.Url -cred $cred;
    }
}
Windows 7 Boot From VHD
SponsorOne of a new features in Windows 7 and Windows Server 2008 R2 is the ability to boot from a VHD.  It is pretty simple to enable this feature and have it ready at your disposal!  Before you begin you should note the following…
You can only boot a Windows 7 or Windows Server 2008 R2 VHD
You must configure the boot editor from a Windows 7 or Server 2008 R2 install
You cannot use a Virtual PC VHD, I suggest a Hyper-V VHD
You need to start with a clean slate, don’t try and reuse an old VHD
I am sure this will change as Windows 7 goes through the beta and RC stages on its way to RTM and we’ll update this as necessary but here goes…
Start by launching a Command Prompt and be sure to run as Administrator, once that is done run the following commands…
bcdedit /copy {current} /d “Boot_From_VHD”
Copy the CSLID that is displayed and then run…
bcdedit /set {CLSID} device vhd=[C:]\vhdname.vhd
bcdedit /set {CLSID} osdevice vhd=[C:]\vhdname.vhd
bcdedit /set {CLSID} detecthal on
You can replace [C:]\vhdname.vhd with the path and name of your VHD.
Once that is complete reboot and you will have the option to “Boot_From_VHD”!  You can verify the bootloader is configured correctly with the bcdedit command which will list all the boot options.  If you want to delete the entry make note of the GUID listed in bcdedit and use the following command…
bcdedit /delete {GUID} /cleanup
 
bcdedit /copy {current} /d “Boot_From_VHD”
bcdedit /set {953a8de7-e65d-11de-b2ce-b6e8d9f78e45} device vhd=[C:]\virtual\windows7-x64.vhd
bcdedit /set {953a8de7-e65d-11de-b2ce-b6e8d9f78e45} osdevice vhd=[C:]\virtual\windows7-x64.vhd
bcdedit /set {953a8de7-e65d-11de-b2ce-b6e8d9f78e45} detecthal on
 
Move MOSS Web To WSS
$siteurl = "http://blah"
$site = new-object Microsoft.SharePoint.SPSite $siteurl
$web = $site.OpenWeb()
stsadm -o deactivatefeature -url $siteurl -name OffWFCommon
stsadm -o deactivatefeature -url $siteurl -name TranslationWorkflow
$site.features|%{$_.Definition}|?{$_.ReceiverAssembly -like "*Office*"}|select DisplayName
$site.features|%{$_.Definition}|?{$_.ReceiverAssembly -like "*Office*"}|%{stsadm -o deactivatefeature -url $site.url -name $_.DisplayName}
stsadm -o deactivatefeature -url $siteurl -name TransMgmtLib
$web.features|%{$_.Definition}|select displayname,status
WebDAV Redirector Registry Settings

HKLM\SYSTEM\CurrentControlSet\Services\WebClient\Parameters

I found a variety of sources that documented one setting or another but I couldn't find a concise list, so I've collected the following list that contains what I've been able to discover so far:

Value & Description Type Values Default
AcceptOfficeAndTahoeServers

Specifies whether the WebClient service can connect to web sites that are running SharePoint or Office Web Server.

DWORD
0 = False
1 = True
1
BasicAuthLevel

Specifies whether the WebClient service can use basic authentication to talk to a server.

Note: Using basic authentication can cause serious security issues as the username/password are transmitted in clear text, therefore the use of basic authentication over WebDAV is disabled by default unless the connection is using SSL. That being said, this registry key can override the default basic authentication behavior, but it is still strongly discouraged.

DWORD
0 = Basic authentication is disabled
1 = Basic authentication is enabled for SSL web sites only
2 = Basic authentication is enabled for SSL and non-SSL web sites
1
FileAttributesLimitInBytes

Specifies  the maximum size that is allowed by the WebClient service for all properties on a specific collection.

DWORD Size of attributes in bytes 1,000,000 decimal
(1 MB)
FileSizeLimitInBytes

Specifies the maximum size in bytes that the WebClient service allows for file transfers.

DWORD File size in bytes 50,000,000 decimal
(50 MB)
InternetServerTimeoutInSec

Specifies the connection timeout for the WebClient service uses when communicating with non-local WebDAV servers.

DWORD Time in seconds 30 decimal
LocalServerTimeoutInSec

Specifies the connection timeout for the WebClient service uses when communicating with a local WebDAV server.

DWORD Time in seconds 15 decimal
SendReceiveTimeoutInSec

Specifies the timeout in seconds that WebDAV the WebClient service uses after issuing a request, such as “GET /file.ext” or “PUT  /file.ext”.

DWORD Time in seconds 60 decimal
ServerNotFoundCacheLifeTimeInSec

Specifies the period of time that a server is cached as non-WebDAV by the WebClient service.

Note: The WebClient service maintains a list of non-WebDAV servers that have been contacted. If the server is found in this list, a fail is returned immediately without attempting to contact the server.

DWORD Time in seconds 60 decimal
SupportLocking

Specifies whether the WebClient service supports locking.

DWORD
0 = False
1 = True
1

Note: After changing any of these settings you will need to restart the WebClient service.

Forms Authentication Cookie Expiration

When using an ASP.NET Membership provider to authenticate users to SharePoint, the default expiration of the 'Remember Me' cookie is 30 minutes. Adjusting the cookie expiration is an easy task, just add the 'timeout' property to the 'forms' element in the web.config for the site. This value is measured in minutes, so the value below expires the cookie after 30 days.

<authentication mode="Forms">
     <forms loginUrl="/_layouts/login.aspx" timeout="43200" />
</authentication>

1 - 10 Next

 ‭(Hidden)‬ Admin Links