Tag Info

New answers tagged

2

As an introductory please follow How to: Complete basic operations using SharePoint 2013 client library code article to get acquainted with how to update a SharePoint list item via CSOM. How to update list items via CSOM in PowerShell Assume the following data is contained in CSV file ID,FullName,Company,Title 1,Pilar Ackerman,Contoso Ltd,Manager ...


0

Alternatively you could use Get-SPOGroups Here's an example $ctx = Get-SPOContext url username password Get-SPOGroups -Web $ctx.Web This will give you a list of groups and ids in the rootweb. If you need users there is also Get-SPOWebUsers Example $ctx = Get-SPOContext url username password Get-SPOWebUsers -Web $ctx.Web


0

You could also use New-SPOPermissionLevel To create the RoleDefinition and New-SPOGroup if you want to create a group with that RoleDefinition.


0

It might be a bit late now but you can use a the SharePoint Online Automation cmdlets https://sharepointonlineautomationcmdlets.codeplex.com/ to do this. Just write a function which uses Get-SPOSubWebs and runs through all of the subsites recursively and use the Install-SPOWebFeature cmdlet to activate the features. Something like $ctx = Get-SPOContext url ...


0

If you're adamant in changing the webpart properties through powershell, you can use the following code: //Get reference to the SPSite object $SPsite = Get-SPSite "http://mywebapp/sites/mySite" //Iterate through all sub sites and root site foreach($SPWeb in $SPsite.AllWebs){ //Get reference to the landing page. Since it is a publishing site so ...


1

