Friday, July 21, 2017

New SP Trusted Identity Token Issuer

Add-PSSnapin "Microsoft.SharePoint.PowerShell"
#Realm we created in Azure
$realm = "http:///_trust" #your sharepoint application url
#Replace "" and "" with yours here!
$signinurl = ""

$certloc = "E:\SSO\certificate.cer"
# see the attached file srv186CA.cer
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2($certloc)
New-SPTrustedRootAuthority "DEV Trusted Authority" -Certificate $cert

$NameIdentifier = New-SPClaimTypeMapping -IncomingClaimType "" -IncomingClaimTypeDisplayName "UPN" -LocalClaimType ""
$GivenName = New-SPClaimTypeMapping -IncomingClaimType "" -IncomingClaimTypeDisplayName "Display Name" –LocalClaimType ""
$Email = New-SPClaimTypeMapping -IncomingClaimType "" -IncomingClaimTypeDisplayName "Email" -SameAsIncoming

New-SPTrustedIdentityTokenIssuer -Name "SSO DEV" -Description "TOKEN ISSUER NAME" -realm $realm -ImportTrustCertificate $cert -ClaimsMappings $NameIdentifier,$GivenName,$Email -SignInUrl $signInURL -IdentifierClaim $NameIdentifier.InputClaimType

Thursday, July 20, 2017

Permanently Delete a SharePoint Site Collection.

#To begin, you will need to load the SharePoint Online module to be able to run commands in PowerShell. use your SharePoint administrative site.
Import-Module Microsoft.Online.Sharepoint.PowerShell
$credential = Get-credential
Connect-SPOService -url "" -Credential $credential

Remove-SPOSite -Identity -NoWait

#This command will pause the script for 20 seconds before proceeding.
Start-Sleep -s 20

#This script will permanently delete the SharePoint site collection after it is sent to the SharePoint Site Recycle Bin. You must replace the url  with your Sharepoint Online URL and use your Site Collection Name that is to be permanently deleted for this script to work properly.
Remove-SPODeletedSite -Identity ""
Delete Last x days Sharepoint List item 

Add-PSSnapin Microsoft.SharePoint.PowerShell

$web = Get-SPWeb ""
$list = $web.Lists["EmailNotification"]
$DeleteBeforeDate = [Microsoft.SharePoint.Utilities.SPUtility]::CreateISO8601DateTimeFromSystemDateTime([DateTime]::Now.AddDays(-7))
$caml=' {0} 1 ' -f $DeleteBeforeDate
$query=new-object Microsoft.SharePoint.SPQuery
$col | % {
Write-Host "Deleted ID " $_.Id
Write-Host " Total Item  Deleted" +$col.Count


Wednesday, July 19, 2017

Create Self sign Certificate Powershell Command

New-SelfSignedCertificate -DnsName "" -CertStoreLocation cert:\LocalMachine\My
ShareClear RecycleBin Using Powershell

Add-PSSnapIn Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue;
$sitecollectionUrl = ""
$siteCollection = New-Object Microsoft.SharePoint.SPSite($sitecollectionUrl)
write-host("Items to be deleted : " +$siteCollection.RecycleBin.Count.toString())
$now = Get-Date
write-host("Deleting started at " +$now.toString())
$now = Get-Date
write-host("Deleting completed at " +$now.toString())

BCS RevertToSelf Powershell

$bdc = Get-SPServiceApplication | where {$_ -match “Business Data Connectivity Service”};
$bdc.RevertToSelfAllowed = $true;

Tuesday, June 30, 2015

Toptal Interest

I have 6 years of experience in SharePoint Technology. I heard about Toptal from my friends.  he said that there are so many opportunity to earn money from home. I am Microsoft certified solution expert in sharepoint technology. I have 6+ years of experience in sharepoint technology(2007,2010,2013,O365). I have knowledge of Sharepoint OOB features, Customization , Branding ,Development, Administration etc. having knowledge about develop custom webparts, workflow, timerjob with VS 2013.

Anyway, I’ve just began the interview process at (to become a part of the Toptal SharePoint developers network , and I really like to get in and become one of the freelancers who work there. If you’re a software engineer looking for work, I recommend that you do the same.

To answer the question we posed at the beginning of this article as a Toptal member, the winner in the choice of permanent employee or contractor is me! this writing skill test was amazing.