New answers tagged

0

I have answered the same question posted by you in another Technet Thread, please remember to check it: https://social.technet.microsoft.com/Forums/msonline/en-US/de7406b9-c64d-43c8-97fd-84c7fc88cafe/set-terms-as-value-to-a-list-field-via-powershell?forum=onlineservicessharepoint You could try the following code, which works for me: Set-PnPListItem -List "...


0

Try this: $myOtherTermField = $category -as [Microsoft.SharePoint.Taxonomy.TaxonomyFieldValue];


0

The structure seems to be fine and here is a sample script to copy list items between sharepoint lists: SharePoint Online: Copy List Item to Another List using PowerShell And of course you can have a check on the OOB approach using Calendar Overlay. How to show a calendar from a sub-site on the home page


1

try below code, Id 47 is the Item Id in the library Connect-PnPOnline –Url https://tenant.sharepoint.com/sites/dev –Credentials (Get-Credential) $item = Get-PnPListItem -List "Site Pages" -Id 47 $Fields = Get-PnPField -List "Site Pages" foreach($Field in $Fields) { Write-Host $Field.InternalName -ForegroundColor Yellow Write-Host $item[$...


1

as below your prpoerty should be as $($myData) in your string Write-Host "Page '$($page.FieldValues["FileLeafRef"])' '$($page.FieldValues["category"])' "


0

You can get this using the PNPPowerShel #Get Credentials to connect $Cred = Get-Credential Connect-PnPOnline -Url https://teanat-admin.sharepoint.com -Credentials $Cred $allsites = Get-PnPTenantSite foreach($site in $allsites) { Try { #Connect to PNP Online Connect-PnPOnline -Url $Site.url -Credentials $Cred #Get subsites ...


0

You can prevent a web from using the "modern" page experience by disabling the web scoped feature with ID B6917CB1-93A0-4B97-A84D-7CF49975D4EC (name = "Site Pages"). To re-enable the "modern" page experience at the web level, you need to activate the feature again. Note: When you disable the feature, you can no longer create new "modern" pages, but ...


0

This error is not about PowerShell script but dealing with large document library. Since we cannot change the limit in SharePoint Online, we can only add indexes to columns in the large document library via Library Settings > Indexed Columns and see if it can overcome the list view threshold. But still, the best practice would be to maintain the large ...


0

