Konstantin Vlasenko

An engineer is someone who can make for a dollar what any fool could make for two. – Alan Kay

Tag Archives: SharePoint

#PowerShell #SCOM Preserve/Update Created By/Modified By

This example shows how to use SharePoint Client Object API through PowerShell to create a list item with specific Author and Editor.
Useful if you want to preserve identities while moving the SharePoint items.

$siteUrl = "http://mysite"
$listTitle = "My List"
$user = "9;#domain\user"


cd "$installFolder"
Add-Type -Path .<PATH>\Microsoft.SharePoint.Client.dll
$ctx = new-object Microsoft.SharePoint.Client.ClientContext($siteUrl)
$web = $ctx.Web
$list = $web.Lists.GetByTitle($listTitle)

$itemInfo = new-object Microsoft.SharePoint.Client.ListItemCreationInformation
$item = $list.AddItem($itemInfo)
$item['Title'] = "Hello World"
$item['Author'] = $user
$item['Editor'] = $user
$item.Update()
$ctx.ExecuteQuery()

The tricky part here is the $user value. It should be in the form of: {user Id in SharePoint};#{user Name}
UserId
You can automate the process of getting the user Id number by Name.

SharePoint 2013 on Windows Azure VM five times more expensive than on AWS instance

Something wrong with Windows Azure! I decided to run a SharePoint 2013 on Windows Azure. Just to give Azure a chance;) But! What is going on there? Does someone really use it?
SharePoint 2013 requires minimum 8GB of RAM.

AWS

$0.066

AWS

Azure

$0.32

azure

Howto: SharePoint Items Stats

Get-SPSite | % {$_.AllWebs} | % {$_.Lists} | measure-object -property ItemCount -sum -minimum -maximum -average

Count – number of Lists in the SharePoint farm
Sum – number of Items in the SharePoint farm
Maximum – number of Items the biggest List has
Average – Items per List (average)

Display SharePoint Site collection Administrators

This script displays all Site collection Administrators along with their email addresses for all web applications.

Get-SPSite | % {$_.RootWeb.SiteAdministrators} | select @{name='Url';expr={$_.ParentWeb.Url}}, LoginName, Email

If you are on WSS v.3/MOSS 2007 use the next defenition for Get-SPSite

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") | Out-Null
function Get-SPSite{
$farm = [Microsoft.SharePoint.Administration.SPFarm]::Local
$farm.services | % {if($_.WebApplications.Count){$_.WebApplications}} | % {if($_.sites.Count){$_.sites}}
}

Howto: Display all SharePoint items created today

Get-SPSite | % {$_.AllWebs} | % {$_.Lists} | % {$_.Items} | ? {$_["Created"].Date -eq [System.DateTime]::ToDay} | % {"$($_.Web.Url)/$($_.Url)"}

If you are on WSS v.3/MOSS 2007 use the next defenition for Get-SPSite


[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") | Out-Null
function Get-SPSite{
$farm = [Microsoft.SharePoint.Administration.SPFarm]::Local
$farm.services | % {if($_.WebApplications.Count){$_.WebApplications}} | % {if($_.sites.Count){$_.sites}}
}

SPN checklist for Kerberos authentication with IIS 7.0/7.5

This post is more about the confusion that may arise around SPNs for setting up Kerberos authentication in IIS 7.0. IIS 7.0 has a new Kernel-mode authentication feature using which the ticket for the requested service is decrypted using Machine account (Local system) of the IIS server. It no longer depends upon the application pool Identity for this purpose by default and in turn improves the performance.

http://blogs.msdn.com/b/webtopics/archive/2009/01/19/service-principal-name-spn-checklist-for-kerberos-authentication-with-iis-7-0.aspx

#Kerberos#MOSS2007 on windows 2008

The are good post SharePoint Farm using Kerberos on IIS7 related to this configuration.

#MOSS2007 on #Windows2008, Farm Recovery, Progress: [Shared Search Index] 90 percent complete

UPDATED on: Nov 29, 2010

If the default Shared Services in the newly installed deployment is not deleted,
the restore job will hang when trying to restore the Shared Search Index at the following step:
Progress: [Shared Search Index] 90 percent complete.

MOSS 2007 (front-ends are Windows 2008) farm recovery  is stuck on Progress: [Shared Search Index] 90 percent complete in the log.  Does anybody know what is going on?

There are error in the event log:

Event Id: 6398

The Execute method of job definition Microsoft.Office.Server.Administration.ApplicationServerAdministrationServiceJob (ID d205f8ab-66fd-42c4-ab9e-22ef306c4c3f) threw an exception.
More information is included below.
Access is denied.

Event Id: 7076

An exception occurred while executing the Application Server Administration job.
Message: Access is denied.


Techinal Support Details:System.Runtime.InteropServices.COMException (0x80070005):
Access is denied.
at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_IsContainer()
at System.DirectoryServices.DirectoryEntries.CheckIsContainer()
at System.DirectoryServices.DirectoryEntries.Find(String name, String schemaClassName)
at Microsoft.SharePoint.Metabase.MetabaseObjectCollection`1.Find(String name)
at Microsoft.SharePoint.Metabase.MetabaseObjectCollection`1.get_Item(String name)
at Microsoft.SharePoint.Administration.SPProvisioningAssistant.ProvisionIisApplicationPool(String name, ApplicationPoolIdentityType identityType, String userName, SecureString password, TimeSpan idleTimeout, TimeSpan periodicRestartTime)
at Microsoft.SharePoint.Administration.SPMetabaseManager.ProvisionIisApplicationPool(String name, Int32 identityType, String userName, SecureString password, TimeSpan idleTimeout, TimeSpan periodicRestartTime)
at Microsoft.Office.Server.Administration.SharedWebServiceInstance.CreateSharedWebServiceApplicationPool(SharedResourceProvider srp)
at Microsoft.Office.Server.Administration.ApplicationServerJob.ProvisionLocalSharedServiceInstances(Boolean isAdministrationServiceJob)

Usage timer job failed – Event 8075 (SharePoint 2010 Products)

Managed Metadata Service or Connection is currently not available

  1. Go to Central Administration – > System Settings and Click Manage Service on Server
  2. Ensure that Manage metadata Web Service is Started
  3. iisreset

Source: http://faizal-comeacross.blogspot.com/2010/09/managed-metadata-service-or-connection.html

Follow

Get every new post delivered to your Inbox.