Posts Tagged ‘SharePoint’

Original Post: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfilecollection.aspx

**Please note** I didn’t attempt to “dispose”, so make sure to add it…

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$PSSnapin = Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue | Out-Null
clear
 
$org = "http://blueleader"
$dest = "http://redleader"
 
$orgLibrary = (Get-SPWeb $org).Folders["Documents"]
$destLibrary = (Get-SPWeb $dest).Folders["Documents"]
$destFiles = $destLibrary.Files
foreach ($file in $orgLibrary.Files)
{
	$curFile = $file.OpenBinary()
	$destURL = $destFiles.Folder.Url + "/" + $file.Name
	$destFiles.Add($destURL, $curFile, $true)
}

 

Folks this is the absolute last resort. DO NOT TRY THIS ON YOUR FIRST ATTEMPT!!!!

Disclaimer: This posting is provided “AS-IS” with no warranties, and confers no rights. Use this information at your own risk, I or Microsoft are not responsible for any damage which may occur due to wrong usage of this command.

Navigate to the Manage Service Application section of central administration. ex: http://servername:2010/_admin/ServiceApplications.aspx

When you have over any of the service applications links with your mouse, you will note that at the bottom of your browser you will see a URL. The other option is to right click on any of the service application links then properties. Take further note that at the end of each URL there is an ID in the form of a GUID. I have noted a few below. Once you have determined there are no other options for removing the service application use the following command followed by the GUID.

Command: Stsadm -o deleteconfigurationobject -id %GUID%

Ex: Stsadm -o deleteconfigurationobject -id 19928d02-7ccb-44b5-9b3b-9ca1aa0130f0

Some example IDs

  • tsid=19928d02-7ccb-44b5-9b3b-9ca1aa0130f0
  • Id=178c598ac5kk405b9564a29b55fe2542
  • AppId=4beb5h7e-92bf-4f21-f859-d2e4b49457db
**Update**
You might unintentionally leave “orphaned” databases attached to your SharePoint farm using the above command. To fix, use PowerShell command “Get-SPDatabase” to get a listing of the database’s GUIDs. Then use the above stsadm command, to remove the orphaned database.
**Update**

 

**** I take no credit for this **** Please thank this person : http://blog.scoreman.net/2010/11/solution-to-missing-server-side-dependencies-8d6034c4-a416-e535-281a-6b714894e1aa/

Solution to: Missing server side dependencies 8d6034c4-a416-e535-281a-6b714894e1aa

The new Health Analyzer in SharePoint 2010 is great and you should always try to clean up all errors in this list. One error I had after installing the RTM version of SharePoint Server was:
[MissingWebPart] WebPart class [8d6034c4-a416-e535-281a-6b714894e1aa] is referenced [X] times in the database [...AdminContent...].
There are many suggested solutions to this problem on the internet (Accessing search administrationQuerying the databasesetup SharePoint Foundation Help Search and crawl help files)
What worked for me was accessing these search pages in the help-site-collection in Central Administration. (just ignore the error about missing list).
After that just reanalyze the issue in the Health Analyzer and hopefully it will dissapear.

 

Use case: Needed to understand the current security layout of a SharePoint site that was migrated from 2007 to 2010. The customer didn’t know what permissions were set where. They needed a way to report on how each site was granting or restricting permissions.

*Notes:

  • I’m not disposing of any objects. Sure I understand this is bad, but the intention of this script is to be run one time in a test environment. So if you plan on running this in production, I would suggest adding the dispose objects.
  • Script is set to put the raw xml file at the C:\, you change this in the .ps1 file.
  • Runs against all web applications in farm minus central admin.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
$logfilepath = "C:\"
 
##Create Table - ScanTable
$ScanTable = New-Object system.Data.DataTable "ScanTable"
$col1 = New-Object system.Data.DataColumn ("URL", [string])
$col2 = New-Object system.Data.DataColumn ("Member", [string])
$col3 = New-Object system.Data.DataColumn ("BasePermissions", [string])
$col4 = New-Object system.Data.DataColumn ("PermFriendlyName", [string])
$col5 = New-Object system.Data.DataColumn ("User_Group", [string])
$ScanTable.columns.add($col1)
$ScanTable.columns.add($col2)
$ScanTable.columns.add($col3)
$ScanTable.columns.add($col4)
$ScanTable.columns.add($col5)
 
