Connect-SPOService –Url https://bajajelect-admin.sharepoint.com –Credential "Admin@xyz.onmicrosoft.com"
Import-Module Microsoft.Online.Sharepoint.PowerShell
$webUrl = ''
$username = "Admin@xyz.onmicrosoft.com"
$password = Read-Host -Prompt "Password for $username" -AsSecureString
[Microsoft.SharePoint.Client.ClientContext]$clientContext = New-Object Microsoft.SharePoint.Client.ClientContext($webUrl)
$clientContext.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)
# To apply the script to the site collection level, uncomment the next two lines.
$site = $clientContext.Site;
$featureguid = new-object System.Guid "E3540C7D-6BEA-403C-A224-1A12EAFEE4C4"
$site.Features.Add($featureguid, $true, [Microsoft.SharePoint.Client.FeatureDefinitionScope]::None);
$clientContext.ExecuteQuery();
Import-Module Microsoft.Online.Sharepoint.PowerShell
$webUrl = '
$username = "Admin@xyz.onmicrosoft.com"
$password = Read-Host -Prompt "Password for $username" -AsSecureString
[Microsoft.SharePoint.Client.ClientContext]$clientContext = New-Object Microsoft.SharePoint.Client.ClientContext($webUrl)
$clientContext.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)
# To apply the script to the site collection level, uncomment the next two lines.
$site = $clientContext.Site;
$featureguid = new-object System.Guid "E3540C7D-6BEA-403C-A224-1A12EAFEE4C4"
$site.Features.Add($featureguid, $true, [Microsoft.SharePoint.Client.FeatureDefinitionScope]::None);
$clientContext.ExecuteQuery();
Comments