New answers tagged

0

As well as the normally documented steps for making PS Remoting work with SharePoint 2010/13, I have found that one additional step is required. RDP into one of your farm servers and open the SharePoint Management Shell. $w = Get-SPWebApplication https://my.site.com $w.GrantAccessToProcessIdentity("mydomain\myusername") You will need to do this for every ...


0

I also have same problem. After couple of hours of googling I have found this link http://codecaching.blogspot.ru/2012/11/importing-cmp-and-string-was-not.html There was a problem with wrong year in date 29 May 60354 05:36:10 -0000 In my case in have not found any wrong dates in my Manifest.xml files but I have found some max dates like 31 Dec 9999 ...


0

You may try to export via stsadm.exe command as written here: Move SharePoint Site Collection as a Subsite Moving SharePoint sites using stsadm.exe This command has different behavior then sharepoint powershell Export-SPWeb command.


3

Yes, there is a way. You need to use an SPQuery object (based on your SPView). Use the following PowerShell commands: $web = Get-SPWeb $($webUrl); $list = $web.Lists.get_Item($listName); $view = $list.Views[$viewName]; $spQuery = New-Object Microsoft.SharePoint.SPQuery($view) $spQuery.RowLimit = 0 $items = $list.GetItems($spQuery);


2

To add the certificate to the Central Admin trust is easy. You have to run the below command for each certificate. $cert = Get-PfxCertificate c:\CsAppTier.cer New-SPTrustedRootAuthority -Certificate $cert -Name CsAppTier c:\CsAppTier.cer is path & name of the certificate which you want an import. -Name CsAppTier, You can name whatever you want or ...


0

Under manage site features activate "Workflows can use app permissions" feature and you it should solve your problem.


2

Instead of removing and re-adding you may be able to just update their accounts. Move-SPUser -Identity "c:0-.f|atschoolroleprovider|parent" -NewAlias "c:0-.f|nhaschoolsauthroleprovider|parent" You can use the Get-SPUser to get all users and then loop over them to run across multiple accounts.


1

to remove a user try this one ######################## Start Variables ######################## $LoginName = "domain\login" $siteURL = "http://SharePointSiteURL" #URL to any site in the web application. ######################## End Variables ######################## Clear-Host $siteCount = 0 ...


0

Open SharePoint Management Shell as Administrator. Type this command Get-SPServiceApplicationPool | select Id, Name Open IIS Manager > Application Pool > Match Application Pool GUID with the command result. Refer Get the corresponding SharePoint services name of the Application Pool Guid


1

It depends upon on your environment ( i.e number of the site collection, Size of data, Complexity of sites). As you know, there is no direct way of migration from SharePoint 2007 to 2013. The only way is to build a temporary SharePoint 2010 farm( btw 2010 also pass End of life) then Backup the content DB from 2007 and restore it 2010 after upgrade here then ...


0

If it were me, I'd try to get help on the PowerShell script and get some test runs in. I wouldn't buckle into purchasing from a 3rd party just yet, when it's entirely possible to fix the PowerShell script. In my experience the script will use sharepoint web services in 2007 to grab the file and be uploaded through the sharepoint management shell snapin. ...


1

Maybe something like this? Essentially what this guy is doing is using the WinForms Report Builder dll to pull in the SSRS report and export it using code. You can upload the file once you have it through code that looks similar to this (referenced from Todd Klindt): $Web = Get-SPWeb $WebURL $List = $Web.GetFolder($DocLibName) $Files = $List.Files ...


1

Try: Add-PSSnapin Microsoft.SharePoint.PowerShell -EA 0 $UserSPU = "domain\user" $site = Get-SPSite https://sharepoint.example.com $web = $site.OpenWeb() try { $user = $web.EnsureUser($UserSPR) } Catch { Write-Host 'User not found.' }


0

after thorough analysis, i have found that the CSOM version in my tenant is not up to date with the script provided in dev.office.com. the recommendation here would be that you should make sure the newly released snippets/solutions are compatible with you tenant before we actually jump in. Especially, if you tenant is not in first release mode for changes ...


0

I think you're using wrong SPWeb to create SPFieldUserValue in this line: [SPFieldUserValue] $val = New-Object Microsoft.SharePoint.SPFieldUserValue($spwebin, $userin.ID, $userin.Name); You're using $spwebin to create value assigned to $spfileout. There should be no problems to update Author field. If user does not exist on target web, you need to use ...


0

