Tag Info

New answers tagged

1

Try setting the property to 1 $column.FriendlyDisplayFormat = 1. This is enumeration type as we can see here: SPDateTimeFieldFriendlyFormatType enumeration


0

Use SharePoint Manager 2010 from CodePlex and you can browse through your sites and track down where it has reference. Directly deleting data from DB will put you in unsupported. also check this one http://leonidius2010.wordpress.com/2011/09/13/sharepoint-2010-finding-missingsetupfile/ Another method is using the powershell: ...


1

EPPlus EPPlus is a .net library that reads and writes Excel 2007/2010 files using the Open Office Xml format (xlsx). Below solution is not tested You can copy over the Excel InterOp dll's and then execute PowerShell referencing the Excel functions that are available in the interop. For example: You can create a new excel file using below statements ...


0

This will work. $content = ([Microsoft.SharePoint.Administration.SPWebService]::ContentService) $appsetting =$content.DeveloperDashboardSettings $appsetting.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::On $appsetting.Update()


0

You can remove app using following powershell command $instances = Get-SPAppInstance -Web <URL> $instance = $instances | where {$_.Title -eq '<app_title>'} Uninstall-SPAppInstance -Identity $instance replace <URL> with site collection url and <app_title> with title of the app you want to remove


0

Please try the below script. I have tried to get the listitem object out of the url. A check is necessary if your Urls contain relative urls as well. Thanks, Aravind. $site = New-Object Microsoft.SharePoint.SPSite($listURL) $web = $site.OpenWeb() $listitem=$web.GetListItem($listURL); "Output with list url-" $site.url $web.url $listitem.ParentList.Title ...


0

There IS a way to get rid of those GUID names for the application pools, and it works, too, although this is a hacky way of doing it; I don't know if anyone else does this, and you certainly do it at your own risk. Most of the time, these GUID names are created by Sharepoint's managed services. If you look in IIS, you will see under "Sites" a site called ...


1

I think better solution is to get filtered and sorted items from list using CAML query: $qry = New-Object Microsoft.SharePoint.SPQuery; $qry.Query = "<Where><Eq><FieldRef Name='Title' /><Value Type='Text'>440-10011</Value></Eq></Where><OrderBy><FieldRef Name='Modified' Ascending='TRUE' ...


0

You can use Sort-Object -Property for sorting the result $spSourceList.Items | where {$_['Title'] -eq '440-10011'} | Sort-Object -Property Modified ....


0

Use $ClientContext.Load($list.Views)syntax in PowerShell to load Views collection, for example: $list = $Context.Web.Lists.GetByTitle($ListTitle) $Context.Load($list) $Context.Load($list.Views) $Context.ExecuteQuery() if ($list.IsObjectPropertyInstantiated('Views') -eq $true) { Write-Host "Views collection has been loaded" }


1

Make sure the logged in user has rights to configuration database. http://social.technet.microsoft.com/wiki/contents/articles/20399.sharepoint-2013-the-local-farm-is-not-accessible-cmdlets-with-featuredependencyid-are-not-registered.aspx


1

this is the drawback of Import API. Unfortunately this isn’t something I’m able to fix (at least not easily) as it’s a function of the deployment API from Microsoft. All I’m doing is using their API to do the import. I’d have to either rewrite their import API or write some other routine to attempt to change the modified by user after the import ...


4

I can't see that you have run the SharePointBAC.ps1 in your script, which is downloaded from the Codeplex page SharePoint Backup Augmentation Cmdlets. The scripts Get-SPBackupCatalog Set-SPBackupCatalog Remove-SPBackupCatalog Export-SPBackupCatalog is not out-of-the-box native cmdlets in SharePoint Management Shell or PowerShell ISE with the reference of ...


3

That is not an official SP commandlet You can download it on codeplex https://sharepointbac.codeplex.com/ After downloading you install it by running the "SharePointBAC.ps1" included in the download Further Documentation


