kwizcom banner advertisement

SharePoint Online: How to Delete a Folder using PowerShell?

September 28, 2016    , , , ,
Requirement: SharePoint Online PowerShell to Delete Folder How to delete a folder in SharePoint Online: Simply select the folder from list or library, and then you can delete a folder either from toolbar "delete" button or from the context menu's delete option. Confirm the delete prompt and you are done! SharePoint Online PowerShell to Delete Folder Here is the PowerShell to remove a folder from list or library in SharePoint Online. Import-Module Microsoft.Online.SharePoint.Powershell -DisableNameChecking #Variables for Processing $SiteUrl = "https://crescent.sharepoint.com/sites/Projects" $FolderURL="Shared Documents/Project 2020" Try { #Get Credentials to connect $Cred = Get-Credential $Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username, $Cred.Password) #Setup the context $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteUrl) $Ctx.Credentials = $Cre
SharePoint Online: How to Delete a Folder using PowerShell? SharePoint Online: How to Delete a Folder using PowerShell? Reviewed by Salaudeen Rajack on September 28, 2016 Rating: 5

SharePoint Online: Add Choice Column to List using PowerShell

September 26, 2016    , , , ,
How to Add Choice Field to SharePoint Online List? Browse to your SharePoint Online site and Navigate to the target list in which you want to add Choice column. Under the List tab, click on "Create Column" button in the ribbon. Provide the Name to your new column, specify the type as "Choice (menu to choose from)"  Scroll down and enter choices to the given list as one choice per line Fill other optional values such as Choice field type (Dropdown/Radio button/Checkbox) and Click on "OK" to create Choice field in SharePoint Online list. PowerShell to Create Choice Field in SharePoint Online List: Here is the PowerShell script to add choice column to SharePoint Online list. #Load SharePoint CSOM Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Mic
SharePoint Online: Add Choice Column to List using PowerShell SharePoint Online: Add Choice Column to List using PowerShell Reviewed by Salaudeen Rajack on September 26, 2016 Rating: 5

SharePoint Online: Create Single Line of Text Column in List using PowerShell

September 26, 2016    , , , ,
How to Add Single Line of Text Column to SharePoint Online List? Browse to your SharePoint Online site and Navigate to the target list in which you want to create a new Single Line of Text column. Under the List tab, click on "Create Column" button in the ribbon. Provide the Name to your new column, specify the type as "Single Line of Text"  Fill other optional values and Click on "OK" to create Single line of text column to SharePoint Online list. PowerShell to Add Single Line of Text Column to List in SharePoint Online Here is the PowerShell script to create single line of text column to any existing list or library in SharePoint online. #Load SharePoint CSOM Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll&q
SharePoint Online: Create Single Line of Text Column in List using PowerShell SharePoint Online: Create Single Line of Text Column in List using PowerShell Reviewed by Salaudeen Rajack on September 26, 2016 Rating: 5

Get User Department, Job Title from User Information List of SharePoint using PowerShell

September 25, 2016    , , ,
Requirement: From a business requirement, need to generate a report for department wise users of a Intranet portal site. Say, How many users from "Sales" department have access to SharePoint Intranet portal? Solution: Either query user profiles store or user information list to get the user profile properties such as Department, Job title, etc. PowerShell to query User Information List in SharePoint: Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue #Configuration Parameters $WebURL="http://portal.crescent.com/" $ReportLocation = "C:\UserAnalysisRpt.csv" #Get the Web $Web = Get-SPWeb $WebURL #Get User information list $UserInfoList = $Web.SiteUserInfoList #Get all Groups of the web and Iterate through Foreach ($Group in $Web.Groups) { #Get Permission Levels Applied to the Group $RoleAssignment = $Web.RoleAssignments.GetAssignmentByPrincipal($Group) $RoleDefinitionNames="" foreach (
Get User Department, Job Title from User Information List of SharePoint using PowerShell Get User Department, Job Title from User Information List of SharePoint using PowerShell Reviewed by Salaudeen Rajack on September 25, 2016 Rating: 5

How to Add Administrator and Grant Permission to Service Applications using PowerShell?

