Recent Discussions
Issue in connecting Azure Ad user api command from PNP online PS script
I have created a Powershell script in Azure function app. Have connected pnponline using Client id and thumbprint by creating an App registration with Graph API. The code is as below. Connect-PnPOnline -Url $adminSiteUrl -ClientId $clientId -Thumbprint $Thumbprint -Tenant "$($tenantName).onmicrosoft.com" Write-Information "Connected Pnp online Successful" $AzureAd = Get-PnPAzureADUser | Select-object Mail,DisplayName,UserPrincipalName Pnp online script has connected successfully but on executing the last line Get-PnpAzureADUser, i am getting the error as below. Error: The provided value for scope User.Read.All is not valid. Client credential flows must have a scope value with /.default suffixed to the resource identifier (application ID URI). Please help me on this issue.142Views0likes1CommentNeed to remove one drive folder using PnP Powershell
Hi Team, I'm trying to remove a folder using PnP and its throwing error as 404 Not Found, commands i am using as below Connect-PnPOnline -Url "onedrive Url" - credential (Get-Credential) $name = "Nest1" $Folderpath = "Document\Nest1" Remove-PnPFolder -Name $name -Folder $Folderpath - Force -Recycle Thank you for your help Regards Saurav1.9KViews0likes2CommentsPnP - Search Filters template with multi-values
How do I update the template for PnP filters to separate the multi-values? This is what the filter options look like now: This is what the filter options should look like: The code I have now for the filter template is: <content id="data-content"> <style> .filter { margin-bottom: 30px; } .filter--value { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; } .filter--message { padding: 10px; } .filter--name { font-weight: bold; font-size: 16px; color: rgb(119, 117, 111); padding: 0px 0px 5px; } pnp-filtercheckbox { max-width: 100%; } pnp-filtercombobox { flex: 1; } pnp-filterComboBox > div { display: flex; align-items: stretch; padding: 0; } .filterComboBox { align-items: center; flex: 1; } #{{@root.instanceId}}wrapper { max-width: 100% !important; } .ms-ComboBox { max-width: 100% !important; min-width: 100%; width: 100%; } .ms-ComboBox-container { width: 100%; } .ms-ComboBox-header { bottom: 0; height: 45px; position: fixed; top: 127px; } .ms-Fabric { width: 100%; } </style> <div class="template vertical"> {{#each root.filters as |filter|}} <div class="filter"> <div class="filter--name">{{filter.displayName}}</div> <div class="filter--value"> <pnp-filtercombobox data-instance-id={{@root.instanceId}} data-filter-name="{{filter.filterName}}" data-is-multi="{{filter.isMulti}}" data-show-count="{{filter.showCount}}" data-theme-variant="{{JSONstringify root.theme}}" > {{#each filter.values}} <option value="{{value}}" data-selected="{{selected}}" data-disabled="{{disabled}}" data-count="{{count}}">{{name}}</option> {{/each}} </pnp-filtercombobox> </div> </div> {{/each}} </div> </content> I've tried a few different options with the help of ChatGPT but did not get anywhere.484Views0likes0CommentsPnp Search Results Template Help
Hi, I'd like to make the search results look better. I'm currently using the below custom code. I'd like to have each result be enclosed in a box of some sort so that each search result is clearly not related to another search result. The results kind of run together. Also, the values for some of the fields that I have displaying in the search results are actually lookups from either the same or other lists on the same SharePoint site, so I would like to have those appear as clickable links instead of just text. I'd also like to know if I can have those fields not appear if there are no values to display for them. This is what the search results currently look like. Here is the current custom code that I'm using: <content id="data-content"> <style> /* Insert your CSS overrides here */ .example-themePrimary a { color: { { root.theme.palette.themePrimary } } ; } { { #unless root.properties.layoutProperties.showItemThumbnail } } .template--listItem--result { flex-basis: 100%!important; } { { /unless } } </style> <div class="template"> {{#if root.properties.showSelectedFilters}} <pnp-selectedfilters data-filters="{{JSONstringify filters.selectedFilters 2}}" data-filters-configuration="{{JSONstringify filters.filtersConfiguration 2}}" data-instance-id="{{filters.instanceId}}" data-operator="{{filters.filterOperator}}" data-theme-variant="{{JSONstringify root.theme}}"> </pnp-selectedfilters> {{/if}} {{#if root.properties.showResultsCount}} <div class="template--resultCount"> <label class="ms-fontWeight-semibold">{{getCountMessage root.data.totalItemsCount root.inputQueryText}}</label> </div> {{/if}} {{#if root.data.promotedResults}} <ul class="template--defaultList template--promotedResults"> {{#each root.data.promotedResults as |promotedResult|}} <li> <div> <pnp-icon data-name="MiniLink" aria-hidden="true"></pnp-icon> </div> <div> <a href="{{url}}" style="color:{{@root.theme.semanticColors.link}}">{{title}}</a> <div>{{description}}</div> </div> </li> {{/each}} </ul> {{/if}} <ul class="template--defaultList"> {{#each data.items as |item|}} <pnp-select data-enabled="{{@root.properties.itemSelectionProps.allowItemSelection}}" data-index="{{@index}}" data-is-selected="{{isItemSelected root.selectedKeys @index}}"> <template id="content"> <li class="template--listItem"> {{#> resultTypes item=item}} <div class="template--listItem--result"> {{#if root.properties.layoutProperties.showFileIcon}} {{#contains "['STS_Site','STS_Web']" (slot item root.slots.contentclass)}} <pnp-iconfile class="template--listItem--icon" data-extension="{{slot item root.slots.FileType}}" data-is-container="{{slot item root.slots.IsFolder}}" data-image-url="{{item.SiteLogo}}" data-size="32" data-theme-variant="{{JSONstringify root.theme}}"></pnp-iconfile> {{else}} <pnp-iconfile class="template--listItem--icon" data-extension="{{slot item root.slots.FileType}}" data-is-container="{{slot item root.slots.IsFolder}}" data-size="32" data-theme-variant="{{JSONstringify root.theme}}"></pnp-iconfile> {{/contains}} {{/if}} <div class="template--listItem--contentContainer"> <span class="template--listItem--title example-themePrimary"> <a href="{{slot item root.slots.PreviewUrl}}" target="_blank" style="color:{{@root.theme.semanticColors.link}}" data-interception="off">{{slot item root.slots.Title}}</a> </span>{{slot item root.slots.Definition}} <p></p> <span><b>Business Processes: </b>{{slot item root.slots.[Business Processes]}}</span> <span><b>Products/Services: </b>{{slot item root.slots.[Products/Services]}}</span> <span><b>Software/Apps: </b>{{slot item root.slots.[Software/Apps]}}</span> <span><b>Term Owners: </b>{{slot item root.slots.[Term Owners]}}</span> <span><b>Related Terms/Phrases: </b>{{slot item root.slots.[Related Term/Phrase]}}</span> <p></p> <span> <span class="template--listItem--author"> Term last updated by {{#with (split (slot item root.slots.Author) '|')}} {{[1]}} {{/with}} </span> <b><span class="template--listItem--date"> on {{getDate (slot item root.slots.Date) "LL"}}</span></b> </span> <div>{{getSummary (slot item root.slots.Summary)}}</div> <div class="template--listItem--tags example-themePrimary"> {{#if (slot item root.slots.Tags)}} <pnp-icon data-name="Tag" aria-hidden="true" data-theme-variant="{{JSONstringify root.theme}}"></pnp-icon> <div> {{#each (split (slot item root.slots.Tags) ",") as |tag| }} <span>{{trim tag}}</span> {{/each}} </div> {{/if}} </div> </div> </div> {{#if root.properties.layoutProperties.showItemThumbnail}} <div class="template--listItem--thumbnailContainer"> <div class="thumbnail--image"> <pnp-filepreview data-preview-url="{{slot item root.slots.PreviewUrl}}" data-preview-image-url="{{slot item root.slots.PreviewImageUrl}}" data-theme-variant="{{JSONstringify root.theme}}"> <pnp-img alt='preview-image' width="120" src="{{slot item root.slots.PreviewImageUrl}}" loading="lazy" data-error-image="{{@root.utils.defaultImage}}" /> </pnp-filepreview> <div class="thumbnail--hover"> <div> <pnp-icon data-name="DocumentSearch" aria-hidden="true"></pnp-icon> </div> </div> </div> </div> {{/if}} {{/resultTypes}} </li> </template> </pnp-select> {{/each}} </ul> {{#if root.properties.paging.showPaging}} {{#gt root.data.totalItemsCount root.properties.paging.itemsCountPerPage}} <pnp-pagination data-total-items="{{@root.data.totalItemsCount}}" data-hide-first-last-pages="{{@root.properties.paging.hideFirstLastPages}}" data-hide-disabled="{{@root.properties.paging.hideDisabled}}" data-hide-navigation="{{@root.properties.paging.hideNavigation}}" data-range="{{@root.properties.paging.pagingRange}}" data-items-count-per-page="{{@root.properties.paging.itemsCountPerPage}}" data-current-page-number="{{@root.paging.currentPageNumber}}" data-page-links="{{JSONstringify root.data.paging.links}}" data-theme-variant="{{JSONstringify root.theme}}"> </pnp-pagination> {{/gt}} {{/if}} </div> </content> <content id="placeholder-content"> <style> /* Insert your CSS overrides here */ </style> <div class="placeholder"> {{#if root.properties.showResultsCount}} <div class="template--resultCount"> <span class="placeholder--shimmer placeholder--line" style="width: 20%"></span> </div> {{/if}} <ul class="template--defaultList"> {{#times root.properties.paging.itemsCountPerPage}} <li class="template--listItem" tabindex="0"> <div class="template--listItem--result"> {{#if root.properties.layoutProperties.showFileIcon}} <div class="template--listItem--icon placeholder--shimmer "></div> {{/if}} <div class="template--listItem--contentContainer"> <span class="placeholder--shimmer placeholder--line" style="width: 60%"></span> <span class="placeholder--shimmer placeholder--line" style="width: 100%"></span> <span class="placeholder--shimmer placeholder--line" style="width: 100%"></span> <span class="placeholder--shimmer placeholder--line" style="width: 35%"></span> <span class="placeholder--shimmer placeholder--line" style="width: 20%"></span> </div> </div> {{#if root.properties.layoutProperties.showItemThumbnail}} <div class="template--listItem--thumbnailContainer"> <div class="thumbnail--image"> <div class="placeholder--shimmer" style="width: 120px;height: 70px;"></div> </div> </div> {{/if}} </li> {{/times}} </ul> </div> </content>4.3KViews0likes2CommentsDoes MS have APIs to allow license procurement/fulfillment to be done programmatically
Being a reseller of MS products, are there APIs that our reseller portal can call to facilitate license procurement/fulfillment/management programmatically i.e., no redirect to MS website to do the ordering, signing EULA, paying. We want of call APIs from our portal to allow our customers do the purchasing in a single pane of glass within our portal. Does MS expose APIs to allow this?705Views0likes1CommentauthenticationManager.GetACSAppOnlyContext: ExecuteQuery() - throws error "Token Request Failed"
Hi. I have a .Net Core v6 MVC project using Nuget Package PnP.Framework 1.13.0. This project works fine in LIVE on the App Service in Azure. However, using Visual Studio 2022 and debug on this project keeps throwing a "The SSL connection could not be established, see inner exception.'" or "Token Request failed". This has only started happening recently. I updated to windows 11 about 6 months ago. It did seem firstly intermittent and now it happends pretty much every time on the ExecuteQuery(). I'm wondering if there is throttling somewhere. AuthenticationManager authenticationManager = new AuthenticationManager(); using (ClientContext clientContext = authenticationManager.GetACSAppOnlyContext(_siteUrl, _clientId, _clientSecret)) { User Requester = clientContext.Web.EnsureUser(emailAddress); clientContext.Load(Requester); clientContext.Load(clientContext.Web); clientContext.ExecuteQuery(); Does anyone know if this still works in Debug Mode? Any help appreciated. Thanks. John.658Views0likes0CommentsUnable to retrieve version history of a file.
$file = Get-PnPFile -Url "https://???/sites/???/Shared%20Documents/some-file.docx" correctly returns the file object. $versions = Get-PnPProperty -ClientObject $file -Property Versions Get-PnPProperty : The object id "site:???:web:???:file:/sites/???/https: //???/sites/???/Shared Documents/some-file.docx" is invalid. At line:1 char:13 + $versions = Get-PnPProperty -ClientObject $file -Property Versions + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : WriteError: (:) [Get-PnPProperty], ServerException + FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.Base.EnsureProperty This is consistent for different files in different tenants that I have tested. Am using PnP PowerShell v1.1.10315Views0likes0CommentsCopy-PnPFile does not honor version history metadata
The command completes successfully copying all version history, but does not honour the version metadata. It simply places the current time in date created and the current logged-in account as Creator for all versions. I'm currently using version 1.1.10 because of another bug. But this doesn't work in 1.1.12 either. You don't want to lose your history - a major issue.321Views0likes0CommentsHow to display hyperlink with Display text in PNP Search results webpart?
Hi I have a list that contains a url column. I'm trying to display the list items in PNP Search results webpart. However it is displaying only the link present within the column but not the hyperlink. Where am I going wrong? Can anyone please advise? The list column is like this: Only links are displayed like this. Thanks Raj2.6KViews0likes2CommentsMicrosoft 365 PnP - Microsoft 365 Platform Community moved
Microsoft 365 Platform Community (PnP) has moved to GitHub to align on the one door experience for the blog posts and the relevant assets. Front page - https://aka.ms/m365/community Blog - https://aka.ms/m365/community/blog Weekly community calls - https://aka.ms/m365/calls Videos - https://aka.ms/m365/videos On technical questions and discussions we recommend using the feature area specific forums or the GitHub issues. This move happened already in spring 2022 - but adding this message for additional clarity also in the forum.444Views0likes0CommentsHow to make 3 column layout using Adaptive cards in PnP Search Results
Dear Experts, I am working with PnP Search Results. Especially, I am customizing Adaptive Cards to show People's Card information in the Search Results and so far I got one column. Please visit the link below to see what I have done so far. https://github.com/merpssirk/demo/blob/main/image/PeopleSearcAdaptiveCard.png I want to have at least 3 column layout. How can I do that? Can you please guide me through this? Thank you.1.1KViews0likes0CommentsExport / Import from Excel file in SharePoint (SPFx)
Here is the tool which will help you to import excel file into a list. This tool will not create any kind of list or column. It will help users to import their excel file in specific list. This tool also allows users to update existing records directly from excel file. I have develop the tool in SharePoint Framework. Currently this tool is for SharePoint Online version only. We are supporting following columns : Single line of text Multiple lines of text Number Yes/No Person or Group (Person + Group) Person or Group (Person + Group) (Allow multiple selections) Date and Time Choice Choice (Allow multiple selections) Hyperlink or Picture Currency Managed Metadata Managed Metadata (Allow multiple values) Lookup Lookup (Allow multiple values) Installation of App :- 1. Click here to download thesps-import-from-excel.sppkg. 2. Visit the Microsoft 365 SharePoint Admin Center 3. Go to Apps -> App Catalog. If you don't have app catalog,here are the instructionsfor creating one. If you have Site Collection level App Catalog, just to to Apps for SharePoint from your site collection. 4. Click 'Upload' and select sps-import-from-excel.sppkg file to upload. 5. Check the box for Make this solution available to all sites in the organization and click the Deploy button. 6. A successful installation will look like this: 7. if you receive an App Package Error Message stating, "Deployment failed," as shown here, simply delete the .sppkg file and repeat steps 4 and 5 to redeploy. 8. Now go to the site where you want this tool. Just create a new page or edit existing page and add a webpart 'SPS Import From Excel'. This tool has help on each steps. You can read and start exporting or importing the excel. How To Setup How To Use Enjoy!!!5.3KViews1like2CommentsAdd-PnPGroupMember won't map a user
With the following command I will entitle our users to a specfic site: Connect-PnPOnline -Urlhttps://xxx.sharepoint.com/sites/yyy-Credentials $userCredential2 $groupMember = Get-PnPGroup -AssociatedMemberGroup $gruppennameM = $groupMember.Title $groupid = $groupMember.Id Add-PnPGroupMember -LoginNameuser@company.com-Group $groupid After sending command above I get the following error: Add-PnPGroupMember : Method not found: "Int32 System.Text.Encodings.Web.TextEncoder.FindFirstCharacterToEncodeUtf8(System.ReadOnlySpan`1)". The command is full correct, the ID of the group is correct and the user is correct. Why does the command not work for me ?3.4KViews0likes2CommentsRead Documents versions.
Hi, I am qureying a document library with a filter condition in PnP PowerShell. After that I am writing the below PnP code to get the version properties for each library item. Get-PnPProperty -ClientObject $libitem -Property Versions My question when ever I call the above command will it get the data by hitting the server or get the data from the$libitem (library item) If it is hitting the server, can you please let me know if there is any way to get all the properties of the version for a library item without hitting the server. Regards, Kishore.641Views0likes1CommentConnect-PnpOnline: Getting error Length can not be zero. Parameter:Length
While connecting to SharePoint Online inside azure queue function I am getting error "Length can not be zero. Parameter:Length". I am using self signed certificate, key and Client ID to connect to sharepoint online. Anyone else facing the same issue ?2KViews0likes3CommentsHow to get who created M365 Group using PowerShell?
How do we find who created M365 group using PowerShell? Graph API?Solved3.4KViews0likes2CommentsNew-PnPMicrosoft365Group automatically connects to SharePoint Admin Center?
Hey Guys, I have some trouble with the cmdlet New-PnPMicrosoft365Group. I have to build up a connection to run PnP-Cmdlets, therefore I run: Connect-PnPOnline -Url "https://tenantXY.sharepoint.com/sites/anysite New-PnPMicrosoft365Group Connection is done with AppRegistration and Certificate Please disregard the missing Parameters "displayname", "mailnickname", etc. Can you confirm: Running New-PnPMicrosoft365Group builds up a connection towards the SharePoint Admin Center "https://tenantXY-admin.sharepoint.com" Does it disconnect from the connection towards the SharePoint Admin Center and connects back to "https://tenantXY.sharepoint.com/sites/anysite"? If I run the cmdlet Add-PnPSiteCollectionAdmin -Owners "email address removed for privacy reasons", does it add user1 as SiteCollection Admin in the SharePoint Admin Center "https://tenantXY-admin.sharepoint.com" or in the other site "https://tenantXY.sharepoint.com/sites/anysite"? Thanks in Advance Best Regards Marco831Views0likes0CommentsHiding the SharePoint App Bar when embedding
Does anyone know if you can hide the new SharePointApp bar (global nav) with a URL query param when embedding? I've tried: env=Embedded and env=WebViewList which work in some instances, but not everywhere (e.g., List forms like newform.aspx, and most _layout pages I have checked). Example: [tenant].sharepoint.com/_layouts/15/viewlsts.aspx?view=14&env=Embedded That gets rid of alomost everything except the App bar.11KViews1like5Comments