8

This is the method using PnP Online. Retrieve the additional properties using Get-PnPProperty Connect-PnPOnline -Url $siteUrl $context = Get-PnPContext For Files $file = Get-PnPFile -Url $filePath -AsListItem Get-PnPProperty -ClientObject $file -Property HasUniqueRoleAssignments, RoleAssignments if($file.HasUniqueRoleAssignments -eq $...


8

Connect-PnPOnline https://yoursite.com/sites/yourFIRSTsite Get-PnPProvisioningTemplate -Out "MyTemplate.xml" -Handlers Lists,ContentTypes Disconnect-PnPOnline Connect-PnPOnline https://yoursite.com/sites/yourSECONDsite Apply-PnPProvisioningTemplate -Path "MyTemplate.xml" Disconnect-PnPOnline Depending on how many lists/content types are on the site you ...


6

Unfortunately, There is no direct parameter like -View to specify your View Name in Get-PnPListItem Meanwhile, as a workaround solution, you can pass the CAML Query to the -Query parameter based on your View setting. Ex: Get-PnPListItem -List Tasks -Query "<View><Query><Where><Eq><FieldRef Name='GUID'/><Value Type='Title'&...


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(); ...


6

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/...


5

For starters, you compare on the wrong property (and you are not using a PowerShell compare operator): Change if($mylistsToIgnore==$eachList.TempladID) to if($mylistsToIgnore -eq $eachList.TemplateID) Also, another typo: Change foreach ($eachList in $oListColl) to foreach ($eachList in $myListColl)


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 ...


4

Try <View Scope='Recursive'> ViewScope enumeration Example, Get Items Under Folder CAML


4

Unfortunately, the answer is no at the moment. PowerShell Core 6.0 is built on top of .NET Core 2.0 runtime. But the thing is, PnP PowerShell depends on PnP CSOM Core components which are dependent on SharePoint CSOM libraries. Now, SharePoint CSOM libraries are dependent internally on some "other" libraries which are, as yet, not compatible with .NET Core. ...


4

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


4

You can use the {{listid:ListName}} token instead of hard-coding the GUID. When you use this token , the provisioning engine will fix the placeholder with the actual value of the List ID. For example, if your list/document library name is Documents, use {{listid:Documents}}. Put the below line of code in your template xml file and then PnP will fix it for ...


4

After you create your field using Add-PnPField, you need to get that field using Get-PnPField and set the default value as below: $field = Get-PnPField -List CustomList -Identity "BoolField" $field.DefaultValue = "0" $field.Update() Invoke-PnPQuery Also, you can use PnPFieldFromXml itself to create a boolean field with No as default value as : $fieldXml = ...


4

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>...


4

You could use a CAML query to select your files. This example will get the last 5 modified files. Note that RowLimit won't work as expected, hence the select -first 5 at the end $listname = "Documents" $query = "<View><Query><OrderBy><FieldRef Ascending='False' Name='Modified'/></OrderBy></Query></View>" $items = ...


4

I think this is what you are asking for: Remove-PnPListItem -List "[Your list Title goes here]" -Identity ($TheItemId)


3

There is no TemplateId property in SPList object. You have to find it by TemplateFeatureId in SPWeb.ListTemplates. $myListColl = $eachWeb.Lists $mylistsToIgnore = @(101) foreach ($eachList in $myListColl) { $listTemplate = $eachWeb.ListTemplates | ? {$_.FeatureId -eq $eachList.TemplateFeatureId} if ($mylistsToIgnore.Contains($listTemplate....


3

Get-PnPListItem -List $targetList -Query "<View Scope=`"RecursiveAll`"><Query><Where><Eq><FieldRef Name = 'FileLeafRef'/><Value Type = 'Text'>Test.txt</Value></Eq></Where></Query></View>" View Element


3

The solution for the 403 error was to unlock the site collection. Set-SPOSite -Identity <URL> -LockState unlock After that the site collection could be removed with Remove-SPOSite


3

You need to use $libitem["FileRef"]. So, modify your inner foreach loop as below: foreach($libitem in $libitems) { if({$_.Name -match ".doc*"}) { write-host "lib path... " $libitem["FileRef"] } } It gives you the server-relative path of the file. Also,if you just want the file name, use $libitem["FileLeafRef"]


3

Here is a tool which we used for SharePoint 2007. http://spm.codeplex.com/releases/view/22762


3

In case you just want to use pnp-powershell, All you need to do for each one of those folders / files: FILE $result = Get-PnPProperty -ClientObject $file -Property RoleAssignments Get-PnPProperty -ClientObject $file.RoleAssignments -Property Groups foreach ($role in $file.RoleAssignments) { $result = Get-PnPProperty -...


3

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue; $spSite=Get-SPSite -Identity "http://sp/sites/dev" $spwWeb=$spSite.OpenWeb() $spAuditQuery=New-Object Microsoft.SharePoint.SPAuditQuery($spSite) $Today = [DateTime]::Today $DateLimit = $Today.AddDays(-7) $spAuditQuery.SetRangeStart($DateLimit) $...


3

By list item object, it means passing the Microsoft.SharePoint.Client.ListItem object. You are currently passing string which will not work. You need to use Get-PnPListItem to get the list item and then pass it to the Set-PnPListItemPermission command. To do that, you can use it as below: $listItem = Get-PnPListItem -List 'Test' -Id 1 or passing CAML ...


3

There is no PnP native way to do this but you can do it by dropping down into the CSOM EnsureUser method. Try this: $web = get-pnpweb $user = $web.EnsureUser("user@company.com") $ctx = Get-PnPContext $ctx.Load($user) Execute-PnPQuery $user


3

Here is what I ended up needing to do if someone else needed something like this Import-Module ActiveDirectory #will required to be downloaded/installed $Url = 'https://SharePoint/Site/Path' $Library = 'Team Reports' $RootFolder = '/Team Reports/Engineers' Connect-PnPOnline -Url $Url # Get Folders in the Root folder $folders = Get-PnPFolderItem -...


3

You can use the Set-PnPDefaultColumnValues command to set the value. Use it as below: Set-PnPDefaultColumnValues -List Documents -Field TaxKeyword -Value \"Company|Locations|Stockholm\"" where the term Stockholm is located in the Locations termset inside Company term group. If you know the guid of the term, then you can do it as: Set-...


3

The trick lies in getting the webpart JSON from a workbench page. Go to the workbench page, https://tenant.sharepoint.com/sites/test/_layouts/15/workbench.aspx. On this page, configure your quick links webpart and then save it and copy the webpart data (top left ). Store that data in a standard PS multi-line variable and then set it as PropertiesJSON of ...


3

1) You need SharePoint tenant admin access to enable Site collection app catalog. It is assumed that the we already have a tenant app catalog. If its not present, you need to create that first and then run the PS to add SCA. 2) Add-PnPSiteCollectionAppCatalog commandlet accepts the parameter Site which can be a string or Site object . So, you can also use ...


3

As mentioned in the comments, you need to use the Uninstall-Module SharePointPnPPowerShell2016 to remove the PnP PowerShell 2016. After that you can install the PnP SharePoint Online powershell using the executable file or using the Install-Module SharePointPnPPowerShellOnline command. Download link - PnP PowerShell


3

This is a CSOM limitation wherein the ViewCreationInformation object doesnt have a property to set the URL. It takes only the Title value. Also, the correct commandlet to create view is Add-PnPView. Would suggest that you update your PnP PowerShell to the latest version. So, what you can do is use the Add-PnPView commandlet to create a view as: Add-...


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