New answers tagged

1

I haven't found any good documentation for the web-part properties in the past. If you need to add the parts to modern SharePoint pages I would recommend using: Add-PnPClientSideWebPart -Page $homePage -Component "b519c4f1-5cf7-4586-a678-2f1c62cc175a" -Section 1 -Column 1 You can find the ID by adding the WebPart to another page and looking for the ID in ...


2

I would add the web part as custom using the ID, for example: Add-PnPClientSideWebPart -Page $homePage -Component "b519c4f1-5cf7-4586-a678-2f1c62cc175a" -Section 1 -Column 1 You can find the ID by adding the part to the page and inspecting the element in dev tools. Search for data-sp-feature-instance-id.


1

I got it working now. There were two problems. The first was that the Solution ID and the Feature ID are not the same. The second that the sandbox flag was not set, although I am trying to install a sandboxed solution. After passing it the feature ID instead of the solution ID and setting the Sandboxed switch it worked like a charm. Connect-PnPOnline -Url ...


0

The PnP command can only get activated features in the SharePoint sites, you can use Get-SPFeature command. Check the post: Get list of all features (installed and not active) on site? Trying to use FeatureDefinitions?


0

You can use -Query parameter to filter the list items by using CAML Query. Reference: Get-PnPListItem Examples - Check Example 5. Try Something like below: $listItems = Get-PnPListItem -List YOURLISNAME -Query "<View><Query><Where><Eq><FieldRef Name='System'/><Value Type='Text'>Windows</Value></Eq></Where&...


0

I found a solution. In the end it was really simple. After the call to Install-PnPSolution I had to add an Invoke-PnPQuery. So the working script looks like: $cred = Get-Credential Connect-PnPOnline -Url https://server/sites/pwa001 -Credentials $cred Install-PnPSolution -SourceFilePath C:\Dev\WorkflowDev\Workflows.wsp -PackageId $id Invoke-PnPQuery


0

Once I fully understood that Modern Team Sites function as individual site collections, I created 2 sites under the level of one of my new Team Sites. I chose the template option for no 365 group. This create sub-sites with the new modern layout and functionality - but which also supported unique Web IDs. I was able to update the field schema in the ...


0

You can refer to the following article: Copy Attachments from One List to Another using PowerShell https://www.sharepointdiary.com/2017/02/sharepoint-online-copy-attachments-from-one-list-to-another-using-powershell.html In addition, you can also use flow to complete such a requirement: https://powerusers.microsoft.com/t5/General-Flow-Discussion/Copy-...


0

This works for me. I hope that helps. $siteUrl = "https://tenant-sharepoint.com" Connect-PnPOnline -Url $siteUrl -UseWebLogin $documents = Get-PnPListItem -List "Documents" $context = Get-PnPContext $foldersUniquePermissions = @() $filesUniquePermissions = @() foreach($doc in $documents){ $context.Load($doc) switch($doc.FileSystemObjectType){ ...


1

Just install the right module. See the installation instructions here, and note that there's a different installation on the PNP modules for each version of SP, including 2013. Note, if you need multiple installations on the same machine, that can get a bit tricky, so see the answers here if you need that option.


1

I was able to figure this out by using the $context.Load($thing); $context.ExecuteQuery() # Setup the site context [Microsoft.SharePoint.Client.Web] $Connection = Get-PnPWeb $context = $Connection.Context [Microsoft.SharePoint.Client.List] $list = Get-PnPList $listName # Load the list $context.Load($list) $context.ExecuteQuery() # Load the checked out ...


1

There is an easier way to do it :) You can use the Set-PnPClientSidePage command as below, you can skip the translateX and translateY params: Set-PnPClientSidePage -Identity "MyPage" -HeaderType Custom -ServerRelativeImageUrl "/sites/demo1/assets/myimage.png" -TranslateX 10.5 -TranslateY 11.0 -Publish Reference - Set-PnPClientSidePage


2

You need to use the CreateLabel method to add other labels. Its not directly available via PnP, so you need to write some more commands to add these labels. The code necessary for that is as below: $context = Get-PnPContext $term = New-PnPTerm -Name "7230" -TermSet "Kreditorer" -TermGroup "Kreditorer" -LCID "1033" $createLabel1 = $term.CreateLabel("...


1

To loop through the check out items, couldn't you simply: $lists = Get-PnPList -Web $web foreach($list in $lists) { $checkedOutItems = $list.GetCheckedOutFiles() foreach($file in $checkedOutItems) { #take action } } UPDATE ------------------------ I was not iterating through the collection correctly. Try this: foreach($...


1

There are more elegant and maybe performant ways to do this, but you just want to get this done and move on with your life. Fetch all the lists, check its title against what you're doing, and if true, do it. $lists = Get-PnPList -Web $web foreach($list in $lists) { if($list.Title.ToLower().Contains("knowledge")) { ...


1

Technically, team sites are separate site collections. You're not able to create a lookup field pointing to a list from another site collection. As I understood, finally, you created two subsites within the same site collection via classic UI and after that the lookup field started working properly.


0

To get all list which has Lookup columns using powershell. Powershell to get list column and its types Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue #Configuration Parameters $SiteURL="http://sp:12001" $ListName= "Customers" $CSVPath="C:\Lee\script\list.csv" #Get the Web and List $Web = Get-SPWeb $SiteURL $List = $Web.Lists....


Top 50 recent answers are included