Skip to main content
3 votes

SharePoint Online credential is not working in PowerShell

If you have multifactor authentication enforced for your user account, you need to create and use an app password instead of your normal password. To create an app password in office 365, visit aka....
Donspeck's user avatar
  • 302
3 votes
Accepted

SharePoint Online credential is not working in PowerShell

If the account has MFA (Multi Factor Enabled), I mean apart from username and password we need to pass the one time OTP which we will get in our mobile - this is called MFA enabled password. Example: ...
SP 2022's user avatar
  • 4,114
3 votes

Edit Suite Bar Links in SharePoint 2019

Example $webapp = Get-SPWebApplication "http://webapp" $webapp.SuiteNavBrandingText = "Intranet" $webapp.Update() *** This does not work for SP2019 ***
Prasanna Ruwangana's user avatar
2 votes
Accepted

Script to find libraries that have a specific content type

you can use this script: This script takes 2 arguments: Web URL - This is a fully qualified URL to the site. Content Type Name - This is the content type name. So using the script would look like ...
Zdeněk Vinduška's user avatar
2 votes

Run a PowerShell script interactively on a SPO site (modern)?

There is a way. Although it's theoretical. Modify your PowerShell script so that it also hosts a mini-web server. You can use two PowerShell modules for that: Import-Module Polaris -Verbose Import-...
Denis Molodtsov's user avatar
2 votes
Accepted

Get navigation nodes from top navigation in hub (3 levels)

You need to request the sub-sub child data again using Get-PnPNavigationNode command. Modify your code as below: $TopNavs = Get-PnPNavigationNode -Location TopNavigationBar |Select Title,Url, Id ...
Gautam Sheth's user avatar
1 vote

Download All Files from Entire Site Collection using PowerShell SSOM

This PowerShell script will download all non-.aspx files across the entire SharePoint site collection: Add-PSSnapin Microsoft.SharePoint.Powershell $Site = Get-SPSite http://intranet.contoso.ca $...
Denis Molodtsov's user avatar
1 vote
Accepted

Need a powershell script to update 300+ SharePoint SitePages

@Taco_Buffet Got it figured out! Here's what I used to gather all highlighted content WebParts for all site pages for a specific site. Was able to change layoutID from "Card" ("Grid&...
Luke's user avatar
  • 13
1 vote

How to export powerapp solution (.Zip file) using powershell or pnp script?

Per my research, there is no related power apps commands to export powerapp solution, we suggest you export it manually: https://docs.microsoft.com/en-us/power-platform/admin/powerapps-powershell#...
Julie_MSFT's user avatar
  • 4,297
1 vote

Delete unique permissions of a File or Folder in a document library

Delete Unique Permissions from All Folders in a Document Library: #Set Variables $SiteURL = "https://crescent.sharepoint.com/sites/marketing/2018" $FolderURL = "/Shared Documents" #...
EchoDu_MSFT's user avatar
  • 2,905
1 vote
Accepted

Caml Query | How to copy today's list items from one SharePoint online list to another in batches?

The <Where> clause is missing in your Query! Also, make sure that the data type of the field Date is DateTime. <View> <Query> <Where> <Eq> <FieldRef Name='...
Mohamed El-Qassas MVP's user avatar
1 vote

How to get all column and type and internal name in my site by PnP PowerShell

1.Download SharePoint Online Management Shell. 2.Try below PowerShell as administrator. Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft....
Emily Du - MSFT's user avatar
1 vote
Accepted

Sharepoint 2013 - Script to Allow Sharing Site or library only to administrators

I don't think it's possible to disable sharing for non-owners by using PowerShell in the SharePoint server.
Emily Du - MSFT's user avatar
1 vote

Is it possible to create a one note file in SharePoint document library from Powershell

You could try the below powershell: $ctx = Get-PnPContext $folder=Add-PnPFolder -Name "testOneNote" -Folder "Shared Documents" $folder.ListItemAllFields["...
Michael Han's user avatar
  • 5,211
1 vote

Check who has given permission to a user in sharepoint online

Changes to permissions can be audited using Audit Log Reports. You will need to enable Auditing to view these reports. In Microsoft 365, you can also use the Security and Compliance Center to view ...
Callum Crowley's user avatar
1 vote

security error:script execution is disabled on this system:I can’t access Sharepoint from Powershell

This is not the issue with the SPFx framework command, it is the issue with local Windows PowerShell execution policy which can be fixed by the below command: Before running the yo command - run the ...
SP 2022's user avatar
  • 4,114
1 vote

How do I delete a specific folder from SharePoint using Power Shell script?

Modify the script as below: $User = "[email protected]" $Password = '*****' $url_sharepoint = "https://zheguo.sharepoint.com" $library = "doc1" $deleteFolders = "TestFolder" $...
Jerry's user avatar
  • 2,583
1 vote
Accepted

How do I delete a specific folder from SharePoint using Power Shell script?

The CSOM Method to delete the folder is DeleteObject(), for example: $targetFolder = $clientContext.Web.GetFolderByServerRelativeUrl($folderRelativeUrl); $targetFolder.DeleteObject(); $clientcontext....
willman's user avatar
  • 3,704
1 vote

p1 script not running with schedule job

Are you loading the SharePoint PowerShell modules in your script? If not, try adding the following to the start of your script: Add-PSSnapin Microsoft.SharePoint.Powershell When you start the ...
Rune Sperre's user avatar
  • 2,249
1 vote

Excel/Powershell to extract substring from a URL

Powershell: Either cast to an [uri] type and (re-)assemble the parts > [uri]"https://teams.SharePoint.com/sites/site/communities/subsite" AbsolutePath : /sites/site/communities/subsite ...
LotPings's user avatar
  • 125
1 vote
Accepted

Less than symbol in formula causes error in calculated column when applying site design

Use &lt; instead of less than symbol. You can try below: "verb": "addSPFieldXml", "schemaXml": "<Field Type=\"Calculated\" ResultType=\"Text\" Name=\"CalcProbability\" DisplayName=\"...
Siddharth Vaghasia's user avatar
1 vote

How to transfer custom features and solutions from one farm to another?

If your custom solutions were delivered as .wsp files, you can export them from the old farm with the following PowerShell: (Get-SPFarm).Solutions | ForEach-Object{$var = (Get-Location).Path + “\” + $...
MHeld's user avatar
  • 5,123
1 vote

getting sharepoint list dropdown value using powershell

Multiple things that seems of with your code. "Exported" has a ) in it's name. Followed by . + the string to check against. You need to declare $ListItemCollection as an array to be able to push ...
Christoffer's user avatar
  • 9,881
1 vote

Powershell script to list all files in subsite with the content type assigned to them

We can use the PowerShell below to achieve it. $ct = @() $Web = Get-SPWeb "http://subsiteurl" foreach($list in $Web.Lists) { if($list.BaseTemplate -eq "DocumentLibrary") { if(-...
LZ_MSFT's user avatar
  • 6,249

Only top scored, non community-wiki answers of a minimum length are eligible