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....
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: ...
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 ***
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 ...
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-...
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
...
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
$...
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&...
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#...
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" #...
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='...
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....
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.
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["...
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 ...
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 ...
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"
$...
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....
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 ...
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
...
1
vote
Accepted
Less than symbol in formula causes error in calculated column when applying site design
Use < instead of less than symbol. You can try below:
"verb": "addSPFieldXml",
"schemaXml": "<Field
Type=\"Calculated\"
ResultType=\"Text\"
Name=\"CalcProbability\"
DisplayName=\"...
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 + “\” + $...
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 ...
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(-...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
powershell-script × 68sharepoint-online × 37
powershell × 34
sharepoint-server × 17
pnp-powershell × 15
sharepoint-enterprise × 8
csom × 4
workflow × 3
list × 2
content-type × 2
excel × 2
pnp × 2
csv × 2
2013 × 1
sharepoint-designer × 1
development × 1
sharepoint-foundation × 1
document-library × 1
2016 × 1
lookup-column × 1
caml-query × 1
modern-experience × 1
migration × 1
administration × 1
active-directory × 1