Introduction
SharePoint Online, a powerful collaboration platform, empowers organizations to manage and share information seamlessly. As SharePoint administrators, efficiently organizing content is essential, and PnP PowerShell emerges as a superhero in simplifying complex tasks. In this blog post, we’ll guide you through the process of creating a Person/Group column in SharePoint Online using the magic of PnP PowerShell.
What is PnP PowerShell?
Evidently, Patterns and Practices PowerShell (PnP PowerShell) is a versatile module designed for SharePoint Online and SharePoint on-premises. It offers a set of cmdlets that streamline various tasks, making SharePoint management a breeze. Whether you’re a SharePoint administrator or developer, PnP PowerShell is a valuable tool for automating processes and enhancing productivity.
Step 1: Install and Connect to SharePoint Online
Firstly, make sure you have PnP PowerShell installed. If not, install it using the following command:
Install-Module -Name PnP.PowerShell -Force
Tip: If you require more information on starting with PnP PowerShell, you can refer to another blog post found at: PnP PowerShell: How to get started? – Hemant Kabra
After that, connect to your SharePoint Online site using
Connect-PnPOnline -Url https://your-sharepoint-site-url -Interactive
Step 2: Create a Person/Group Column in SharePoint Online
Secondly, now let’s conjure up a Person/Group site column using the Add-PnPField cmdlet. Set the parameters to define the column’s properties:
Add-PnPField -DisplayName "Document Owner" -InternalName "DocumentOwner" -Type User -Group "Custom Columns" -List "YourLibraryName"
Here, -DisplayName
specifies the name as it appears in SharePoint, -InternalName
sets the internal name, -Type
defines the field type as “User,” -Group
places the column in a specific group, and -List
associates it with a particular library.
Step 3: Verify Person/Group Column in SharePoint Online
Now that column is created, let’s execute the command, and behold – your Person/Group site column is created! Confirm its existence by navigating to your SharePoint Online site. To inspect the fields in a list or library, you can use:
Get-PnPField -List "YourLibraryName"
Conclusion
In conclusion, PnP PowerShell is your trusty sidekick in the world of SharePoint Online administration. Creating Person/Group site columns becomes a swift and efficient process, thanks to the simplified syntax and powerful capabilities of PnP PowerShell. Empower your SharePoint journey by integrating PnP PowerShell into your toolkit and witness the magic of streamlined and automated SharePoint management. Your SharePoint Online experience is about to become a whole lot more enchanting!