September 24, 2016    , , , , ,
By default, Farm administrators group has rights to manage all service applications. Often there are situations when you may need to add additional administrators or grant permissions to SharePoint service applications. Say, You want to delegate service application administration to other users SharePoint farm admin account isn't added as service application administrator or not having permission to the service application. SharePoint allows us to delegate permissions and distribute administration of Service applications to multiple users by granting access as either Service Application Administrator or Feature administrator. These service application administrators cannot create/delete any service application but they can perform actions within their service application that doesn't affects the farm. E.g. A Search service application administrator can make any change to the Search service application, But He/She cannot make changes to the Search topology. How to Add Ser
How to Add Administrator and Grant Permission to Service Applications using PowerShell? How to Add Administrator and Grant Permission to Service Applications using PowerShell? Reviewed by Salaudeen Rajack on September 24, 2016 Rating: 5

SharePoint Online: Download a File from Library using PowerShell

September 22, 2016    , , ,
Requirement: Download a file from SharePoint Online Library How to Download File from SharePoint Online Library? To download file from library, follow these steps: Sign-in to SharePoint Online site >> Navigate to the library where your desired file is located Right click on the file and select "Download" option from the context menu. This gets you the "Save" prompt and the file gets saved in your client machine's Downloads directory. In Modern Libraries, You can simply select the file(s) or folder and hit "Download" button from the toolbar. Now, How to download a file from SharePoint online using PowerShell? SharePoint Online PowerShell to Download File from Library This PowerShell downloads file from SharePoint online document library (or any library!) #Load SharePoint CSOM Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-T
SharePoint Online: Download a File from Library using PowerShell SharePoint Online: Download a File from Library using PowerShell Reviewed by Salaudeen Rajack on September 22, 2016 Rating: 5

SharePoint Online: Set Folder Permissions using PowerShell CSOM

September 19, 2016    , , , ,
Requirement: Change folder permissions in SharePoint Online using PowerShell. How to Set folder level permissions in SharePoint Online? To manage folder permissions such as Add or Restrict in SharePoint Online, Follow these steps: Navigate to your SharePoint Online document library where the target folder is located.  Click on "Details" from the specific folder's context menu >> In the Details pane, Click on "Manage Access" and then "Advanced" links. This takes you to the "Advanced Permissions" page From the ribbon, Click on "Stop Inhering Permissions" button and confirm the prompt. Now, You'll get the list of users and groups who already have permissions on the folder. When you break the permission, SharePoint copies permissions from its parent (List/library in our case!). Click on "Grant Permission" button from the ribbon.  Enter the names of the users and groups you want to add permission to the
SharePoint Online: Set Folder Permissions using PowerShell CSOM SharePoint Online: Set Folder Permissions using PowerShell CSOM Reviewed by Salaudeen Rajack on September 19, 2016 Rating: 5

SharePoint Online: Remove Content Type From List using PowerShell CSOM

September 18, 2016    , , , ,
Requirement: Remove a Content type from SharePoint Online List. How to  Remove a Content Type from List in SharePoint Online? Login to your SharePoint Online site >> Navigate to the list or library settings  Under "Content Types", Click on the appropriate content type name that you wish to remove from List. In List Content Type page, Click on "Delete this content type" link and confirm the prompt once to remove the content type from the list Delete Content Type from List using PowerShell in SharePoint Online To remove a content type from SharePoint Online list, use this PowerShell script. #Load SharePoint CSOM Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" Function Remove-ContentTypeFromList() { pa
SharePoint Online: Remove Content Type From List using PowerShell CSOM SharePoint Online: Remove Content Type From List using PowerShell CSOM Reviewed by Salaudeen Rajack on September 18, 2016 Rating: 5

An error occurred while getting information about the user at server : The RPC server is unavailable

September 15, 2016    , ,
Problem: After installing SharePoint 2016 to setup a new farm, tried running SharePoint 2016 products configuration wizard, and the wizard failed at step 3 saying: Failed to create the configuration database. An Exception of type System.InvalidOperationException was thrown. An error occurred while getting information about the user <Farm-Admin> at server <Domain-Name>: The RPC server is unavailable Tried creating SharePoint farm using PowerShell, but got the same results. Troubleshooting: Verified that the SharePoint server is part of the domain and there is no connectivity, network, firewall related issues. Verified that the setup account is granted with DB_Creator & Security_Admin server roles.  Tried Adding the IP of the DC to HOST file of the Local server Tried ipconfig /flushdns - and ipconfig /registerdns commands as per Technet forums, but didn't help! Solution: Download and install the KB KB3115299 to fix this issue! As a general recom
An error occurred while getting information about the user at server : The RPC server is unavailable An error occurred while getting information about the user <Farm-Admin> at server <Domain-Name>: The RPC server is unavailable Reviewed by Salaudeen Rajack on September 15, 2016 Rating: 5

