'sharepoint online'
4 TopicsPS Script for SharePoint Online to Pull Filename w Extension, Uploaded during a Time Period
Pretty much what the subject has. I need PS Script for SharePoint Online to Pull Filename with Extension Uploaded during a Designated Time Period on a specific site. I have tried to use Purview and Sentinel. Our Purview does not work at all and Microsoft has been no help. And there is nothing for File Size in Sentinel, otherwise I have what I need, but I definitely need the file sizes of each of the files.388Views0likes1CommentUpload Files to Sharepoint Library using an Application via PowerShell
Help please, I have the below script, which has been cobbled together from various elements of googling and AI. $siteUrl = "https://mydomainname.sharepoint.com/sites/Software" $libraryName = "Shared Documents" $filePath = "C:\temp\test.txt" $appId = "myappid" $tenantId = "mytenantid" $clientSecret = "mysecretkey" #mysecretkey # Acquire Token $tokenEndpoint = "https://login.microsoftonline.com/$tenantId/oauth2/token" $tokenBody = @{ grant_type = "client_credentials" client_id = $appId client_secret = $clientSecret resource = "https://graph.microsoft.com" } $tokenResponse = Invoke-RestMethod -Method Post -Uri $tokenEndpoint -Body $tokenBody $subfolder = "Calls" $fileEndpoint = "$siteUrl/_api/web/lists/getbytitle('$libraryName')/RootFolder/SubFolders('$subfolder')/Files/Add(url='$(Split-Path $filePath -Leaf)')" # Upload File $headers = @{ Authorization = "Bearer $($tokenResponse.access_token)" }##$fileEndpoint = "$siteUrl/_api/web/lists/getbytitle('$libraryName')/RootFolder/Files/Add(url='$(Split-Path $filePath -Leaf)')" Invoke-RestMethod -Uri $fileEndpoint -Headers $headers -Method Post -InFile $filePath -ContentType "application/octet-stream" From what I can see I am authorising successfully with the appid, secret and tenantid and I get a bearer token back from 365. I have assigned Application permissions to SharePoint for my app and consented at the admin level. When I run the script I get the following error Invoke-RestMethod : {"error_description":"Exception of type 'Microsoft.IdentityModel.Tokens.AudienceUriValidationFailedException' was thrown."} At line:1 char:1 + Invoke-RestMethod -Uri $fileEndpoint -Headers $headers -Method Post - ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc eption + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand Can anyone help in pointing me in the right direction on this? I maybe totally off mark as I'm not an advanced coder. My aim is to have a script running on a VM which will automatically start and have a scheduled task running a PowerShell script which can authenticate to 365, run reports and then upload these automatically to a SharePoint site. I have tried so many options but each method keeps generating an error. I have spent several days on this and I'm no further on. I'm hoping this is possible and that someone can offer my some help. TIA Jaq1.4KViews0likes0CommentsSearch Admin Data
Hi, I have recently started a project at work where we are looking to improve the search functionality in SharePoint. We are using the search Admin Data to identify top search terms and make sure theirs an effective use of meta data and where applicable items are bookmarked so that results appear at the top of a search query. On the data we have downloaded from search Admin one of the columns shows "average position of result" however the numbers are confusing and theirs no detail on what this number is generated from and I wondered if anyone could explain how this number is calculated and what it means. I've attached a photo of the results but if this is pointing towards it's average position on the page when a term is searched I expect the number to be at least 1. Appreciate any help314Views0likes0CommentsSharePoint Last Activity from Graph vs Sharepoint Admin Panel
When I query report with restAPI against graph: "https://graph.microsoft.com/v1.0/reports/getSharePointActivityUserCounts(period='D180')" for some sites I'm getting different date from what I see in Sharepoint Online Admin Panel - Activity tab - "Last Site Activity". Sometimes the date in Admin Panel is older sometimes newer. Which one is more legitimate?609Views1like0Comments