1

The problem came from the argument passed to SPFieldLink contructor : $destWeb.Fields[$_.DisplayName] if the column you are looking for is custom and not created yet in the destination site collection it's normal that you get an error. And it's clear that this script doesn't take in charge the creation of the custom Columns.


2

The Backup-SPFarm command should use a network share where The service accounts, Farm accounts and SQL Server service accounts have Full Control access to the share. This is because SharePoint uses SQL commands for running parts of the backup and these execute in SQL Server's context. More information: Prepare to back up and restore farms in SharePoint ...


1

You should use [today] I created following script and its working fine $spSite = Get-SPSite -Identity http://test $spWeb = $spSite.OpenWeb() $lList=$spWeb.Lists["testlist"] $lList.Fields.Add("Date","DateTime",$false) $lList.Fields["Date"].Title="Date" $lList.Fields["Date"].Defaultvalue="[today]" $lList.Fields["Date"].Update() $lList.Update()


0

You have to deploy the Solution package(wsp) into the farm and activate it and then that template will show under the custom tab of the template section. you can import a WSP file directly into Visual Studio 2010, edit it, and create a new solution that does work. check this one: ...


1

Ready PowerShell script for migrating both users and groups when you have CSV of old and new account names is here. Save the following into Migrate.ps1 (or whatever). Add-PSSnapin Microsoft.SharePoint.PowerShell function MigrateUserOrGroups($migrationType, $csvFile) { #Getting the SPFarm object $farm = Get-SPFarm Write-Host $migrationType ...


0

You can do a migration like this using PowerShell using the MigrateUserAccount and MigrateGroup method. SPFarm.MigrateUserAccount can be used in the same was as stsadm -o migrateuser. Full syntax, once you've grabbed the farm object with Get-SPFarm and assigned an object $farm is: $farm.MigrateGroup($oldlogin, $newlogin) ...


0

To set the Type property to People Results, you need to update the Source.ProviderId to equal SearchProvider.LocalPeopleProviderGuid; To set Default Authentication, you need to update the Source.AuthInfo to equal a new AuthenticationInformation(FederationAuthType.LocalNTAuth) object; If you need other credentials, then create a new object of type ...


0

Browsing from site collection -> subsite would actually take me to the new site collection that I created since I added a managed path entry when creating the new site collection of the same name. To remove the subsite I temporarily deleted the managed path for root/sitecollection which forced root/subsite to become active again along that path. I was then ...


1

Apps can't be installed using CSOM or JSOM. Powershell is good choice. Some links: Install and uninstall SharePoint apps using powershell script Add apps for SharePoint to a SharePoint 2013 site


1

The content is stored in the content database. You can access them as if you were accessing list item columns (try the 'PublishingPageContent' column) or, in the case of inserted Web Parts, you can use the SPLimitedWebPartManager class You do this with the SPListItem object and not the SPFile object.


0

Thanks for your question. You first part helped me a lot. I implemented your script with .aspx after the page title. That works fine. Your example works like this: $pageLayout = '<div class="ExternalClassCFBA8CDC81B34264A81647E2260499B4"><table id="layoutsTable" style="width:100%"><tbody><tr style="vertical-align:top"><td ...


1

You can disable alerts for site with stsadm: stsadm –o setproperty –url "YourSiteURL" –pn alerts-enabled –pv False Alerts: Stsadm properties Or you can try the server side code to disable on list level: Disable Alerts from a SharePoint List or Library


1

I believe there is no facility to disable the alerts on a list directly. One option is to write some javascript/jquery which reads the current page/Url to be the list page and disable the Alert setting button in the ribbon. Another way is to create a new permission level which does not allow user to create alerts and assign it to the list as suggested here


1

When you Export and Import the List /Library with the IncludeUserSecurity, Normal assumption is that any permissions on the list would be preserved. In other words, if my source list was not inheriting permissions on the list itself, a folder, or an individual item, then those custom permissions should carry over when I import the list to a new web. ...


0

You can download xoml file. It contains information about all activities. Example (without parsing for list activities): Add-PSSnapin "Microsoft.SharePoint.PowerShell" Function GetXOMLFromWorkflowInstance($wfa) { [xml]$xmldocument = $wfa.SoapXml $name = $xmldocument.FirstChild.GetAttribute("Name") $wfName = $name.Replace(" ", "%20") ...


0

PageLayout does not expose property that stores absolute url, use PageLayout.ServerRelativeUrl property to construct full url of page layout. Option 1 You could utilize SPSite.MakeFullUrl method to return the full URL for the specified server-relative URL of page layout, for example: $site = Get-SPSite $siteUrl $web = $site.RootWeb $pweb = ...


-1

You can use this command simply Get-SPFeature -Site "siteurl" | Sort DisplayName | FT DisplayName,scope,Id > Desktop\feature.csv FYI:- Powershell command to find active features for site collection


0

Try to open the PowerShell with Run with Administrator previlages. The following code worked fine for me, *param($Site,$FilePath) Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue function GenerateAllSitecollectionsInWebapplication ($url) { write-host "Sitecollection List Extraction started...." -foregroundcolor red try ...


0

Use following to only get sub sites where user has permissions: $webCollection = web.GetSubwebsForCurrentUser()


0

You can either use PowerShell formatting to provide a string representation, or create a new SPFieldLookupValue object: $lookupValueString = "{0};#{1}" -f $post.ID,$post.Title $lookupValue = New-Object Microsoft.SharePoint.SPFieldLookupValue -ArgumentsList $post.ID,$post.Title Then you assign the value to a field and then Update the item. ...


1

You could utilize the following pattern to inventory SharePoint objects (converted example): Get-SPSite $siteURL | Select -ExpandProperty AllWebs | Select -ExpandProperty Lists | Where { $_.BaseType -eq "DocumentLibrary" } | Select Title, Created, ContentTypes


1

Try below piece in your code. if($list.BaseType -eq "DocumentLibrary") { foreach ($ctype in $list.ContentTypes) { write-host "List name:" $list.Title write-host "List created:" $list.Created write-host "List content type:" $ctype.Name } } http://gallery.technet.microsoft.com/office/Find-Lists-or-Libraries-fd247709


0

So, it turned out that somebody screwed up with the default Item content type and hence the Title column was not visible under the Item content type. And, hence also not visible under my custom content type, as it was inheriting from Item content type. While googling around, i came across a similar question here. Jason provided the STSADM commands for ...


1

SPUser.LoginName is the property you can map to ActiveDirectory sAMAccountName LDAP attribute. Use serverfault.com or TechNet Gallery for further inquiries on how to use DOMAIN\Username logins and ADSI to query AD.


0

The script that you use doesn't matter (as long as it works). There is no script that will give you "performance". Performance of search will depend on more than just where it runs - it will depend on the content you are searching, the total size of all that content, how many other services are running and the most important resource I/O at your DB layer. ...


0

Practically in the real case scenario, setting up the My Site by removing the access of the respective user is enough. If there's a need to backup the site, then do it before removing or locking the site. For the User Profile's side, we need to keep My Site Cleanup job running properly. Although the name is My Site Cleanup job, it does everything, from ...


0

Found out by myself. $item["BigBoss"] did not return the SPUser-Object So I had to cast that using the following code: foreach ($item in $head.GetItems()) { $bigbossItem=$item['bigBoss']; $bigBossObj=New-Object Microsoft.SharePoint.SPFieldUserValue($web, $bigbossItem) $bigBoss=$bigBossObj.User $roleAssignment = New-Object ...


0

Check the type of the object: if($user.GetType().FullName.Equals("Microsoft.SharePoint.SPUser")) { }



Top 50 recent answers are included