$PermLevels = @{}
 
function getsec
{
	Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue
 
	$PortalName = Get-SPWebApplication | select DisplayName
	foreach ($p in $PortalName)
	{
		$webapp = Get-SPWebApplication | ? {$_.DisplayName -eq $p.Displayname}
		#$webapp = Get-SPWebApplication | ? {$_.DisplayName -eq "SharePoint"}
		foreach ($s in $webapp.Sites)
		{
			foreach ($web in $s.AllWebs)
			{
				foreach ($r in $web.roles)
				{
					$permpermmask = $r.PermissionMask
					$permname = $r.Name
					$PermLevels.Add("$permpermmask", "$permname")
					trap [Exception] {continue;}
				}
				$red = $web.HasUniqueRoleDefinitions
				foreach ($perm in $web.Permissions)
				{
					#$perm | select *
					#$perm.PermissionMask
					$permpermmaskcurrent = $perm.PermissionMask
					$level = $PermLevels.Get_Item("$permpermmaskcurrent")
					if ($perm.xml -like "*GroupName*")
					{
						$usergroup = "SharePoint Group"
					}
					if ($perm.xml -like "*UserLogin*")
					{
						$usergroup = "AD User"
					}
					$MemberIsADGroup = $perm.Member.IsDomainGroup
					if ($MemberIsADGroup -eq $true)
					{
						$usergroup = "AD Group"
					}
					$output = $ScanTable.Rows.Add($web.url, $perm.Member, $perm.BasePermissions, $level, $usergroup)
				}
			}
		}
	}
	$ScanTable.WriteXML("$logfilepath\SecurityReport.xml")
}
getsec

Adding FAST Search to an existing SharePoint 2010 farm, you may notice that your existing site collections do not have “keywords, site promotion and demotion, user context” functions in the site collection administration section. Well there is a good reason for that…. The feature that activates these functions is not enabled. The feature ID is “5EAC763D-FBF5-4d6f-A76B-EDED7DD7B0A5″ . I had seen this behavior in my development environment but never tried to understand why. I would just create a new site collection and boom everything was back to normal. J A quick Google search found this blog. http://www.neilrichards.net/blog/?p=149  so thanks NEIL! 

Before

After

The only credit I can take is the PowerShell code below that enumerates through all the web applications and their site collections and activates the feature. Thanks

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Start-SPAssignment -Global
$red = Get-SPWebApplication
foreach ($r in $red)
{
	$rtrim = $r.url
	$rurl = $rtrim.trim("/")
	$rurl
	$blue = Get-SPSite "$rurl(|)" -Limit All -regex
	Foreach ($b in $blue)
	{
		$b.url
		$siteWithNoFastFeatures = get-SPSite $b.url
		$siteWithNoFastFeatures.Features.Add("5EAC763D-FBF5-4d6f-A76B-EDED7DD7B0A5")
	}
}
Stop-SPAssignment -Global

As promised, attached to this post is the PowerPoint used at the Colorado SharePoint User Group meeting on April 21, 2010. For more info on the Colorado SharePoint User Group or for upcoming meetings please go to http://www.cospug.com .

Session abstract:

This session will focuses on Out-Of-Box features and functions, pertinent terminology, and a demonstration & walkthrough using SharePoint designer to connect to a SQL database. The walkthrough will cover managed and crawled  properties, the secure store, and custom refiners, allowing a SharePoint administrator the tools and knowhow to implement FAST of SharePoint 2010.

Items covered in PowerPoint:

Create Secure Store Application
• Set Permissions
• Enter Credentials
• Confirm SQL Permissions
• Create External Content Type in SharePoint Designer
• Create External Data Source
• Create External Content Operations
• Read Item
• Read List

Configure BCS
• Set Permissions
• Create Profile pages

Create Custom List in Site Collection
• View List

