Tag Info

New answers tagged

0

Well, everything is stored in web parts like content editor webparts so by using the script below i was able to solve my problem: Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue $OldLink="http://sp10.crescent.com" $NewLink="http://sharepoint2010.crescent.com" #Get all Webs $webs = Get-SPWebApplication ...


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

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

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


0

I think fallout's answer partially answers the question. His 'if statement' checks if items exist, then updates items if they exist, otherwise it creates new items if they do not exist. Depending on your columns, the trick is to update only those items that have changed in the CSV file (required for efficient version control in the sharepoint list).


0

I think you'd use SharePoint Online Management Shell insteed of Power Shell. Link to download : https://www.microsoft.com/en-us/download/details.aspx?id=35588 I have found this post that could help you to manage term store and groups using PowerShell online here Hope this could help!


0

For now this is what I get from another forum: For working with SPO we need SharePoint Server 2013 Client Components SDK. After that we can start to work with SPO, exsample to get context, and get all properties of site: siteUrl = "https://yourtenantname-admin.sharepoint.com"; userName = "you@company.com"; password = "password"; using (ClientContext ...


0

I would recommend taking a look at the OpenXML SDK With this library, opening DOCX documents and editing them is pretty easy, and, more importantly, can be done without the need to have Word installed, unlike the previous DOC format which required you to instantiate a Word COM object (which has always been a no go for server side solutions). Once you get ...


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


0

You can use below snippet to create site collection SPWebApplication webApp = SPWebApplication.Lookup(new Uri("http://WebApp")); webApp.Sites.Add("/sites/site1", "Description", null, 1033, null, "administrator", "Administrator", "admin@contoso.com")) You can read command line arguments using if (args == null) { Console.WriteLine("args is null"); // ...


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


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


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.


0

Try with Enable-SPFeature xxx -Force


-1

Kill the vssphost4.exe process, do an iisreset and try again.


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


0

When you run Move-SPSite, the site collection gets moved to the new content database.However, the site collection in the source Content Database was not completely removed. The site collection "Deleted" flag was set to 1. This means it is scheduled for deletion. The Gradual site delete timer jobs will delete the site collection from the content database. By ...


0

For Create apps using VS follow the link https://msdn.microsoft.com/en-us/library/office/fp142379.aspx


0

You can create apps in Visual Studio, I never use Powershell to create apps. link: link


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


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


0

This line will return the size of all the site collection in MB: Get-SPSite | select url, @{label="Size in MB";Expression={$_.usage.storage/1MB}} | Sort-Object -Descending -Property "Size in MB" | Format-Table –AutoSize If you want the size of a specific site collection add the url after the Get-SPSite command: Get-SPSite ...


0

as you have mentioned that you have tried doing at Content Type level, which means column is a site column. And here is the PowerShell function which will set column's appearance in Edit/New form. Function is csom PowerShell so it does not depend whether you need to run on server, just pass valid parameters $Url = your site url, $credentials = your ...


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


0

Some time back I had similar requirement, to upload .stp onto List gallery and then create a list based on it. I cracked this problem, I hope below function can be useful to you. function UploadAndCreate-CustomListTemplate() { param( [Parameter(Mandatory=$true)][string]$rooturl, [Parameter(Mandatory=$true)][string]$listCreationUrl, ...


0

here we go: Display Name: OpenInClient Title: Open documents in client applications GUID:8a4b8de2-6fd8-41e9-923c-c7c3c00f8295 You can run the following the command to get all features: Get-SPFeature | select ID, DisplayName, Scope SharePoint 2010 : List of Features "ID, DisplayName and Scopes"


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


0

Here are the examples to get Details of a Feature. If you are not sure of the name, use this snippet. It will get all with name contained in Display Name Get-SPFeature -Limit ALL | Where-Object {$_.DisplayName -like "*YourFeatureName*"} Get all feature installed in site scoped Get-SPFeature -Limit ALL | Where-Object {$_.Scope -eq "SITE"} Get ID and ...


0

Here is an example of how you can filter the Get-SPFeature Powershell Cmdlet in order to get only those feature you know a part of the feature name. This snippet will list all features, where "Content" is contained in the Display Name of a Feature : Get-SPFeature | where { $_.DisplayName -like "*Content*" } If you want to List a sandboxed feature by name ...


1

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


0

When you run the move coomand, user will get correlation Id, sometime 404.typically this is advised to run in after hours, because you have to run iisreset after it.After you run the Move-SPSite cmdlet, run the IISReset command to update changes to IIS. Their is no power shell or other method, which will tell you exact timings.its depend upon, hardware of ...


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


0

You could consider the following options for creating a Group: Using SharePoint Online Management Shell New-SPOSiteGroup cmdlet creates a new group in a SharePoint Online site collection, for example: Connect-SPOService -Url https://contoso-admin.sharepoint.com -credential admin@contoso.com New-SPOSiteGroup -Site ...


0

In terms of iterating through all sites, in your site collection, and outputting the workflows associated, you can do the following powershell script. $site = Get-SPSite("your-site-url"); $site.AllWebs | foreach { $_.Lists | foreach { $_.WorkflowAssociations | foreach { write-host "Site:" $_.ParentWeb.Url ", List:" $_.ParentList.Title ", Workflow:" ...


0

Here's how I did it but in most situations it is best not to disable event firing outside the event handlier/receiver: $web = Get-SPWeb -Identity http://yoursharepointweb #FILL IN WITH YOUR WEB URL $list = $web.Lists["YOUR LIST"] #THE LIST NAME FOR YOUR LIST $item = $list.GetItemById(YOUR NUMERIC LIST ITEM ID) #THE ITEM ID $assembly = ...


0

Same issue here. Use Windows PowerShell instead of the SharePoint Online Management Shell and it will run.


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


0

Was the quota template actually created? If yes, then the error can be ignored. It is possible that Sharepoint will throw an error:"Warning storage level must be an integer that is greater than 0 and less than the maximum storage level". As this error is thrown by SharePoint, not SharePoint Provider, it can not be modified. The error message can be ...


0

AutoSPInstaller have as goal to make use of the best practices while installing SharePoint. You won't be disappointed.


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


0

Yes, it will delete the web from the Database. But you will not get the space back just with this action. Once something removed from the DB it will not reduced by size rather the white space(unused Space) increased. I think, you have to shrink the database to get the space back(reduce the size of content DB). their is one rule in the health n monitor ...


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


0

Found it. In DR scenario's, you need to synchronize the app management and subscription settings databases. Although designed this way, the farm in this case hadn't been set-up like this. Therefore, the app registrations weren't properly synced and this issue occurs. So if you're in the same situation: verify the syncs between your databases!


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



Top 50 recent answers are included