kwizcom banner advertisement

Change SharePoint Site Collection Quota using PowerShell

5:19 AM    , , , , , , ,
In some cases, I have seen site collection quotas are turned to "Individual Quota" in database attachment method, even I copied the quota templates before database attachment. All quota settings are lost! I dunno the cause of this issue and want to apply site collection quota to existing sites. To apply quota for SharePoint site collection using PowerShell, the syntax goes like: Set-SPSite -Identity "Site-collection-URL" -QuotaTemplate "Quota-Template-Name" E.g. Set-SPSite -Identity "http://sharePoint.company.com/sites/sales" -QuotaTemplate "Gold - 1 GB" Where "Gold - 1 GB" is our existing quota defined! We can apply quotas in bulk with PowerShell now! Change quota for SharePoint Site Collections programmatically: To set site collection quota for SharePoint sites programmatically using PowerShell, The code goes like: [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") [Void]S
Change SharePoint Site Collection Quota using PowerShell Change SharePoint Site Collection Quota using PowerShell Reviewed by Salaudeen Rajack on 5:19 AM Rating: 5

Add Site Collection Administrators Programmatically/PowerShell in SharePoint

11:34 PM    , , , , , , , ,
SharePoint site collection administrators have Full rights to all sites within a site collection. Primary site collection administrator and Secondary site collection administrator specified in central administration will automatically become site collection admins. Its also possible to add multiple site collection admins for any SharePoint site collection. How to add site collection administrator in SharePoint? To add site collection administrator in SharePoint, you must be either Farm Administrator or another Site Collection Administrator of the site collection. Navigate to Site Settings >> Click on "Site collection administrators" link under "Users and Permissions" which will lead you to a page where you can manage site collection administrators. How to Add Site Collection Administrators Programmatically with C#? In some scenarios, we may have to add site collection administrators programmatically. Say for e.g. There may be a requirement to add a
Add Site Collection Administrators Programmatically/PowerShell in SharePoint Add Site Collection Administrators Programmatically/PowerShell in SharePoint Reviewed by Salaudeen Rajack on 11:34 PM Rating: 5

Enable Wildcard Search by Default in SharePoint 2010

8:33 PM    , ,
By default, Wildcard search is not enabled in SharePoint! Say for e.g. If you search for "Script" you will get results for the search query. But if you want to search using partial words ("sc" for "Script") that aren't complete, You will not get the search results until you add the wildcard character * in your queries ( sc* ) Here are the screens to explain the above scenario: Search results for the complete word: Script Search results for the partial word: Sc Yes, You can always add a wildcard character * in your queries: E.g. sc* to perform wildcard search in SharePoint 2010. But how to make it default without you/end-user entering the wildcard character every time? Sure, We can enable wildcard search in SharePoint by default! here is how: How to Enable Wildcard Search in SharePoint 2010 To enable Wildcard search in SharePoint Server 2010, Go to: Central Administration >> Application Management  Manage Service Applications >
Enable Wildcard Search by Default in SharePoint 2010 Enable Wildcard Search by Default in SharePoint 2010 Reviewed by Salaudeen Rajack on 8:33 PM Rating: 5

Fix Incoming Emails Not Working Issue in SharePoint Migration

7:25 PM    , , ,
Problem: After a Database attach method of SharePoint migration from SharePoint 2007 to SharePoint 2010, all incoming E-mail enabled libraries stopped working! They no longer receive E-mails!!  Here is the root cause and fix for SharePoint incoming email stopped working issue. Root Cause: This is because, SharePoint stores incoming E-mail configurations on its Farm Configuration Database (usually SharePoint_Config) and during database attachment method of migration, We didn't (and we can't) migrate the configuration database. So, incoming email settings on SharePoint 2010 not working. Solution: One quick solution is simply Flip the value of  "Allow this list to receive e-mail?" Just go to List Settings Under Communication, click on "Incoming e-mail settings" link Select "Allow this list to receive e-mail?" to "No" and click on "Save" Now, go back to the Incoming e-mail settings again and choose ""Allow this
Fix Incoming Emails Not Working Issue in SharePoint Migration Fix Incoming Emails Not Working Issue in SharePoint Migration Reviewed by Salaudeen Rajack on 7:25 PM Rating: 5