The preferred approach would be to change them in the Page Layout, create a new solution package and deploy that to the farm. This avoids unghosting of the page layout file. Or if you are clear about the consequences of unghosting you can go to the Master Page Gallery (http://sitecollectionroot/_catalogs/masterpage) and edit the Page Layout with SharePoint ...


0

You are missing a blank: Get-SPBusinessDataCatalogThrottleConfig-Scope should be Get-SPBusinessDataCatalogThrottleConfig -Scope also you need to use on of Global, Database, WebService, Wcf, Custom. for the scope parameter. Please see the TechNet documentation here that includes one example: ...


0

Are you running powershell or sharepoint management shell? Can you access Central Admin? If not you have a problem with your farm topology if you can then try running SharePoint management shell instead it may be that your version of vanilla powershell in missing the necessery snapins to connect to sharepoint.


2

Make sure the logged in user who is trying to run SharePoint PowerShell commands is having the right "SharePoint_Shell_Access" to the SharePoint_Configuration database to do so. http://blogs.technet.com/b/meamcs/archive/2013/02/18/sharepoint-powershell-command-problem-featuredependencyid-are-not-registered.aspx OR using command ...


0

The simplest thing I can come up with is simply using a content type. You gain the flexibility of modifying lists post-creation by updating the content type definition and you can add/remove columns at your leisure in the destination list. Building a list with a content type in powershell is a cakewalk and you minimize any scripting/development ...


0

What i understand your Production Farm's Build # 14.0.0.6106 and destination is 14.0.6029.1000, correct? also verfiry from central admin from both farm. 14.0.6029.1000 is the Sp1 level while 14.0.0.6106 June CU 2011 you dont need to downgrade the testing server rather upgrade it to june 2011 CU. Version mismatch is the only reason error.


1

You do not need a CAML query : Remove-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue try { # REQUIRED: URL to source SharePoint site with list $srcListSiteUrl = "http://testsrv/sites/home/pre-sales" # REQUIRED: Name of source list. ...


0

Not verified. But the AppCatalog is a SharePoint Library, i think you just have to add the *.app files to this list for deployment. there are plenty examaples of how to add a file to a library. Rest of the internal installation processing is automatically done by eventreceivers or workflows, i guess. Installing might eventually be the bigger problem, atm i ...


1

var currentContext = new SP.ClientContext.get_current(); var currentWeb = currentContext.get_web(); var currentUser = currentContext.get_web().get_currentUser(); currentContext.load(currentUser); var allGroups = currentWeb.get_siteGroups(); currentContext.load(allGroups); var group = allGroups.getByName(groupName); currentContext.load(group);


1

There is no Groups property for Web client object Use Web.SiteGroups property to get the collection of groups for the site collection, for example: $web.SiteGroups | select Name


1

just to understand: your asking: Enter NWAdmin Command to perform request action: i then type ali and it would loop through each subsite within the given site (i have 5): so the result should be: ali ali ali ali ali solution: Add-PSSnapin Microsoft.Sharepoint.Powershell $NWAdminCommand = Read-Host "Enter NWAdmin Command ...


1

I'm not sure this would work. But have you tried to use Invoke-Expression The Invoke-Expression cmdlet evaluates or runs a specified string as a command and returns the results of the expression or command. Without Invoke-Expression, a string submitted at the command line would be returned (echoed) unchanged. ...


0

It seems that errors occur when running the script but since error messages are suppressed in PowerShell in your environment that prevents them (line 25 and 31) from being displayed. Please make sure the system variable $ErrorActionPreference is not set to SilentlyContinue (see for an explanation below), otherwise set it to Continue (default value) and run ...


1

When working with SharePoint remotely, you have to use CSOM and the CSOM model, you can't use any Microsoft.SharePoint.* objects. Everything is Microsoft.SharePoint.Client.*. Start here to get acquainted with CSOM: http://msdn.microsoft.com/en-us/library/ff798388.aspx


0

You have two ways to add the template into a site. Use the UI and upload it (directly going to solution gallery) or try to use these Add-SPUserSolution and Install-SPUserSolution.


0

It doesn't appear to be possible to directly map the nameidentifier claim as itself. However, I was able to map it to a different local claim type and get it working, e.g. $map1 = New-SPClaimTypeMapping -IncomingClaimType "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier" -IncomingClaimTypeDisplayName "NameIdentifier" -LocalClaimType ...


1

hope this helps: $web = Get-SPWeb -Identity "http://YourParameter.xx/sites/publishing/en" $workFlowManager = $web.Site.WorkFlowManager $list = $web.Lists["YourParameter"] $workflowAssociations = $list.WorkflowAssociations.GetAssociationByName("YourParameter","en-US") $associationData = $workflowAssociations.AssociationData $items = $list.Items ...


1

For site collections to have the navigation from the root site collection set $spWebNavigation.UseShared = $true as shown below : # get the site collection $spSite = Get-SPOSite -Identity "http://sitecollection" # loop through all the webs in the site collection foreach ($spWeb in $spSite.AllWebs) { # check if root web as this one doesn't ...


0

Finally, I've finished with creating console application. I'm not great in C# so it is a bit bulky but this solution works. If there is any mistakes, i will be glad to hear about it. var reader = new StreamReader(File.OpenRead(@"C:\temp\views.csv")); List<string> listA = new List<string>(); while (!reader.EndOfStream) ...


2

I think what you are hitting is that SharePoint, when a content type is associated with a specific lists, adds an extra GUID to the Content Type ID. This makes it a child content type if the original one, even if it theoretically is not. You should be able to get the correct parent content type by doing something like: $listct.Parent.Parent.Name


1

To list them, this actually gives you all sites under the path though: Get-SPSite "http://awesome.com/workspaces*" -Limit ALL To delete you should be able to use Get-SPSite "http://awesome.com/workspaces*" -Limit ALL | Remove-SPSite -Confirm:$false You can use Remove-SPContentDatabase -Identity {GUID} to remove a content database


2

OK, found it. The two parameters -AuthenticationProvider and -AuthenticationMethod are from different worlds, not to be used together. The first one works with claims based auth while the second one with Classic Windows auth. To achieve my goal I need to use these commands: $auth = New-SPAuthenticationProvider -DisableKerberos:$false New-SPWebApplication ...


0

I have discovered the solution to this problem. If I add $outWeb.AllowUnsafeUpdates = $true before the $outWeb.Lists.Add() call, the list gets created correctly and completely. I also set this property back to $false immediately after the list creation.


2

I normally do something like this, for a specific solution (so in your case it will be put in the foreach: $solution = get-SpSolution $fileName while($solution.JobExists) { start-sleep -s 5 Write-Host -NoNewline "." } #Here you know the job is finished, and you can start your update


2

You can run this as a Windows Schedule task to run once a year. load Task Scheduler from Start > All Programs > Accessories > System Tools create a new scheduled task, click Create Task from the right-hand “Actions” panel. At a minimum, you should fill out the following information: General Tab Name of the task – e.g., Intranet Backup. A description is ...


3

It seems like there are really a few answers to this question -- First: If you want your Powershell script to work with the multiple single quotes, you can use Powershell character escaping to escape the single quotes that are really apostrophes (i.e. "deliver's"). If you add a back-tick (`) in front of the apostrophes, Powershell will not see them as the ...


2

Use Windows Task Scheduler. I sometimes use it for console applications. You can schedule the .ps1 file to run at yearly intervals. http://windows.microsoft.com/en-ca/windows/schedule-task#1TC=windows-7


0

Below are couple of links i mentioned, 1st one using powershell to remove the user and groups from DL and 2nd one is using the code( you can try to create equal powershell for it) For Powershell, read this: http://sharepointthinking.wordpress.com/2012/10/01/how-to-remove-users-and-groups-from-a-sharepoint-list-using-powershell/ For code check this: ...


2

You need to removethe Use Remote Interfaces This permission gives users access to several types of remote interfaces including SharePoint Designer, Web services and the Web Distributed Authoring and Versioning, or WebDAV, publishing interface. The Use Remote Interfaces permission is part of all of the default permission levels except LimitedAccess and ...


0

If you are wanting to import the list under the same site with the same name you can use -force which forcefully overwrites if it already exists. NB. This will overwrite what is currently there.


0

No. From my understanding of the question, the author wants to know if we can save a site template containing it's subsites. There are many workarounds (backup, export, individual templates), and I believe Tom has layed down some very good approach(es). However, site templates are saved independently for each site (web), and not even PowerShell can ...


1

Yes. It is possible using PowerShell. First, create site templates for the sub-sites. Then use the New-SPWeb cmdlet to create the parent, then the sub-sites from the templates. Keep in mind you must use the GUID of the template. Keep in mind that site templates are only one of many options for provisioning new sites. The new WebTemplate method in 2010 may ...


0

Here is a simple script to add a webpart to a page using PowerShell which is tested and working fine. Please note that to add a webpart to a page export webpart to your local drive .webpart/.dwp file will be in xml format. cls asnp "*sh*" $web=Get-SPweb -Identity "http://SP2013dev.com/sites/addwebpart/" [xml]$webpartxml= Get-Content -Path ...


1

Here is a simple script to add a webpart to a page using PowerShell which is tested and working fine. Please note that to add a webpart to a page export webpart to your local drive and .webpart/.dwp file will be in xml format. cls asnp "*sh*" $web=Get-SPweb -Identity "http://SP2013dev.com/sites/addwebpart/" [xml]$webpartxml= Get-Content -Path ...


0

I encountered the same problem… After reading many blogs, articles, presentations, code samples… etc I decided to develop/assemble an utility being able to set the necessary SSO Cookies in an unattended way for domain PCs and servers. After running the utility you will be able to mount the share without user intervention with the usual “net use…”. Maybe ...


1

There is property called DefaultValue. $FieldName = $list.Fields["NH Department"] Write-Output $("NH Department - Default Value " + $FieldName.DefaultValue)


0

Try this for creating list and view in sharepoint using powershell : http://nkelkar.wordpress.com/2011/06/21/powershell-create-lists-add-columns-set-new-default-view/


1

Use SPList.SaveAsTemplate for your source. Should be the same as the GUI. If that doesn't work, access the SPList.Views collection and copy the views over to the new list after creating it from the template.


1

All you need to change is the object where you add new role assignment, in you case: - change list to folder. Your modified script: function Add-SPPermissionToFolderGroup { param ($Url, $sourceFolder, $GroupName, $PermissionLevel) $web = Get-SPWeb -Identity $Url // $sourceFolderGets the folder that is located at the specified URL. ...


-1

Find a different solution for files of that size, SharePoint cannot handle them.


1

Have you tried the Remote PowerShell ability. Powershell 2.0 uses the concepts of WIN-RM which involves piping the contents of the remote call and running it on the remote server. You need to setup the remote Computer 1st you need to run the following command on your server Enable-PSRemoting you need to let powershell know that your server machine or ...


1

Done with below code. Use InheritDefaultPageLayout method instead of IsInheritingDefaultPageLayout property. $pweb = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($subsite) $pweb.InheritDefaultPageLayout(); $pWeb.Update();


0

Service application pools appear in IIS as long random strings of characters. The name you give it in SharePoint is not reflected in IIS Manager. An IIS Application Pool can have but one unique identifier, it’s Name, for which uniqueness is enforced. It works perfectly. However SharePoint has decided to use GUIDs for this Name. Within Central Administration ...


0

I did this a while back, and it's a little fuzzy, but I think your web application has to have the URL "http://abd.spdev", whereas I see you're trying to restore it to the Port 80 web application. Restore it as a site collection to the Port 80; if it's an empty web application, restore it as "" or if there's already something there, try "". If you want to ...


0

I found the solution by my self. Powershell is using the UTC time. It is possible to convert it to the local time: $workflow.Created.ToLocalTime()



Top 50 recent answers are included