6

I can show how to get this using JavaScript and REST: $.ajax({ url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/RoleDefinitions/getByName('Contribute')", async: false, headers: { 'accept': 'application/json;odata=nometadata' }, complete: function (request) { var basePermissions = new SP.BasePermissions(); ...


5

For most PowerShell cmdlets, try something like this: get-pnpgroupmembers -identity "visitors group" | select * or get-pnpgroupmembers -identity "visitors group" | Get-Member As the PNP cmdlets are not populating all of the CSOM properties, you will get an error with "select *", and selecting some of the properties returned by Get-Member like Alerts and ...


5

You need to use /_api/groupsitemanager/HideTeamifyPrompt method to disable the Teamify banner. You can use it in PnP PowerShell as below: Connect-PnPOnline -Url "https://tenant.sharepoint.com/sites/TestTeamSite" $jsonBody = "{'siteUrl':'https://tenant.sharepoint.com/sites/TestTeamSite'}" Invoke-PnPSPRestMethod -Method Post -Url "/_api/groupsitemanager/...


4

I have the same issue. A workaround is to use the parameter -UseWebLogin. Connect-PnPOnline -Url https://collab.myCorp.com -UseWebLogin


3

In general you can use wildcards (*) with the select pipe. This works with any variable that has properties. To select ALL properties and see what their values are you can do something like the following: get-pnpgroupmembers -identify "visitors group" | select * Unfortunately if you have a lot of items in your pipeline from get-pnpgroupmembers you'll get ...


3

I don't know the exact number of user properties in each sharepoint version. But you can use below links to see the list of default user profile properties in SharePoint 2010,2013 and Office 365. Using this properties you can query your groups. Sources: Default user profile properties (SharePoint Server 2010). Default user profile property mappings. O365 ...


3

You need to use Get-PnPGroupMembers command. Use it as mentioned below where Identity would be the title of the group: Get-PnPGroupMembers -Identity "Visitors Group Name" Reference - Get-PnPGroupMembers You can also use Get-PnPGroup command as well: $group = Get-PnPGroup -Identity "Visitors Group Name" -Includes Users $group.Users Reference - Get-...


3

You can get the relative URL this way: $file = Find-PnPFile -Match myFile.docx $file.ServerRelativeUrl Just prefix https://tenantName.sharepoint.com to get the absolute path.


3

Please see below, You can get the complete list of PNP commands here Connect-SPOService = Connect-PnPOnline Disconnect-SPOService = Disconnect-PnPOnline Set-SPOUser = nothing equal for it. Set-SPOSite = Set-PnPSite Get-SPOSite = Get-PnPSite Add-SPOSiteCollectionAppCatalog = Add-PnPSiteCollectionAppCatalog


3

Right now you are iterating all lists that has the base type "Document Library". If you want to target a specific library you should use the method "Get-SPList" instead of the first for-loop. $list = Get-SPList -ListName "Video" -Web $web If you don't have the get-splist cmdlet use this $list = $web.Lists["Video"] [Check if the file extension is .mp4] ...


3

Yes, you can use Get-PnPListItem with CAML query to fetch the based on your conditions and then update them using Set-PnPListItem and passing the SystemUpdate parameter which wont change the modified and modified by fields. You can modify from below sample code for Active projects : $listItems= Get-PnPListItem -List "Project Management" -Query "<View>...


3

Sample demo to export list of data to CSV. $username = "lee@tenant.onmicrosoft.com" $password = "pw" $secstr = New-Object -TypeName System.Security.SecureString $password.ToCharArray() | ForEach-Object {$secstr.AppendChar($_)} $cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $secstr $siteurl = "https://tenant....


3

I don't think there is a way in PNP powershell to execute in batches currently. You can implement techniques that can speed up your current script by implementing best practices for coding. However , once i had this same issue and what I did was create multiple csv and run parallel threads of powershell to minimise the time . It's not the best approach ...


3

There is no way batching PNP cmdlets. The CmdLet runs and eveything is "done" afterwards. Internally PNP uses CSOM which can be batched - up to a certain point. (I am doing 200-300 delete operations or something like that but not too much..) If you really, really need batching, you can use the old SPWeb.ProcessBatchData-Method. However - it is SSOM! I, ...


3

This can be done via PowerShell: $tenant = "https://tenant-admin.sharepoint.com" $web = "https://tenant.sharepoint.com/sites/ModernTeam" Connect-PnPOnline -Url $tenant -SPOManagementShell $site = Get-PnPTenantSite -Detailed -Url $web if ($site.DenyAddAndCustomizePages -ne 'Disabled') { $site.DenyAddAndCustomizePages = 'Disabled' $site.Update() $...


2

With PnP Powershell, after you have hidden the title field and executed $field.update(), you also have to execute $field.Context.ExecuteQuery() or Invoke-PnPQuery This will push the updates to your field


2

I had this issue. It worked if I used a " " instead of the %20 in the url. After debugging the code I found that the issue was with the GetFileByServerRelativePath(ResourcePath.FromDecodedUrl(serverRelativeUrl) call that Get-PnpFile uses when downloading the file. I then stumbled on this: https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/...


2

There are three versions of PnP PowerShell. Are you sure you are running SharePointPnPPowerShell2016? Did you remove SharePointPnPPowerShellOnline? If you haven't, this would be the source of your problem. This article explains how to run them side by side: Running the various versions of PnP PowerShell side-by-side


2

One option (strongly unsupported by Microsoft) is to add custom Javascript (JS) in masterpage file, targeting this specific button for this specific field: 1) create JS file and store in SP --> code alters target button by hiding it or deleting (or how is more convenient for You) 2) create custom masterpage based on original (never-ever-ever edit the ...


2

This should give you the last item of the list: Get-PnPListItem -List "NieuweLijst" | select -Last 1


2

Your code does not retrieve any list items. This is an example of how you do it: $listItems = $list.GetItems([Microsoft.SharePoint.Client.CamlQuery]::CreateAllItemsQuery()) $ctx.load($listItems) $ctx.executeQuery() foreach($listItem in $listItems) { Write-Host "ID - " $listItem["ID"] "Title - " $listItem["Title"] } Credits to: https://www.c-...


2

PSCredential needs a SecureString rather than a plain string. $encpassword = convertto-securestring -String $password -AsPlainText -Force $credential = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $encpassword connect-pnponline -url xxxxxxxxxxxxxxx -Credential $credential


2

In SharePoint CSOM, use Microsoft.SharePoint.Client.FieldUserValue class instead like this: $owner = new-object Microsoft.SharePoint.Client.FieldUserValue($item["Owner"]).LookupValue


2

Example, we can configure the lookup list and show field for lookup field using the PowerShell below. Connect-PnPOnline –Url https://tenant.sharepoint.com/sites/lz –Credentials (Get-Credential) $listName="CustomList" $fieldName="TitleLookUp" $lookupListTitle="LookupList" $lookupList=Get-PnPList -Identity $lookupListTitle $field = Get-PnPField -List $...


2

You say the data is sorted ascending, but I'm guessing that it's the view that's sorted. get-pnplistitem isn't retrieving items based on a view, but based on the raw data. But if you check the docs, example #5 has a sample for using a caml query, which would allow you to both sort the data as well as to set a rowlimit. (the example only provides a where ...


2

Its not possible, but it is exposed in the Search Schema in the site settings menu, which is probably better for your purposes anyway. go to this URL in your site collection: /_layouts/15/listmanagedproperties.aspx?level=sitecol and then search for the term 'Thumbnail' without quotes. You will see the field name which is PictureThumbnailURL. It is ...


2

Get-SPSite -Limit all | % { if($_.RootWeb.Properties['DATA'] -ne $null){ Write-Host $_.Url } }


2

No, pnp does not support querying a list based on a view, though it does support using a caml query.


2

First, modify the column "ProjectStatus" values in list settings, change "Active" to "Live" and change "In Progress" to "not completed yet". Then run the PnP PowerShell below. Connect-PnPOnline -Url https://tenant.sharepoint.com/sites/lz -Credentials (Get-Credential) $listName="Project Management" $listItems= Get-PnPListItem -List $listName foreach ($item ...


2

You need to use SetShowInEditForm and SetShowInDisplayForm when using CSOM. Modify it as below: $customfield.SetShowInEditForm($true) $customfield.SetShowInDisplayForm($true) Reference - Field.SetShowInEditForm method Field.SetShowInDisplayForm method


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