Update Web Part Properties using PowerShell in SharePoint

2:04 PM    , , ,
Ever wanted to update SharePoint web part properties programmatically? After a company acquisition, We had to change the company name from a custom web part's title, throughout the web application. SharePoint update web part properties using PowerShell:  $Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue #configuration parameters $WebURL="http://sharepoint.Crescent.com" #Get objects $web = Get-SPWeb $WebURL $page = $web.GetFile("SitePages/Home.aspx") $page.CheckOut() $WebPartManager = $web.GetLimitedWebPartManager($Page.ServerRelativeUrl,[System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared) #$WebPartManager.WebParts $WebPartManager.WebParts | % { write-host $_.title} #Get the Web part $Webpart = $WebPartManager.WebParts | Where { $_.Title -eq "Shared Documents"} #Update Webpart Property $Webpart.Title = "Team Documents" #Save and Publish $WebPartManager.SaveChanges($Webpart) $page.CheckIn("u
Update Web Part Properties using PowerShell in SharePoint Update Web Part Properties using PowerShell in SharePoint Reviewed by Salaudeen Rajack on 2:04 PM Rating: 5

Remove Site Collection Administrator in SharePoint using PowerShell

7:18 PM    , , , , ,
Site collection administrators are administrators of the site collection with full control to the entire site collection including top-level site and all of its subsites, lists and libraries in the site collection. How to Remove Site Collection Administrator in SharePoint? To remove SharePoint Site Collection Administrator, we use "Site collection Administrators" link from site settings. You must be a Farm Administrator or site collection administrator to see this link, BTW! From this page, we can delete site collection administrators. PowerShell to Remove Site Collection Administrator: We may have to remove site collection administrators programmatically. Lets use PowerShell in SharePoint to remove site collection administrator: Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue Function Remove-SiteCollAdmin($AdminID, $SiteCollectionURL) { #Get the site collection $site = Get-SPSite $SiteCollectionURL #Get the Admin to remove
Remove Site Collection Administrator in SharePoint using PowerShell Remove Site Collection Administrator in SharePoint using PowerShell Reviewed by Salaudeen Rajack on 7:18 PM Rating: 5

Create SharePoint Quota Templates using PowerShell

3:51 PM    , , , , , ,
SharePoint quota templates enables us to keep the site collections growth in control. It defines the maximum amount of data stored in a site collection and prevent from disk fillings! Quota template makes it easier to govern site collections growth by assigning a pre-defined sizing template to them, rather assigning individual quotas to each site collections in the farm. Quota templates set how much storage space a site collection can occupy. Quota templates offer two levels: Warning Level and Maximum Storage Level.Once the site collection reaches warning level, SharePoint triggers an Email to site collection administrators and further addition to site is possible until it reaches to Maximum storage level. How to Create a New Quota Template in SharePoint 2010? Creating new quota template in SharePoint 2010 is relatively simpler! Go to: Central Administration >> Application Management Click on "Specify quota templates" under "Site Collections" group On
Create SharePoint Quota Templates using PowerShell Create SharePoint Quota Templates using PowerShell Reviewed by Salaudeen Rajack on 3:51 PM Rating: 5

SharePoint 2010 Visual Upgrade - FAQs

6:55 PM    , , , , ,
What is Visual Upgrade in SharePoint 2010? Lets understand visual upgrade in SharePoint 2010. In short: It's a feature introduced in SharePoint 2010 to ease up transition from MOSS 2007 user interface to SharePoint 2010 UI. When sites migrated from MOSS 2007 using database attach method, They will be using the v3 interface by default and we got to update it. SharePoint 2010 Visual Upgrade to all Sites: To apply visual upgrade on a single site, Navigate to: Site Actions >>Site Settings  Click on "Title, Description, and Icon", Choose the Visual Upgrade option to : Update the user interface and click on OK.  Clicking on "Site Actions >> Visual Upgrade" also will lead to the same URL ( /_layouts/prjsetng.aspx ) To visual upgrade entire site collection (all sites): Navigate to Site Actions >> Site Settings  Click on "Visual Upgrade" link under Site collection Administration >> Click on "Upgrade All Sites"
SharePoint 2010 Visual Upgrade - FAQs SharePoint 2010 Visual Upgrade - FAQs Reviewed by Salaudeen Rajack on 6:55 PM Rating: 5

How to Recover Deleted SharePoint Central Admin Site from IIS?

7:54 PM    , , , , , ,
SharePoint Central Administration site got deleted from IIS accidentally! It may happen due to file system got corruption errors. No worries, We can Re-provision SharePoint Central admin site! Lets provision SharePoint central administration site using PowerShell. PowerShell Script to provision SharePoint Central Admin site: Open the "SharePoint 2010 Management Shell" and enter: New-SPCentralAdministration -Port 2010 -WindowsAuthProvider "NTLM" This will Re-provision Central Administration site. For SharePoint 2007, Use PSConfig to Re-Provision Central Administration site: In case of MOSS 2007, Use Psconfig.exe as: psconfig.exe -cmd adminvs -provision -port 2010 -windowsauthprovider OnlyUseNTLM All done, we are back to business.
How to Recover Deleted SharePoint Central Admin Site from IIS? How to Recover Deleted SharePoint Central Admin Site from IIS? Reviewed by Salaudeen Rajack on 7:54 PM Rating: 5

Configure Replicating Directory Changes in Windows Server 2008 / 2012

7:07 PM    , , , , , , ,
Replicating directory changes permission is a requirement to configure User Profile Service Application(UPS) in SharePoint 2010 and for SharePoint 2013. We've to grant replicate directory changes permission on a domain to our service account which crawls and syncs AD contracts to SharePoint. Here is the step by step instructions to provide "Replicating directory changes" permission to your managed account. Log in to your domain controller,  Open "Active Directory Users and Computers", right-click on your domain and select Delegate Control. Click on "Next" Click on "Add" to add the managed account Enter your Service Account and click on "OK" Click on "Next"    Select "Create a Custom Task to Delegate", Click Next Click "This folder, existing objects in this folder, and creation of new objects in this folder" and Click "Next" Select "General" and choose "Re
Configure Replicating Directory Changes in Windows Server 2008 / 2012 Configure Replicating Directory Changes in Windows Server 2008 / 2012 Reviewed by Salaudeen Rajack on 7:07 PM Rating: 5

Site Collection Administrators Report for All SharePoint 2007 Sites

5:37 PM    , , , , ,
I just had to generate a report to find SharePoint site collection administrators and see who are all assigned with Site collection administrator rights on various site collection in entire SharePoint Farm. Sure, Lets use PowerShell in SharePoint to get site collection administrator programmatically. This script iterates through all site collections in all web applications to list site collection administrators. PowerShell Script to Get All Site Collection Administrators I've made it compatible with SharePoint 2007 [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") #Get the Farm $farm = [Microsoft.SharePoint.Administration.SPFarm]::Local #Get All Web Applications $farmWebServices = $farm.Services | where -FilterScript {$_.GetType() -eq [Microsoft.SharePoint.Administration.SPWebService]} foreach ($farmWebService in $farmWebServices) { #Loop through Each web applicatoin foreach ($webApplication in $farmWebService.WebApplications) {
Site Collection Administrators Report for All SharePoint 2007 Sites Site Collection Administrators Report for All SharePoint 2007 Sites Reviewed by Salaudeen Rajack on 5:37 PM Rating: 5

Fix for SharePoint UserProfileApplicationNotAvailableException_Logging Exception

6:41 PM    , ,
I was trying to write a PowerShell script to retrieve user profile properties in SharePoint 2013, and ended up with the below error: "UserProfileApplicationNotAvailableException_Logging :: UserProfileApplicationProxy.ApplicationProperties ProfilePropertyCache does not have c4a5371c-01c2-4281-b91b-ca335982f994" Solution: After verifying user profile service application and SharePoint timer jobs are up and running, arrived to the right destination: User profile service application permissions! Grant "Full Control" permission to the account running the code on User profile Service application. Open SharePoint Central Administration site. Go to: Application Management >> Service Applications >> Manage service applications. Pick your user profile service application. Now, from the ribbon, click on Permissions button. Add your account to the permissions. (Make sure: Farm Admin account also added) Enable Full Control for your account and Click O
Fix for SharePoint UserProfileApplicationNotAvailableException_Logging Exception Fix for SharePoint UserProfileApplicationNotAvailableException_Logging Exception Reviewed by Salaudeen Rajack on 6:41 PM Rating: 5

SharePoint Site Collection Storage Size - Quota Usage Report using PowerShell

5:31 PM    , , ,
Requirement: Wanted to get a quick storage quota report on SharePoint sites on their allocation vs used space metrics to find out underutilized sites. Solution: PowerShell script to get SharePoint site quota report! If you want to get used storage space for a particular site collection, use: Get-SPSite http://site-collection=url | select @{label="Size in MB";Expression={$_.usage.storage/1MB}} To get storage data for all site collections, use: Get-SPSite | Select Url, @{Label="Size";Expression={$_.usage.Storage/1MB}} | Sort-Object -Descending -Property "Size" Get Site collection Storage assigned vs used for all site collections: Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue Get-SPSite | Select URL,` @{Name="Site Owner"; Expression={$_.Owner.Email}},` @{Name="Quota Assigned"; Expression={"{0:N2} MB" -f ($_.Quota.StorageMaximumLevel/1MB)} } ,` @{Name="Storage Use
SharePoint Site Collection Storage Size - Quota Usage Report using PowerShell SharePoint Site Collection Storage Size - Quota Usage Report using PowerShell Reviewed by Salaudeen Rajack on 5:31 PM Rating: 5

Run SharePoint 2010 Timer Jobs On-Demand with PowerShell

4:07 PM    , , , , , ,
We may have to run SharePoint timer jobs on-demand in some situations. Say for e.g. To update Rating values, I had to run the timer jobs: User Profile Service Application - Social Rating Synchronization Job and User Profile Service Application - Social Data Maintenance Job. Read more at SharePoint 2010 Rating Feature Configuration How to run timer job manually in SharePoint? So, To run a SharePoint 2010 timer Jobs on-demand, we used to navigate to Central Administration >> Monitoring >> Timer Jobs >> Review Job Definition >> Pick the timer jobs we want to run >> Click on "Run Now", BTW SharePoint 2007 doesn't offer way to run timer job manually! This will run timer job immediately in SharePoint 2010. SharePoint 2013 run timer job from PowerShell: We can run timer job from code. Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue #Display name of the Timer Job to Run on-demand $TimerJobName = "User Pro
Run SharePoint 2010 Timer Jobs On-Demand with PowerShell Run SharePoint 2010 Timer Jobs On-Demand with PowerShell Reviewed by Salaudeen Rajack on 4:07 PM Rating: 5

Enable-Activate a SharePoint Feature on All Site Collections using PowerShell

7:37 PM    , , , ,
Ever wanted to enable a feature on all site collections in a SharePoint environment? Well, To activate a site collection feature in SharePoint, navigate to Site settings >> Site Collection Features >> Click on "Activate" next to the relevant feature. How to Activate a Feature using PowerShell? To activate a SharePoint feature on a particular site, we use: Enable-SPFeature cmdlet. Enable-SPFeature –Identity "FeatureName" –url http://SharePoint-site-URL Recently I had to enable a Branding feature on all sites to apply new corporate branding with the following one liner: PowerShell script. #activate feature on all sites in all web applications in the farm Get-SPWebApplication | Get-SPSite -Limit ALL | ForEach-Object{ Enable-SPFeature -URL $_.url -Identity (Feature Name or URL) -Confirm:$FALSE } Here is the E.g. for above script: Get-SPWebApplication "http://www.sharepoint.crescent.com" | Get-SPSite -Limit All | Get-SPWeb -Limit ALL |
Enable-Activate a SharePoint Feature on All Site Collections using PowerShell Enable-Activate a SharePoint Feature on All Site Collections using PowerShell Reviewed by Salaudeen Rajack on 7:37 PM Rating: 5

How to Create/Delete SharePoint Groups Programmatically with PowerShell?

2:44 PM    , , , ,
Requirement: Create or Delete SharePoint User Groups using PowerShell These PowerShell code snippets helps to Create or Delete SharePoint Groups programmatically using PowerShell: Create SharePoint Group Programmatically with PowerShell: Use this function to create a SharePoint group using PowerShell . Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue Function Create-SPGroup($SiteURL, $GroupName, $GroupOwner,$GroupDescription) { <# .Description This PowerShell function Creates new SharePoint Group on the given site collection URL .Example Create-SPGroup "http://sharepoint.crescent.com/sites/operations" "Operation Managers" "Global\salaudeen" "Group for Operation Managers" This example Creates new SharePoint group "Operation Managers" at the given site collection .Link http://www.sharepointdiary.com http://twitter.com/SharePointdiary .Inputs $SiteURL - Site collection URL in which
How to Create/Delete SharePoint Groups Programmatically with PowerShell? How to Create/Delete SharePoint Groups Programmatically with PowerShell? Reviewed by Salaudeen Rajack on 2:44 PM Rating: 5

"Internet Explorer cannot display the webpage" on Accessing SharePoint Central Admin

7:22 PM    , , ,
Problem: SharePoint 2010 central administration site stopped working after a reboot and gave "Internet Explorer cannot display the webpage" on trying to access! Troubleshooting: SharePoint central admin page cannot displayed error could be caused since Central Administration service is in disabled state! Lets troubleshoot by checking Central Administration service status with PowerShell: $CA = Get-SPServiceInstance | Where-Object {$_.TypeName -eq `Central Administration'} write-host $CA.status Got "Disabled" as Central Administration Service Status! No issues, Lets start the service: Get-SPServiceInstance | Where-Object {$_.TypeName –eq ‘Central Administration’} | Start-SPServiceInstance -Confirm   Wait till it comes to "Online" Status. That's all! We've fixed SharePoint 2010 central administration page cannot be displayed issue.
"Internet Explorer cannot display the webpage" on Accessing SharePoint Central Admin "Internet Explorer cannot display the webpage" on Accessing SharePoint Central Admin Reviewed by Salaudeen Rajack on 7:22 PM Rating: 5

PowerShell Scripts to Manage Choice Field in SharePoint

6:08 PM    , , ,
PowerShell is a handy way to perform tedious and repetitive tasks in SharePoint. Say, we want to add or remove a choice value in a specific choice column for number of sites, get or update choice column values, etc. Here are some nifty PowerShell scripts to manage choice field in SharePoint. How to Add New Choice Field to SharePoint List using PowerShell Lets use PowerShell to create choice column: Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue #Define URL and List name variables $WebURL="http://sharepoint.crescent.com" $ListName ="Employee Profiles" #Get the Web and Lists objects $web = Get-SPWeb $WebURL $List = $web.Lists[$ListName] #Add New choice field to the list $list.Fields.Add("Department", [Microsoft.SharePoint.SPFieldType]::Choice, $false) #Add Choices to the field $ChoiceField = $list.Fields.GetField("Department") #Get the field $ChoiceField.Choices.Add("Sales") $ChoiceField.Choices.A
PowerShell Scripts to Manage Choice Field in SharePoint PowerShell Scripts to Manage Choice Field in SharePoint Reviewed by Salaudeen Rajack on 6:08 PM Rating: 5

Apply SharePoint Quota Template Changes to Existing Sites

2:37 PM    , , , , ,
Problem Scenario:  End-users actively started using their "My Sites" and most of their My sites reached the site collection storage quota limit of 100MB! Gradually started receiving many requests to increase storage limits. Initially, My site web application assigned with "Personal" quota template which offers 100MB of disk space. After a while, we decided to increase my site storage quota limit to 250MB. So, went to Central Administration >> Application Management >> Specify Quota Templates >> Selected "Personal" Quota template and set that storage limit to 250MB. That's enough! This should fix the problem, isn't it? Unfortunately NO ! Users still receiving "Your changes could not be saved because this SharePoint Web site has exceeded the storage quota limit." error while trying to upload a file or add new item to their SharePoint site. Went to Central Administration, Verified again that Site collections has en
Apply SharePoint Quota Template Changes to Existing Sites Apply SharePoint Quota Template Changes to Existing Sites Reviewed by Salaudeen Rajack on 2:37 PM Rating: 5
Powered by Blogger.