Tag Info

Hot answers tagged

5

There are a few things that control this in site settings --> navigation. Managed Navigation -- use a term set for navigation Add new pages to navigation automatically -- a new item is added to the termset for each new page Create friendly URLs for new pages automatically -- This is what you're concerned about - the page shows up in the URL without the ...


3

Try this $userName = "UserName" $password = "Password" $pageUrl = "PageUrl" $localPath = "C:\Path\FileName.aspx" #create secure password $sPassword = $password | ConvertTo-SecureString -AsPlainText -Force $webClient = New-Object System.Net.WebClient $webClient.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($userName, ...


3

As you said you can use the command Move-SPSite on more site collection. Select the site collection (by matching the url) and then move them. Get-SPSite -Limit All | Where-Object {$_.Url -match "mySiteName" -or $_.Url -march "mySiteName1" } | Move-SPSite -DestinationDatabase ContentDb2 To create a new content DB, you can use New-SPContentDatabase ...


2

1 - The Move-SPSite cmdlet moves the data in the specified site collection from its current content database to the content database specified by the DestinationDatabase parameter. A no-access lock is applied to the site collection to prevent users from altering data within the site collection while the move is taking place. Once the move is complete, the ...


2

You could try the following regular expression ;#\d*;# for multi-lookup value. PowerShell example $value = "Brand Management;#2120;#Infinite Retail" $formattedValue = $value -replace ";#\d*;#", "," Output: Brand Management,Infinite Retail


2

Something like Get-SPSite -WebApplication http://sharepoint -Limit All should do the trick.


2

The error: The remote server returned an error: (403) Forbidden. occurs since authentication is required for this operation in SharePoint Online. You could utilize SharePointOnlineCredentials class from CSOM API for that purpose. The following example demonstrates how to download RSS feed from SharePoint Online and save it into file. Complete ...


2

You are passing a SPSite object and the Enable-SPFeature just needs the URL. Just use the "URL" property of the SPSite object - $SPSite.url


2

Every document has several properties, such as ModifiedBy, Author, etc. You can display them using, e.g. $ctx.Load($document) $ctx.ExecuteQuery() Write-Host $document.Author What you will receive, however, here will look like: SharePoint.User.User You will need to load the users separately from the documents, otherwise you will get only the name of the ...


2

We can't put calculation formulas in filter text so something like Today()+8 etc will not work. Two work arounds Use CSR/JSLinks to hide rows which don't fall in that time period. Use query string filtering. I.e. calculate the date range and sent it via query string ( ex: on link click which open the view page)


2