SharePoint Online: How to Delete a Term using PowerShell?

September 07, 2016    , , , ,
Requirement:   Delete a Term from SharePoint Online Term Store How to Delete a Term in SharePoint Online using PowerShell? Follow these steps to delete a term from Term Store in SharePoint Online. Navigate to your SharePoint online admin center site. (E.g. https://yourdomain-admin.sharepoint.com) Click the "Term store" link on the left navigation menu. From the taxonomy tree view, Expand the term group, Term set and all the way through the term you would like to delete. Click on the little arrow in the Term Header >> Select "Delete Term" option. Confirm the prompt to delete a term from SharePoint online term store. PowerShell to delete a Term from SharePoint Online Term Store: #Load SharePoint CSOM Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Micros
SharePoint Online: How to Delete a Term using PowerShell? SharePoint Online: How to Delete a Term using PowerShell? Reviewed by Salaudeen Rajack on September 07, 2016 Rating: 5

How to Change Default Content Access Account in SharePoint 2016 Search?

September 06, 2016    , , , ,
Once we complete creating Search Service Application, The next step is to configure default content access account, which is used by Crawl Component to crawl the content sources like SharePoint content. This crawl account will have read access to all your search content sources such as SharePoint Web Applications. Set default content access account You can change search crawl account from SharePoint Central Administration as: SharePoint Central Admin >> Application Management >> Manage Service applications From the service applications list, Select the Search service application In the Search Administration page, click on the account already configured for Default content access account. Provide the new crawl account user name and password. Content access accounts should be normal domain account. We shouldn't use SharePoint setup account or farm administrator account for crawling content as it would cause security trimming errors. PowerShell to Change Sear
How to Change Default Content Access Account in SharePoint 2016 Search? How to Change Default Content Access Account in SharePoint 2016 Search? Reviewed by Salaudeen Rajack on September 06, 2016 Rating: 5

SharePoint Online: Create New Term Set using PowerShell

September 06, 2016    , , , ,
Requirement: Create New Term Set in SharePoint Online Term Store. How to Create a New Term Set in SharePoint Online? Term sets in managed metadata service in SharePoint can be considered as a category or classification with number of predefined terms that can be used as metadata in lists or libraries. Follow these steps to create a term set in SharePoint Online: Navigate to your SharePoint admin center site. (E.g. https://yourdomain-admin.sharepoint.com) Click the "term store" link on the left navigation menu. From the taxonomy tree view, Select the term group in which you want to add a term set. Click on the little arrow in the Term group Header >> Click on New Term Set option Start typing your term set. Hit Enter button to complete creating the term set. That's all! PowerShell to Create a Term Set in SharePoint Online: #Load SharePoint CSOM Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\I
SharePoint Online: Create New Term Set using PowerShell SharePoint Online: Create New Term Set using PowerShell Reviewed by Salaudeen Rajack on September 06, 2016 Rating: 5

How to Test Outgoing Emails in SharePoint using PowerShell?

September 06, 2016    , , , , , , , ,
On troubleshooting SharePoint Email issues, as a first step, we have to check outgoing Email settings applied on SharePoint central Administration site are valid. So, how to test SharePoint outgoing email quickly? Here are my PowerShell scripts to test outgoing email in SharePoint 2013. Method 1: Send Email using SPUtility's SendEmail Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue #Configuration Parameters $SiteURL="http://portal.crescent.com/ " $Email = "salaudeen.rajack@crescent.com" $Subject = "Test Email from SharePoint" $Body = "Test Email Body" #Get the Web $Web = Get-SPWeb $SiteURL #Send Email using SPUtility SendEmail method [Microsoft.SharePoint.Utilities.SPUtility]::SendEmail($Web ,0,0,$Email,$Subject,$Body) The above PowerShell script sends Email to the given Email and returns "true" if success. Method 2: Using .Net SMTP Send Mail Add-PSSnapin Microsoft.SharePoint.PowerShell -Error
How to Test Outgoing Emails in SharePoint using PowerShell? How to Test Outgoing Emails in SharePoint using PowerShell? Reviewed by Salaudeen Rajack on September 06, 2016 Rating: 5

Change My Site Host URL in User Profile Service Application using PowerShell

September 06, 2016    , , , , , ,
Once My site host web application and site collection is created, the next step is to configure user profile service application to use the My site host. Here is how to set my site host in user profile service application of SharePoint 2016. Login to SharePoint 2016 Central Administration site Click on Application Management >> Manage service applications. Select your User Profile Service Application >> From the Manage User profile service page, under My Site Settings section, click on "Setup My Sites" link. Enter the My Site Host URL and click Save. You may have to specify other settings such as Personal Site Location, Site Naming Format, Secondary Owner, etc. Make sure your My Site URL is the default one under AAM! PowerShell to Set My Site Host Location in SharePoint:  Lets change my site host URL in SharePoint 2013 using PowerShell Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue $MySiteHostURL="http://mysite.cresc
Change My Site Host URL in User Profile Service Application using PowerShell Change My Site Host URL in User Profile Service Application using PowerShell Reviewed by Salaudeen Rajack on September 06, 2016 Rating: 5

Create My Site Host Site Collection for SharePoint 2016 using PowerShell

September 06, 2016    , , , , ,
My Site host is a prerequisite for configuring user profile service application in SharePoint (Although you can provide My site host URL later, its a best practice to have it ready prior creating user profile service application). Creating My Site Host in SharePoint involves following steps: Create a new web application for My Site Create "Personal" wildcard Managed Path for the web application Enable Self-Service Site Creation for the web app Create a root site collection using My Site Host template In User Profile Service Application, configure My Site Host location How to Create Mysite host using PowerShell in SharePoint? Lets setup mysite host for SharePoint in four steps. Here is my PowerShell script to create Web application and My site Host Site Collection for SharePoint 2016: Step 1: Create a Web application for My Site:  Although you can use any existing web application for my site host in sharepoint 2016, lets create a new web application to host my site
Create My Site Host Site Collection for SharePoint 2016 using PowerShell Create My Site Host Site Collection for SharePoint 2016 using PowerShell Reviewed by Salaudeen Rajack on September 06, 2016 Rating: 5

How to Hide the Timeline in the Task List of SharePoint 2016?

September 04, 2016    , , , , ,
Requirement: Hide timeline from SharePoint 2016 task list Solution: Here is how you can hide the timeline in SharePoint 2013/2016 task lists. Go to the Task List, Click on List Tab and then click on "Modify View" button from the ribbon. In the Edit view page, scroll down and expand the 'Style' section. Under the Style selection, Uncheck the checkbox 'Show timeline above the view' click on 'OK' button to save changes. Here is the Result: Alternatively, You can edit the page, Edit List view properties, and uncheck "Show Timeline" Checkbox to hide timeline from SharePoint tasks list.
How to Hide the Timeline in the Task List of SharePoint 2016? How to Hide the Timeline in the Task List of SharePoint 2016? Reviewed by Salaudeen Rajack on September 04, 2016 Rating: 5

Backup-Restore All SharePoint Databases in SQL Server using PowerShell

September 01, 2016    , , , , ,
Requirement: We planned to move our SharePoint's SQL database to a different server. So, we had to backup and restore all SharePoint databases from one SQL Server 2012 instance to another. Solution: Here are the steps at high level to move SharePoint from one SQL Server to another: Get a list of all SharePoint databases Backup all SharePoint databases from the source SQL Server Restore the backups to the target SQL server instance Change the SQL Alias in SharePoint Server to point to the new server. Step 1: Get all SharePoint databases #Get All SharePoint Databases and form an Array Get-SPDatabase | Select -ExpandProperty Name | foreach { $Databases+= $_+"," } #Export to a txt file $Databases > databases.txt This script gets you a list of all SharePoint databases, including configuration database, content databases and service application databases to a comma separated string. Lets take that string and give it to our backup script. Tips: If you want to
Backup-Restore All SharePoint Databases in SQL Server using PowerShell Backup-Restore All SharePoint Databases in SQL Server using PowerShell Reviewed by Salaudeen Rajack on September 01, 2016 Rating: 5
Powered by Blogger.