Questions tagged [powershell]
Windows PowerShell is Microsoft's task automation framework, consisting of a command-line shell and associated scripting language built on top of, and integrated with the .NET Framework. PowerShell provides full access to COM and WMI, enabling administrators to perform administrative tasks on both local and remote Windows systems.[except from WikiPedia]
4,135
questions
0
votes
1
answer
24
views
what's the best way to get all Teams owners and members
Is there a way from admin center to export all teams owners and members to a CSV file?
I can't run the following code b/c I think it depends on graph api and it might be blocked.
# PowerShell script ...
0
votes
1
answer
18
views
Programmatically get shareable link to updated folder (PowerShell)
My goal is to upload approximately 10,000 folders to a SharePoint library (call it T2) and create a list in SharePoint (say T1) that lists these folders along with other details and their ...
1
vote
2
answers
35
views
How can I use PnP Powershell to enable custom script in a subsite?
My problem is enabling custom script with DenyAddAndCustomizePages.
A two-line script can describe my problem.
Background: I was using Set-SPOSite to enable it like this:
Set-SPOSite $SiteURL -...
0
votes
1
answer
24
views
Copy site root libraries and sub libraries with all permission using Get-PnPSiteTemplate
Our SharePoint sites have yearly structure like 2024->subfolders. When I use below PowerShell code to copy existing site template to new site then I am getting only root folders created. Each root ...
1
vote
0
answers
17
views
How to reference mapping file in SharePoint to sgus [closed]
In ShareGate, anyone knows how to map users to a file instead of writing out each user mapping in the PowerShell script?
Found the answer. pls delete.
0
votes
1
answer
22
views
SharePoint online default templates
I created 50 pages using the SharePoint online template called Blank. This has a header / title webpart at the top which we do not want.
Does anyone know of a way to remove this webpart from all the ...
0
votes
0
answers
11
views
Creating a List Column with SharePoint Online Management Shell
I need to create a few columns on a SharePoint Online List, I've been following this guide and with the following basic script I get no error, but also no column is created:
$FieldID = New-Guid
$...
0
votes
1
answer
50
views
how to upload a file to a document library using OData in PowerShell with curl or Invoke-RestMethod
As I cannot use Pnp.PowerShell with a SharePoint-2019 on premise, AFAIK, I've been trying workd with OData instead, using curl (or PowerShell Invoke-RestMethod or falling back to JavaScript fetch if ...
0
votes
0
answers
24
views
How to Restrict Default User Permissions for New Public Sites in SharePoint Online?
SharePoint Online admin here. In our organization there are several thousand users and even more SPO sites. We are trying to tackle challenges with site permissions that potentially expose us to risks ...
0
votes
1
answer
36
views
Is it possible to remove/hide/remove the "Stock Images" in SharePoint Online webpart?
I have a requirement to hide or not show "Stock Images" and "Web Search" etc when selecting an image to a web part. Is it possible to do that using PowerShell or some command?
I ...
1
vote
1
answer
22
views
How to recognise the differance between a "News Post" and a "Page" programmatically with PowerShell?
I have an intranet and try to get the statistics of News Posts. I have now this PowerShell script below where I do a search query and get some metadata.
Is there some attribute where I can recognize ...
0
votes
0
answers
29
views
Import and overwrite SharePoint list with Powershell
I'm using Export-SPWeb to export list from one Sharepoint site collection and
Import-SPWeb to import this list to another site collection.
I need to do it regularly and that the list and all data in ...
1
vote
1
answer
53
views
Issue Creating Org Assets Library (CDN)
I'm attempting to create an organizational assets library for use with company branded templates and copilot features.
I have successfully run this code on my development tenant, but when attempting ...
0
votes
0
answers
11
views
powershell add a group to all spo sites but authentication error
I am receiving authentication error. I have pim and access to admin center. any idea? I figured it out. my privilege access expired. it's working now.
1
vote
1
answer
31
views
Add-PnPView group by secondary field
I have created a script to create number of views in SharePoint, but I am unable to work out the CAML to group by more than one field if it's possible.
1 field being:
<GroupBy Collapse="TRUE&...
0
votes
1
answer
48
views
Get-PnPProperty -ClientObject with "invalid ID"
After I successfully call $f=Get-PnpFile -Url $Url if I invoke Get-PnPProperty -ClientObject $f -Property Versions I get an error that the object ID is invalid.
Any clue?
0
votes
1
answer
49
views
How to disable Social media bar for site collection without global admin rights?
A. Context of Access
I do not have acces to the central sharepoint admin center but I am the owner of a site collection and I am site collection administrator:
I am able to connect to my site ...
0
votes
1
answer
25
views
How to add site template into Organizations template library with lists and data?
I am trying to build a site template which will contains few lists and data within the list.
I am aware that I can create site script and add all lists and libraries, but that site scripts doesn't ...
0
votes
2
answers
42
views
SharePoint Online List Form PowerApp zip file difference between PS5 and PS7
We have several SharePoint Online List form Power Apps. We export and import them to different site collections in our tenant [DEV/TEST/ACCEPTANCE/PROD]. This requires to change the datasources.json ...
0
votes
0
answers
41
views
Apply Site Policy to Multiple Site Collections with PnP Powershell
Over time, a lot of SPO site collections have accumulated in my tenant. Therefore, I want to use Site Collection Feature called Site Policy to automatically close and delete sites after a defined ...
0
votes
0
answers
93
views
Add-PnPPageWebPart: Object reference not set to an instance of an object
I'm trying to add Quick Links to my SharePoint site using the PnP Module. However, when trying to run the command:
Add-PnPPageWebPart -Page $page -DefaultWebPartType "QuickLinks" -Section 2 -...
0
votes
1
answer
47
views
Get-PnPAzureACSPrincipal - is this cmdlet deprecated?
Is Get-PnPAzureACSPrincipal cmdlet deprecated?
I was able to use this cmdlet successfully 3 months before, but now ,running this cmdlet displays error that's this is not available.
when I run Get-...
0
votes
1
answer
48
views
Listing groups with the users in them using PowerShell - SharePoint Online
Is it possible to list all groups on the SPO website along with the users who belong to a given group and export the results to Excel?
I would like to add that 2FA is enabled on the website.
Unless ...
0
votes
1
answer
33
views
How can I quickly Delete the contents of a SharePoint List View
I've got a SharePoint with a view called Retention that has around half a million entries, I want to delete the entries in the view from SharePoint as they are no longer required but I've not been ...
0
votes
0
answers
10
views
Export 2013 User Profiles from UPSA -Multi Value - Managed MetaData
I am using the following script from GitHub to export user profile properties from SharePoint 2013 into a .csv file.
Unfortunately, I'm only getting the first value for properties where multiple ...
0
votes
1
answer
202
views
Find all users that have any level of permissions for a specific Sharepoint Site
I am having trouble with what I thought would be a very simple task, and I was hoping to ask for any assistance.
I have a task to very simply collect a list of all users that have any level of access ...
0
votes
0
answers
17
views
How to get a Video Thumbnail using PowerShell on SharePoint SE version?
I have a SharePoint (Subscription Edition) document library that is hosting some videos I uploaded. How can I get the video thumbnails using PowerShell? Again, the SharePoint version I am targeting is ...
0
votes
0
answers
66
views
Intermittent Unauthorized Additional claims required errors when calling /user/chats endpoint
I am experiencing intermittent errors when querying the graph api endpoint for teams chat.
I am using powershell and delegated access.
Here is a code snippet:
$tenantId = "my_tenant_id"
$...
0
votes
1
answer
174
views
How I can change Sender email in "Send an email (V2)" action for more than 80 Power Automate Flows?
I know I can do this by editing flow and finding "Send an email (V2)" action and changing email id from "From (Send as)" property, but to edit more than 80 flows and find "...
0
votes
1
answer
132
views
SharePoint Online’s Block Download File Policy - Does it involve some user licensing?
I have a requirement where they don't want users to download files.
There are 2 options I have been reading about.
Using Conditional Access Policy
Using a PowerShell command.
My question is there ...
0
votes
1
answer
41
views
Get script output to CSV
Please help me to export the output of the script as a CSV.
$siteUrl = "https://webapplication"
$daysThreshold = 30 # Number of days to consider as "active"
# Load SharePoint ...
0
votes
1
answer
168
views
Can we hide the Sync on all the current sites and future sites using UI or using PowerShell
I know that we can hide the Sync button for a document library or for all the document libraries inside a site as mentioned in this link https://www.sharepointdiary.com/2017/08/disable-sync-button-in-...
0
votes
1
answer
649
views
List folder structure in SharePoint Site COllection
I have a SharePoint online site collection with 17 subsites and a lot of document libraries, folders and sub folders in each subsite.
Is there a powershell script that will list all the subsites, ...
0
votes
0
answers
59
views
Exception calling "Update" with "0" argument(s): "To add an item to a document library, use SPFileCollection.Add()
I have an PopCorn Ketentuan Library, where i need to populate it with some old data we have on csv file. so i did the following:-
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction ...
0
votes
2
answers
98
views
SharePoint Online - unused content report
I would like to review the usage of my SPO site and extract a report with the following details:
Title, Created Date, Last Modified Date, Number of hits last 6 months, Last modified by, Created by
I ...
0
votes
0
answers
16
views
Project 2019 on-prem security mapping with PowerShell
I am building a script for automated deployment of SharePoint Farm with Project 2019 service application and a Project Web Application.
I used to manage Sharepoint online site collections several ...
0
votes
0
answers
26
views
Adding User to Site group fails for form based authentication using Powershell
When attempting to add a user using PowerShell to a SP2016, which has Form Base Authentication active, New-SPUser fails with user not found.
The following works for Domain users.
$web = Get-SpWeb $...
0
votes
1
answer
18
views
Removing database snapshop from failed backup
When trying to create a backup using a command like this:
Backup-SPSite https://server_name/sites/site_name -Path C:\Backup\site_name.bak -UseSqlSnapshot
Source
I ran into an issue where the target ...
0
votes
0
answers
48
views
Powershell to read excel and update metadata in different document library based on a cell value by matching the unique file name
I have multiple libraries storing only document with unique name, site wise.
I need to update metadata for these uploaded documents based by reading an excel sheet.
The twist is that it updates ...
0
votes
1
answer
347
views
Why Get-AdminFlow failed to return all the flows
I have Power Platform administrator permission and recently I used Get-AdminFlow cmdlet to list all the flows under our tenants. The cmdlet is working and listed a lot of flows.
However I found about ...
0
votes
1
answer
506
views
How i can get all files recursively without folders using Get-PnPFolderItem from the root folder and its subfolders
I want to get all the files from the root folder and its sub-folders, now when I tried this script:
$customerFolderFiles = Get-PnPFolderItem -FolderSiteRelativeUrl $serverRelativeUrl -Recursive -...
0
votes
0
answers
33
views
Method 'SetValueForUICulture' don't set other language value
I have a problem with SetValueForUICulture method in my PowerShell script, I added field using method Add-PnPField and later according to what I found on the internet I tried use SetValueForUICulture ...
0
votes
1
answer
20
views
Can you move unlicensed accounts around using PowerShell in SharePoint Online?
I'm trying to bulk move users from one group to another in a SharePoint online group. I ran this script:
And it moved only users that have O365 licenses. When it tried to move the other users, I got ...
0
votes
2
answers
162
views
Build an instant flow which iterate over a SharePoint library that have 2 million documents and folders
We have a SharePoint document library which contain around 3,000 customers subfolders inside the root folder, and total of 2 million files and sub-folders inside the 3,000 customer sub-folders.
Now we ...
0
votes
1
answer
253
views
Create lookup column with multi select option using Powershell
I want to create lookup column with multi select option using PNP PowerShell in SPO.
I am able to create lookup field below script. But i dont know what is the property to be added to make it multi ...
0
votes
1
answer
47
views
How to get the values of all the Properties in an SP Feature
I'm trying to see all the values in a particular SP Feature. I've been trying to do so with Powershell as follows.
Get-SPFeature MessageServer | Select -Property Properties
Though all that seems to ...
0
votes
1
answer
91
views
Migrate documents from google drive to OneDrive and update the links inside the documents, this is possible
We have many documents that are inside google drive, the documents contain links to other documents inside google drive and links to sections within the same documents. so is there a way to migrate ...
0
votes
0
answers
50
views
Getting Empty response when connecting SharePoint 2016 Excel Web Service method via SOAP client
We are having SharePoint 2016 farm and we try to connect the site and Excel Service via SOAP client. When we use OpenWorkbook for getting session ID, its working fine and the session ID is coming. ...
0
votes
0
answers
18
views
Bulk file move same file extension
I need to move files with from user. Sharepoint.com to user.onedrive.com. I tried using the SharePoint Migration Tool but it’s giving an error. Can someone help me with the easiest way to code this?
0
votes
1
answer
184
views
How to apply OneColumnFullWidth section in SharePoint site template
I have created a site template using PnP framework:
<pnp:Section Order="3" Type="OneColumnFullWidth">
<pnp:Controls>
<pnp:CanvasControl ...