You have to do impersonation with author of each item. #get a spsite object using the token of a specified user, "impersonating" the object add-pssnapin microsoft.sharepoint.powershell -ea 0 cls #use global so everything gets disposed start-spassignment -global function get-impersonatedsite ( [parameter(mandatory=$true)] $url, ...


0

After setting the Author and Editor field values, do the following: $spfileout.Properties["vti_author"] = $userin.LoginName $spfileout.Properties["vti_modifiedby"] = $userin.LoginName Another note: you don't need to update the SPWeb object at the end of your script if you are just changing SPListItem.


0

Created By & Modified By columns are “Person or Goup” type columns. In SharePoint all the lists has these columns by default. You can’t update the values of these columns from UI You can do it using the below mentioned MSDN link Updating the “Created By” and “Modified By” Columns in SharePoint lists using POWERSHELL


0

You can also avoid this by just putting ?WSDL on the end of the subset service URL and not change the url of the WebServiceProxy


2

If you go to Site Settings > Search Settings > Send queries to a custom results page URL, you can send your results to the Search Center using the Search Center URL property, thus: {SearchCenterURL}/results.aspx EDIT I believe the properties are as follows: Site Collection Search Center = SRCH_ENH_FTR_URL Site Collection Search Dropdown Mode = ...


0

If you use Get-SPListItems using where as your filter, you will be able to find the item ID. For instance: Get-SPOListItems -ListTitle TestList | where {$_.Title -eq "Test Item"} Do let me know if this helps


1

First of all, there is no way to do this using the GUI, You have to rely on the PowerShell. there are 2 options in Powershell. use the Copy-Spsite Copy-SPSite http://contoso/sites/OldTeam -DestinationDatabase WSS_Content -TargetUrl http://contoso/sites/NewTeam Now Run the Remove-Spsite to remove the old site. Another option is Using the BackUp and ...


2

Source: http://www.sharepointrelated.com/2015/03/30/change-site-collection-url-sharepoint/ $site = Get-SPSite http://servername/customer/questions $site.Rename("http://servername/customer/generalquestions") And you have more detailed info in http://www.toddklindt.com/blog/Lists/Posts/Post.aspx?ID=573


1

You have to use the Get-SPAlternateURL, it will return url from all zone then you will be know if one you are requesting being used or not The Get-SPAlternateURL cmdlet returns all alternate URLs that match the scope given by either the optional Identity parameter or by a combination of the optional WebApplication, Zone, or Resource parameters. ...


1

Complementing Kolten's answer: And if you really need to run it as a System Account, you can also start workflows with some powershell: Nice solution


2

Check that the powershell isn't running as a service account. Similar question answered here: Creating item in list using workflow doesn't trigger item created workflow


0

You can get all SharePoint Online Active users using powershell by below given link steps. It is already available on MSDN. All SP Online Active Users If you want different kind on information than please find the details in below mentioned link. Details of all active users in SP Online


2

If you do: $site = Get-SPSite https://sharepointsite/sitecollection/web/web and you get an error message that says: Get-SPSite : Cannot find an SPSite object with Id or Url: https://sharepointsite/sitecollection/web/web you know it's not a site collection. In PowerShell you can handle this error with a Try Catch block. Good article on error ...


0

$spInstalled = Get-PSSnapin | Select-String Sharepoint if (!$spInstalled) { Add-PSSnapin Microsoft.Sharepoint.PowerShell } $termSetName = "Product Hierarchy" $productCatalogSiteCollectionURL = <siteurl> $SpSite = Get-SPSite $productCatalogSiteCollectionURL $taxonomySession = Get-SPTaxonomySession -Site $SpSite $termStore = ...


1

I'd try to apply the patches yourself, in order. Install on CA server first, one at a time for each server. Then run the psconfig on the CA server, one at a time, then each server after that. The patches being installed by non-SharePoint guys is a huge red-flag since it's a specific process to it. Was it done to all servers? Did they install and run psconfig ...


2

It's achievable through PnP PowerShell CmdLets, you need to install the msi before using it. SPOAppPackage -Path c:\files\demo.app -Force Refer to other switch parameters for more options. More details here


0

Posting the answer from comment Here's a blog that explains how to use CSOM in powershell scripts with O365.


1

As I can't stand my half answer in the comments.. I used TamperMonkey (the Chrome version of FireFox GreaseMonkey) to automate the manual proces. It detects the ViewEdit page, checks the darn checkbox, unchecks it if needed, and saves the View... But I misplaced the code :-( If you open those 300 Views in Tabs, Tampermonkey will fire on all and you ...


2

