New answers tagged

0

For modern page,we need to use spfx extension to add js file to page.If your code is ok,classic page should work well.


0

The file is stored in the List Documents. List list = clientcontext.Web.Lists.GetByTitle("Documents"); clientcontext.Load(list); clientcontext.ExecuteQuery(); list.GetItems(CamlQuery.CreateAllItemsQuery());


0

You can use the cmdlet Search-UnifiedAuditLog to search the unified audit log, which requires the Exchange Online PowerShell V2 module to work. See the sample script via this link: SharePoint Online: How to View Audit Log Reports in Security & Compliance Center? You can find the available Operations on Site permissions activities here.


1

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 audit logs from across multiple applications including SharePoint.


0

This is just not possible. If the users donot have access to the admin center, they can only create site collections with modern template(communication sites and team sites). The rest api you used is only available for Communication sites and non-group associated Team Sites.https://docs.microsoft.com/en-us/sharepoint/dev/apis/site-creation-rest To create ...


0

Silly me. The resolution is to delete the relevant cookies from the machine, after which the next execution of the script surfaces the prompt again, in this case allowing me to provide the correct credentials for tenant-2.


0

SharePoint 2013 workflow and SharePoint 2010 workflows are different, so you have to use different ways to cancel it. This article would help you: https://social.technet.microsoft.com/wiki/contents/articles/31910.sharepoint-cancelling-or-terminating-workflows-using-c-and-csom.aspx


1

Below is my demo code for your reference: Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" $loginname="Contoso\...


0

Check below code: param ( [string] $URL, [boolean] $WriteToFile = $true ) #Get all lists in farm Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue #Counter variables $webcount = 0 $listcount = 0 if($WriteToFile -eq $true) { $outputPath = Read-Host "Outputpath (e.g. C:directoryfilename.txt)" } if(!$URL) { #Grab ...


1

You can use the following PowerShell command for SharePoint on-premises: Set-SPSite -Identity "<SiteURL>" -LockState "ReadOnly" References:Set-SPSite. / SharePoint 2013: Set Site Collection to Read Only. UPDATE: Here is another sample script which can be executed using Windows PowerShell: Add-PSSnapin "Microsoft.sharepoint....


0

This can be achieved using Site Policies: Create a site policy with the option "The site collection will be read only when it is closed." ticked. Ensure that you do not set the site to close or delete automatically unless this is desired. Using the UI, the policy can be applied by going to Site Settings > Site Closure and Deletion, set the ...


Top 50 recent answers are included