In your case $FPfolder is a collection of ListItems. You cannot add Role Assignment to a collection. If you are sure that $FPfolder is a collection which contains only one element(folder) just add [0] after $FPlist.GetItems($query). It will looks like: ForEach ($FPfolderId in $FPfolderSplit) { $query = New-Object Microsoft.SharePoint.SPQuery $...


0

you can you something like that function GrantUserpermission($spweb,$spfolder, $userName){ if($spweb.SiteUsers[$userName]){ $assignment=new-object Microsoft.SharePoint.SPRoleAssignment($spweb.SiteUsers[$userName]) $assignment.RoleDefinitionBindings.Add($spweb.RoleDefinitions["Contribute"]) $spfolder.BreakRoleInheritance("true") ...


0

You can use CSOM to add Top Navigation Link in PowerShell, here is an example you can follow: https://www.sharepointdiary.com/2018/03/sharepoint-online-add-link-top-navigation-using-powershell.html And you can use power shell to turn on/off megamenu like this blog:http://www.letsharepoint.com/how-to-enable-megamenu-in-sharepoint-modern-sites-in-sharepoint-...


0

This PowerShell script checks user permissions and exports the findings into a CSV file. How to run this script? Just change the Parameters from Line#6 to Line#8 according to your environment and hit run. lease note, there is a limitation in the script: This PowerShell script doesn't scan Active Directory security groups! #Load SharePoint CSOM Assemblies ...


0

https://www.koskila.net/how-to-export-your-delve-blogs-content/ The results will include the URL of the site, the page count, last modified, and the email of the blog site owner...


0

easiest way is find all the site which using the pointpublishingPersonal#0 templates (this is template used for delve personal blogs). below script will take some time as per the number of sites and give you URL, owner and Template. url will be something https://url/portals/personal/userid Connect-SPOService -Url https://<tenanturl>.sharepoint.com ...


0

Solution The proposed solution is to recreate the content type with the exact same name, parent and ID. A) Download the SharePoint Online SDK from here and install it. B) Get the ID and other details of the deleted content type with the following steps: Go to a site where the content type still exists, then go to the site settings and choose Site Content ...


0

I will advise you to use pnp Add-PnPContentType link to msdn pnp


0

If you are trying to execute this in SharePoint Management Shell then just right click on the SP Management Shell and click Run As An Administrator. You may also need an account who has Shell Admin access permission. http://technet.microsoft.com/en-us/magazine/gg490648.aspx


0

If you are familiar with REST API, there is a simple way: https://m365x873105.sharepoint.com/sites/<SiteName>/_api/web/lists('GUID OF THE LIST')/fields('GUID OF THE FIELD') Best regards.


0

I think the best way is using url of your list that never change. Your list title can be changed $webUrl = "http://mySiteUrl" $listUrl = "/lists/myList" $web = Get-SPWeb $webUrl -ErrorAction:SilentlyContinue; if($web -eq $null) { read-Host "cannot access to $($webUrl) push any key to exit" exit 0; } Write-Host "connected to $($webUrl) Title $($...


0

Try to use the PowerShell command below: $baseUrl="http://spsite/" $web = Get-SPWeb $baseUrl $FPlistName ="ListName" $FPlist = $web.Lists[$FPlistName] Write-host List Name: $FPlist.Title Check if it return data. If the issue exists, use the PowerShell command to return all lists and libraries in this web, check if the list exists. $baseUrl="http://spsite/"...


1

Try something like given below (not an exact code like you want. But you can get the idea from it how you can store the values in array and set it): #User Account to set $UserAccounts="Crescent\Salaudeen; Crescent\Ravi" $UserAccountsColl = $UserAccounts -split ';' $UserCollection = new-object Microsoft.SharePoint.SPFieldUserValueCollection foreach($...


0

when i edit my list with PowerShell, i have this query <OrderBy><FieldRef Name="FileLeafRef" Ascending="FALSE" /></OrderBy> when you want (Ascending true) do not add parameter ascending, like this for title <OrderBy><FieldRef Name="FileLeafRef" Ascending="FALSE" /><FieldRef Name="Title" /></OrderBy>


1

The correct column name for this document library is LinkFilename. If its a SharePoint list, you need to use LinkTitle Modify the query as below: $Query="<OrderBy><FieldRef Name='LinkFilename' /></OrderBy>" Also, Add-PnPView supports SetAsDefault which if used sets the view as Default view as below: Add-PnPView ` -List 'Player Bios' ` ...


0

To sort in descending order try using this: $Query="<OrderBy><FieldRef Name='Name' Ascending='FALSE'/></OrderBy>" To sort in ascending order try using this: $Query="<OrderBy><FieldRef Name='Name' Ascending='TRUE'/></OrderBy>" Official documentation: Add-PnPView. Update: If you are trying to do this in document ...


0

Here is a quick solution for this using pnp-powershell. $context = Connect-PnPonline -Url [mysite] -ReturnConnection $web = Get-PnPWeb -Connection $context $adgroup = "c:0t.c|tenant|[ad id]" $ensureUser = $web.EnsureUser($adgroup) $adgroup= Get-PnPUser $adgroup -Connection $context Add-PnPUserToGroup -LoginName $adgroup.LoginName -Identity "$($web.Title)...


0

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 SharePoint Management shell this is automatically loaded. This could explain the different behaviours.


0

You can set a try/catch and add the feature if needed with Enable-PnPFeature -Identity 41e1d4bf-b1a2-47f7-ab80-d5d6cbba3092 -Connection $site_context


1

try below code, if((Get-PSSnapin "Microsoft.SharePoint.PowerShell") -eq $null) { Add-PSSnapin Microsoft.SharePoint.PowerShell } function Get-UsefulWebsitesFromSql { #Connect to the database $conn = New-Object System.Data.SqlClient.SqlConnection("Data Source=mySQLServer;...


0

Test Demo for you reference: Install PnP PowerShell from here. $SiteURL="https://xxxxx.sharepoint.com/sites/dev" $ListName= "Doc" #Connect to PNP Online Connect-PnPOnline -Url $SiteURL -Credentials (Get-Credential) #sharepoint online pnp powershell get list items $ListItems = Get-PnPListItem -List $ListName -Fields "Choice" #Loop through each Item ...


0

We can use PnP PowerShell to achieve it, the following script for your reference. $URL='https://tenant.sharepoint.com/sites/team' $ListTitle="CL1120" $FieldName="MultipleField" $OldUrl="mywebsite.domain1.com" $NewUrl="mywebsite.domain2.com" Connect-PnPOnline –Url $URL –Credentials (Get-Credential) $Items=Get-PnPListItem -List $ListTitle -Fields "ID",$...


0

It will depend on the domain trust mode (two-way or one-way), but this topic is covered under Using People Picker with multiple forests or domains and Configure People Picker (SharePoint Server 2010). A couple notes on this: The user object must be disabled in the source or destination forest. It is not supported to be enabled in both, and with the User ...


2

You can try with the default sharepoint site report page(Site Content and Structure Manager). Example: https://sprnd.sharepoint.com/sites/TestSite001/_layouts/sitemanager.aspx Reference URL: https://global-sharepoint.com/


Top 50 recent answers are included