I ran into this same thing and was able to get this to work by replacing the commented out lines with the others. # Add-Type -Path ([System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client").location) # Add-Type -Path ([System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.runtime").location) ...


0

This was answered in TechNet. Essentially, the answer is: Use the DocumentSetTemplate.DefaultDocuments.Add() method to add default documents to the Document Set content type. The DocumentSetTemplate class is found in the Microsoft.Office.DocumentManagement.DocumentSets namespace.


1

Get-SPWebApplication "http://MyServer/" | Get-SPSite -Limit All | Get-SPWeb -Limit All | % { $_.AlternateCssUrl = ($_.Site.Url + "/SiteAssets/DevColorChange.css");$_.Update() }


0

If you are using SharePoint online management cmdlets in web jobs the you need to copy all the cmdlet module files and its dependent binaries along with your powershell script, identifying these files is tricky. Instead of using SharePoint online management cmdlets, you can directly use CSOM APIs in a console application. In that case you need copy only your ...


1

In the below line of code, you are trying to fetch the colorfile from the sub web but it's not in the sub web; it's in the root web, that's why it works fine in the root web, but fails in other webs. $colorfile = $SPWeb.GetFile($r) Try using the below code and logic, Add-PSSnapin Microsoft.SharePoint.PowerShell $themeName = "PaletteTheme" $SPSite = ...


1

The proper use of this cmdlet is: $user = Get-SPUser -Identity "i:0#.w|domain\janedoe" -Web http://webUrl Move-SPUser -Identity $user -NewAlias "domain\janesmith" -IgnoreSid The Get-SPUser example is using Windows Claims (drop the i:0#.w| if not using Windows Claims) and the -Web is a Site Collection where the user is present in the User Information List. ...


0

I was looking for a solution. But it really does not seem to be supported today through CSOM. Of course it is supported by SSOM, but I understand that is not an option in this scenario. A possible alternative would be to set the JSLink of view. And create some custom code. It looks like a complex and strange solution. I wanted to mention it anyway. Best ...


2

The user object needs to exist in a UIL. That's the primary responsibility of stsadm/Move-SPUser: to migrate users within the UIL to the new identity. The User Profile Service can, in certain scenarios, automatically migrate a user when it has detected a change, but from the sounds of it, you don't need to do any work for this particular user.


0

you can create a new data view page in SharePoint designer and edit the link inside it to refer to edit form instead of display form,


1

The correct and recommended way would be to use the Client Side Rendering feature of SharePoint 2013. You can refer to Item Link example here for achieving this. Client Side rendering is powerful alternative to XSLT modifications and is wonderfully explained by Andrei Markeev in the article linked above.


0

I needed something like this to list the last date the user changed the profile. I created this script using info i found on the internet including this page so thanks everyone ;-). $siteUrl = "http://profilesite/" $site = Get-SPSite $siteUrl $context = Get-SPServiceContext($site) $pm = New-Object ...


0

I would probably create an app to facilitate this. You can make it SharePoint-hosted, and it would just have a form that a user fills out to execute a creating on a SharePoint site collection. This may be a little harder than a SharePoint list + powershell, but the app makes it easy to port over from site to site. Create an app using the App Model in ...


1

I think if you need to create a wizard with the user interaction, powershell is not the alternative. It is correct to use an application page. With C # code. Another alternative is that the sites are created in a list and trigger an event receiver with c# code to create the site collection. By using SSOM you have many tools for flexible solutions. Of ...


2

I would do this way( i am guessing you are developer). Create a List in SharePoint with all required column( Site collection name, url, Owners, Site template etc)as per your requirement.One special field which will indicate whether this request processed or not( true/false type). Now create PowerShell Script, which will read from List and create the site ...


1

Don't know why user25328 has a downvote, the right click works well with me too. Copy from PowerShell: Highlight what you want (left click and drag), then right click anywhere on the console to copy the highlighted text. Paste to PowerShell: Simply right click anywhere on the console, it will paste it after the prompt. Alternatively: Alt + Space > E > P ...


0

I would recommend a 3rd party tool to be honest. This allows you to create a new site collection from scratch, allowing you to set up things like IRM policies to expire content, indexed views, permissions revamps, and all that other fun stuff. Then using the tool, migrate the content into the new site. This has several benefits in that you can lock certain ...


0

The only option for this sized site is a Content Database backup and restore (to an alternate farm) or a content migration using a 3rd party tool. I would suggest avoiding RBS. SharePoint Content Databases can be up to 4TB+, depending on usage, available IOPS on SQL, and backup/DR plans.



Top 50 recent answers are included