Change Authentication Provider from NTLM to Kerberos of SharePoint Web Application by Powershell of exisiting web applicaiton:
Get-SPWebApplication "http://webapplication" | Set-SPWebApplication –Zone "default" -AuthenticationMethod "Kerberos"
// This will give you all subscription ID
$sub = get-spsitesubscription
//Dont use this command:
remove-spsitesubscription -identity "$sub"
//Delete all the site collection manually from centraladmin or use powershell command related to subscription ID
Try the folowing ps script to create new Tenant and can use original ( previous) OU:
Add-PSSnapin Microsoft.SharePoint.Powershell -EA 0
//Note down your scubscription ID which you want to use and we will use later in the script.
Add-PSSnapin Microsoft.SharePoint.Powershell -EA 0
# farm details - update to reflect environment
$customerName = "<OU Name>"
$customerTenantAdmin = "<OU Admin with domain>"
$ouName= "<OU Name>"
$fullOUPath = 'OU=<OU PATH>,OU=<OU PATH>,DC=<Domain Name>,DC=<Domain Name>'
$fullTenantURL = "http://<testsiteurl>"
$customerFeatures = $customfeature
$hostingMainURL = "http://<HostingWebApplicationURL>"
$upaProxyName = "<User Profile Proxy> Farm Tenant User Profile Service Proxy"
$mmsProxyName = "<User MetaData Proxy> Farm Tenant Managed Metadata Service Proxy"
# feature packs - update after creating them
$foundationFeatures = "479a3211-b2c8-4efd-b09e-a11194c8ef79"
$standardFeatures = "400e72d3-7a97-4e28-8a9a-ac0f6ffba4e6"
$enterpriseFeatures = "0da79437-5735-4550-b4b1-2f9608ecb328"
$customfeature="0da79437-5735-4550-b4b1-2f9608ecb328"
$a = Read-Host "Have you added the user running this script to *permissions* on the UPA?"
$webApp = Get-SPWebApplication $hostingMainURL
# create new Site Subscription
Write-Host "Creating Site Subcription..."
//$sub = New-SPSiteSubscription
$sub = "<use the existing old Subscription ID here>"
# assign feature pack and configure the OU to use in the People Picker for the Subscription
Write-Host "Assiging Feature Pack and configuring People Picker..."
Set-SPSiteSubscriptionConfig –id $sub -FeaturePack $enterpriseFeatures -UserAccountDirectoryPath $fullOUPath
function ProvisionTenant($enterpriseFeatures,$customerName, $customerTenantAdmin, $customerFeatures, $hostingMainURL, $upaProxyName, $mmsProxyName, $foundationFeatures, $ouName, $fullTenantURL, $fullOUPath, $webApp, $sub)
{
Write-Host "Provisioning Tenant..."
Write-Host "Name: $customerName"
Write-Host "Admin: $customerTenantAdmin"
$a = Read-Host "Are Details ok ?"
# grab the web app
# create the "main" member site (we need a site at the root to use Host Headers and Managed Paths in the following cmdlets)
Write-Host "Creating Root Site..."
New-SPSite -url "$fullTenantURL" -SiteSubscription $sub -HostHeaderWebApplication $webApp -owneralias $customerTenantAdmin -template BLANKINTERNETCONTAINER#0
# create Tenant Admin site
Write-Host "Creating Tenant Admin site..."
New-SPSite -url "$fullTenantURL/admin" -SiteSubscription $sub -HostHeaderWebApplication $webApp -owneralias $customerTenantAdmin -template tenantadmin#0 -AdministrationSiteType TenantAdministration
# everything else needs standard
if (!($customerFeatures -eq $foundationFeatures))
{
Write-Host "Tenant has SharePoint Server features"
# create a mysite host
Write-Host "Creating My Site Host..."
New-SPSite -url "$fullTenantURL/mysites" -SiteSubscription $sub -HostHeaderWebApplication $webApp -owneralias $customerTenantAdmin -template SPSMSITEHOST#0
# configure the MySites host, MySites path, Naming Resolution and Profile Sync OU for the Subscription
Write-Host "Configuring Tenant Profile Config..."
$upaProxy = Get-SPServiceApplicationProxy | where-object {$_.DisplayName -eq $upaProxyName}
$upaProxy
SET-SPSiteSubscriptionProfileConfig -id $sub -SynchronizationOU $ouName -MySiteHostLocation "$fullTenantURL/mysites" -MySiteManagedPath "/mysites/personal" -SiteNamingConflictResolution "None" -ProfileServiceApplicationProxy $upaProxy
# create a site for the Content Type Gallery
Write-Host "Creating Content Type Gallery..."
New-SPSite -url "$fullTenantURL/cthub" -SiteSubscription $sub -HostHeaderWebApplication $webApp -owneralias $customerTenantAdmin -template sts#0
# configure the Content Type Gallery for the Subscription
Write-Host "Configuring Tenant Content Type Gallery..."
$mmsProxy = Get-SPServiceApplicationProxy | where-object {$_.DisplayName -eq $mmsProxyName}
$mmsProxy
# ContentTypeHub feature activation may fail - if so activate manually
Set-SPSiteSubscriptionMetadataConfig -identity $sub -serviceProxy $mmsProxy -huburi "$fullTenantURL/cthub" -SyndicationErrorReportEnabled
Write-Host "Activating Content Type Hub..."
Enable-SPFeature -Identity ContentTypeHub -url "$fullTenantURL/cthub"
}
#Set-SPSiteSubscriptionEdiscoveryHub - create an ediscovery hub, requires site - -SearchScope 1 - all of the sub
Write-Host "Tenant Provisioned!"
return $sub
}