Use SPWeb.Language Property: if ((Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null) { Add-PsSnapin Microsoft.SharePoint.PowerShell } $SiteUrl = "http://contoso.intranet.com/" $site = Get-SPSite $SiteUrl write-host $site.RootWeb.Language $site.Dispose()


1

You can use CheckOut as below foreach ($file in $files) { $file.CheckOut() $stream = $file.OpenRead() $done = $list.RootFolder.SubFolders["Hertel"].Files.Add($file.Name, $stream, $true) Write-Host $done.Name "Uploaded" -BackgroundColor Green }


1

You can use below script for removing all Workflows Associated to a Particular List $SPSite = Get-SPSite "http://siteurl" $Web = $SPSite.OpenWeb(); $SPList =$Web.Lists["ListTitle"]; $workflowAssociations = $SPList.WorkflowAssociations; if($workflowAssociations -ne $null) { foreach($wf in $workflowAssociations) { ...


1

Following is an example of simple routing rule creating in record center which routes the Content Type “Document” to the /Records/Records Library. $mainURL = "URL" $RecordCenterURL = "RECCENURL" $web = New-SPWeb $RecordCenterURL -Template "OFFILE#1" -AddToTopNav Now, here is the chunk of code to Create the Content Organizer Rule. Write-Host ...


1

You need to make sure the web applications and customizations are in place before you mount the content database to the web application. The full process is described in the article Upgrade content databases to SharePoint 2013: Create Web Applciations Create a web application for each web application that existed in the SharePoint 2010 Products ...


1

In my solution I had a event receiver and some content type definition. I splitted it in two different solutions (one with event receiver and other with definitions) and now it is working. Actually I do not know why (I did not change code at all), sad story.


1

You should specify this in SQL. Open SQL Management Studio Connect to SQL database server Right click and select Properties Choose Database Settings Change Database default locations From now onwards all new database files goes to new location


1

To call a function in PowerShell the function needs to have been declared before it is called (int the document order or if in an external module the module must have been loaded before the call.) To pass arguments to a function write it like this functionName $argument1 $argument2 so your call should look like this ActivateConfidentailWorkFlow ...


1

I solved cleaning the recycle bin for the site collection. (the files are still stored in the contentDB until the recycle been is empty). (Get-SPSite http://mySite).RecycleBin.DeleteAll()


1

There is no easy way unless you find some utility function where you pass an object which will use Reflection to extract all properties Good old way is to Get-SPSite 'http://sitecollectionurl' That can give you an SPSite Object. Now you can choose the properties of your interest and put it into a text file using Out-File 'FileName.Txt' - Append Final ...


1

[Microsoft.SharePoint.SPFieldUserValueCollection]$lotsofpeople = New-Object Microsoft.SharePoint.SPFieldUserValueCollection $user1 = $w.EnsureUser("domain\user1"); $user1Value = New-Object Microsoft.SharePoint.SPFieldUserValue($w, $user1.Id, $user1.LoginName) $user2 = $w.EnsureUser("domain\user2"); $user2Value ...


1

To get custom list templates, use following script: $site = Get-SPSite <YOURSITE> $web = $site.AllWebs[0] $listTemplates = $site.GetCustomListTemplates($web)


1

I think I found an answer but not in powershell. Content Migration object model says: Content Migration object model: The object model provides the most control over your data migration scenarios. Using the object model, you can migrate anything, from a Web site to an item in a list, or a single document in a library. You can choose whether to include ...


1

You can easily find this information using PowerShell Get-SPFeature cmdlet Get-SPFeature -Limit All | Where-Object { $_.DisplayName -like "*open*" } Feature id is 8a4b8de2-6fd8-41e9-923c-c7c3c00f8295 You can find this from blog


1

Get-SPFeature | ? {$_.DisplayName -eq "YOUR_FEATURE_DISPLAYNAME"}


1

First, reference the web service, which is missing. Second, add the UserCodeMaximumLevel before you add the UserCodeWarningLevel. Third, add the new quota using the web service. if ($ver.Version.Major -gt 1) {$host.Runspace.ThreadOptions = "ReuseThread"} if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) { ...


1

The code is getting the content type from the root site collection and adding it to a List named "Shared Documents", in root site. Moreover, it is looking for the same named list in all sub sites. If it finds one, it is adding the content type to the list. If your requirement is to add the content type to a particular list in a single sub site, you can ...


1

if ($ver.Version.Major -gt 1) {$host.Runspace.ThreadOptions = "ReuseThread"} if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) { Add-PSSnapin "Microsoft.SharePoint.PowerShell" } Function UploadListTemplate($WebURL, $TemplateFilePath) { #Get the Web $web = Get-SPWeb $WebURL #Get the List ...


1

You could try this: $web = Get-SPWeb "http://team.company.com/sites/mysurvey" $list = $web.Lists["survey1"] $list.ShowUser = $true $list.Update() $listItemCollection = $list.Items foreach ($listItem in $listItemCollection) { write-host $listItem["Created By"] } $list.ShowUser = $false $list.Update() Obviously the users would be visible while the ...


1

For Office 365 Enterprise and MidSize Business you can set a users Password to never expire using Connect to Windows PowerShell by using your company admin credentials. Run the following cmdlet: Connect-MsolService Do one of the following: To set the password of one user to never expire, run the following cmdlet by using the UPN or the user ID of the ...



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