Add Content Source to FAST Content SSA
• Add Line of business content source
• Run Full Crawl
• Configure Managed Properties
• Link Crawled Properties to managed properties
• Create Additional Managed Properties
• Run Full Crawl
• Edit Refiner Web Part
• Edit and Add Custom Refiner XML

Search!

Please leave me a comment if you have any questions. Thanks

http://blog.isaacblum.com/wp-content/uploads/2011/04/FASTforSharePointCapabilities_COSPUG_RBA.pdf

The SharePoint Diagnostics Studio gathers and consolidates Event and Diagnostic (ULS) logs in addition to information from the Usage database and presents it through a graphical user interface supporting clarity and a single view into issues impacting a deployment.

The SharePoint Diagnostics Studio provides a wide variety of reports intended to address the most common issues impacting capacity, performance, availability, and usage that can be used independently or together to identify and isolate issues occurring in a SharePoint environment.

If you ever forget to run the product and technology wizard ( disconnect) then uninstall SharePoint, you will run into issues when you attempt to create a new farm or join a different farm.

Open Regedit then navigate to this registry section, then delete the “ dsn” string.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\Secure\ConfigDB

p.s. I highly recommend you attempt this step only in a last resort. You should always follow this uninstallation guidance from MS. http://technet.microsoft.com/en-us/library/cc262874.aspx

If you are trying to run this command in powershell : New-SPConfigurationDatabase  

You might encounter an error similar to the below… If you’re like me, you install all the necessary software for your farm first, then run the products and technology wizard / configure the farm. If you use the GUI, I have never encountered errors, however via PowerShell i did receive the errors below. As soon as i uninstalled the “Office Web Apps” the error went away. Thanks! Let me know if you have any questions. 

New-SPConfigurationDatabase : The pipeline has been stopped. 

At C:Usersadministrator.GENDesktopAutoSPInstallerSP2010AutoSPInstallerAutoSPInstaller.ps1:576 char:31 

+             New-SPConfigurationDatabase <<<<  –DatabaseName “$ConfigDB” –DatabaseServer “$DBServer” –AdministrationContentDatabaseName “$CentralAdminContentDB” –Passphrase $SecPhrase –FarmCredentials $Cred_Farm 

    + CategoryInfo          : InvalidData: (Microsoft.Share…urationDatabase:SPCmdletNewSPConfigurationDatabase) [New-SPConfigurationDatabase], PipelineStoppedException 

    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletNewSPConfigurationDatabase 

Microsoft.SharePoint.SPException: This SharePoint farm currently has pending upgrades.  The cmdlet New-SPConfigurationDatabase cannot be executed until the upgrade is completed. 

   at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord) 

This SharePoint farm currently has pending upgrades.  The cmdlet New-SPConfigurationDatabase cannot be executed until the upgrade is completed. 

At C:Usersadministrator.GENDesktopAutoSPInstallerSP2010AutoSPInstallerAutoSPInstaller.ps1:576 char:31 

+                                             New-SPConfigurationDatabase <<<<  –DatabaseName “$ConfigDB” –DatabaseServer “$DBServer” –AdministrationContentDatabaseName “$CentralAdminContentDB” –Passphrase $SecPhrase –FarmCredentials $Cred_Farm 

    + CategoryInfo          : InvalidOperation: (:) [New-SPConfigurationDatabase], SPException 

    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletNewSPConfigurationDatabase 

  • Archives

  • Tags

  • Subscribe
  • Pages

  • More

  • Disclaimer…

    This is my personal weblog. The opinions expressed herein are my own and are not representative of any 3rd party influence. The owner of this blog reserves the right to edit or delete any comments submitted to this blog without notice if they are deemed to be spam, offensive or otherwise inappropriate. The owner of this blog makes no representations as to the accuracy or completeness of any information on this site or found by following any link on this site. The owner will not be liable for any errors or omissions in this information nor for the availability of this information. The owner will not be liable for any losses, injuries, or damages from the display or use of this information.


    Lastly, I do my best to document my sources if the article is not of my own creation. If I have missed or forgotten to source your work. I would love feedback via the comments section. Thank you.

DreamHost promos
SiteLock