Repair certificate Store to recover private key

July 31, 2024

Windows Certutil utility can be used to retrieve private keys which have been deleted from the certificate store

certutil -repairstore my <serial number>

Serial number is available in details tab of the certificate.


SharePoint Server 2019 Http error 500

July 31, 2024

Symptom:

When application is opened from Front-end server it returns “Http error 500” wherease the same application works from the application server.

Cause:

The SPRequestFilterModule is not correctly registred in IIS on front end server.

   <add name="SPRequestFilterModule" image="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\isapi\sprequestfilteringmodule.dll" preCondition="integratedMode,bitness64" />

To fix the issue ensure that the line above is listed in the globalModules section of the applicationHost.config.

This can be achieved either by manually editing the applicationHost.config or by running the following PowerShell script:

$assembly = [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
$amsiReceiver = $assembly.GetTypes() | ?{$_.Name -eq "AntimalwareScanFeatureReceiver"}
$amsiReceiver::EnsureGlobalConfiguration()
 
# Also run this line for 2019 and Subscription Edition
$amsiReceiver::ChangeGlobalConfiguration()

References:

https://techcommunity.microsoft.com/t5/sharepoint/sharepoint-server-2019-http-error-500/m-p/4104235


Old ssl cert still showing up in browser after installing new on IIS

April 30, 2024

netsh http show sslcert displays all certs

netsh http delete sslcert ipport={machine-ip}:443

where {machine-ip} should be replaced with the actual IP address

Reference: https://serverfault.com/questions/930464/old-ssl-cert-still-showing-up-in-browser-after-installing-new


Site slowness because of SharePoint STS certificate CRL checking

August 17, 2022

Export the SharePoint Root Authority certificate as a physical (.cer) file. Start the SharePoint 2010 Management Shell as an Administrator, and then run the following Windows PowerShell commands:

$rootCert = (Get-SPCertificateAuthority).RootCertificate   
$rootCert.Export("Cert") | Set-Content C:\SharePointRootAuthority.cer -Encoding byte
  1. Import the SharePoint Root Authority certificate to the Trusted Root Certification Authorities store. To add the SharePoint Root Authority certificate to the Trusted Root Certification Authorities store, follow these steps:Note “Administrators” is the minimum required group membership to complete these steps.
    1. Tap or click Start, type mmc in Start search, and then press Enter.
    2. On the File menu, click Add/Remove Snap-in.
    3. Under Available snap-ins, click Certificates, and then click Add.
    4. Under This snap-in will always manage certificates for, select Computer account, and then click Next.
    5. Select Local computer, and then click Finish.
    6. If you have no more snap-ins to add to the console, click OK.
    7. In the console tree, double-click Certificates.
    8. Right-click the Trusted Root Certification Authorities store.
    9. Click All Tasks, click Import to import the certificate, and then follow the steps in the Certificate Import Wizard.

Source: https://docs.microsoft.com/en-US/sharepoint/troubleshoot/sites/site-slowness-because-of-sts-certificate-crl-checking


How to Find the Wi-Fi Password for Network you have ever connected to

May 29, 2022

Follwoing procedure is for Windows 11

Right click on the Windows icon in the taskbar on destkop

Click Windows Terminal (Admin)

Type in netsh wlan show profile and hit enter

netsh wlan show profile "Wireless name from above" key=clear

Password can be found in “Key Content section”

Source: How to find Wi-Fi password of Any Network you have ever connected to.


encrypt decrypt sections in webconfig

May 29, 2022

To encrypt open command promt and navigate to C:\Windows\Microsoft.NET\Framework64\v4.0.30319

Run follwoing command to encrypt appSettings section

aspnet_regiis -pe "appSettings" -site "SharePoint - 80" -app "/" -prov "RsaProtectedConfigurationProvider"

Use follwoing command to decrypt appSettings section

aspnet_regiis -pd "appSettings" -site "SharePoint - 80" -app "/"

Similary other sections in the webconfig e.g. connectionStrings can also be encrypted

Source: Encrypting and Decrypting Configuration Sections


SQL delete bulk table rows with row count

April 11, 2022
set rowcount 5000
DELETE FROM [TableName] WHERE [timestamp] < '2022-01-01 00:00:00';
while @@ROWCOUNT > 0 
begin 
DELETE FROM [TableName] WHERE [timestamp]  < '2022-01-01 00:00:00';
end
set rowcount 0
go

Above statements will delete 5000 rows at a time from SQL table, this will prevent locking table during bulk delete.


Remote Desktop connection as admin

July 13, 2021

admin connection remotely

save .rdp file


run following from command prompt

mstsc .\name.rdp /admin


Add primary or secondary site collection admin using Micrsoft PowerShell

July 13, 2021

Open the SharePoint Management Shell

At the PowerShell command prompt, type the follwing command to replace the secondar site collection administrator

Set-SPSite -Identity "<SiteCollection>" -SecondaryOwnerAlias "<User>"

Where:

  • <SiteCollection> is the URL of the site collection to which you want to add site collection admin
  • <User> is name of the user whom you want to add in the format <domain>\<username>.

Reference:

https://docs.microsoft.com/en-us/sharepoint/sites/change-site-collection-administrators


Google reCaptcha verification websites

June 30, 2021

https://www.google.com/recaptcha/api/siteverify

OR

https://recaptcha.net/recaptcha/api/siteverify


Create your own website, free on WordPress.com.Create your own website.
Start free