A query to retrieve form data cannot be completed because this action would violate cross-domain restrictions.

Using InfoPath to retrieve data from SQL Server, I received this error:
A query to retrieve form data cannot be completed because this action would violate cross-domain restrictions.

Fix:
Update the InfoPath Form Services settings in Central Admin
Central Admin –> General Application Settings –> Configure InfoPath Form Services
Cross-Domain Access for User Form Templates

http://CA-ADDRESS/_admin/ipfsConfig.aspx

Server 2012 Install the .NET 3.5 Framework Feature – The source files could not be found

Was trying to enable the .NET 3.5 Framework Feature on Windows Server 2012.

Received this error:
The source files could not be found
or
The request to add or remove features on the specified server failed. ……..

I tried the command line idea, PowerShell, and copying the files from the install media.
All failed.

The issue??
No internet connection!

If you hit all the wall I did, try connecting the box / VM to the web.

Search Topology Not Responding

If one of the servers in your Search Application Topology is showing a Status of Not Responding, try and restart service app for the server in question.

One of my Crawl Components was not responding, but the server was online and working.  The script below helped to re-sync the server.

-identity “Search Service Application

Replace Search Service Application with the name of your Search App.


$SearchApp = Get-SPEnterpriseSearchServiceApplication -identity "Search Service Application"

$SearchApp | Get-SPEnterpriseSearchQueryTopology | Get-SPEnterpriseSearchQueryComponent | Where-Object {$_.ServerName -eq 'Server Name That is Stuck'}  | Restart-SPEnterpriseSearchQueryComponent

Use PowerShell to Compare Two SharePoint Lists

What if, for some random reason you wanted to compare two SharePoint Lists or Libraries and find the differences.

For the setup, I created two Lists (A and B).  I then added a few items to the Lists. Notice, that List A has two extra items, 6 and 7.

     

 


$mSite = Get-SPweb "http://sharepointed.com/site/taco"
$aList = $mSite.lists["A"]
$bList = $mSite.lists["B"]

$arrA = @()
$arrB = @()

foreach($iA in $aList.Items)
{
 $arrA += $iA["Title"]
}

foreach($iB in $bList.Items)
{
 $arrB += $iB["Title"]
}

$c = Compare-Object -ReferenceObject $arrA -DifferenceObject $arrB -PassThru
Write-Host $c

Output of the above script is: 6 7

More about the Compare-Object cmdlet:

http://technet.microsoft.com/en-us/library/ee156812.aspx

 

STSADM Access Denied Server 2003

Recently was tasked with updating passwords on an older SharePoint 2007 farm.  The fun part, Windows Server 2003 was the host OS.   I hit a wall right out of the gate when I tried to run my STSADM command.

STSADM.EXE -o updatefarmcredentials -identitytype configurableid -userlogin “domain\SP_Admin” -password Cool@Password

Error: Access Denied

What the $#%##, I know I have full access to the farm and databases.

In Windows Server 2003, to launch the command prompt, right-click and select Run As.  THEN, un-check Run this program with restricted access.  Now run the STSADM command again.

 

InfoPath Operation could not be completed

When trying to move an InfoPath from Prod to Test, I ran into a small problem.

Once I got to the point of needing to update my data connections, I received this error:

Operation could not be completed

The amount of detail is overwhelming!

The url for my test site was http://sharepoint:1200/sites/blah

After creating a new web app and having the network guys create a new DNS entry, the error went away.

The new url is http://test.sharepoint.com/sites/blah

Updated my data connections, no more error!

 

create a list of groups and the users in each group

As we all know, digging through SharePoint groups looking to see what users are in each, is no fun.

To solve this, I created a new List, and added the groups I wanted to monitor.  Then, added a little PowerShell to update a column in the List with the members in each group.

Setup:

Create a new List.

New Columns:

SPgroup 

Type: Person or Group

Allow selection of: People or Group

Users

Type: Multiple lines of text

Specify the type of text to allow: 

Update Column:

Title

Require that this column contains information: No

The PowerShell script below does the following:

Get the SharePoint Site and List.

Loop through each item in the List.

Retrieve the value of the SPgroup field.

Truncate the Users field.

Loop through the users in the SPgroup.

Update the Users field with the values from SPgroup.


if(-not(Get-PSSnapin | where { $_.Name -eq "Microsoft.SharePoint.PowerShell"}))
{
      Add-PSSnapin Microsoft.SharePoint.PowerShell;
}

$sSite = Get-SPweb "http://reinmoto.com/sites/taco"
$sList=$sSite.Lists["SP Group Permissions"]
$i = 0

foreach($item in $sList.Items)
{
	$sFieldValue = $item["SPgroup"].ToString().Split('#')[1]
	$sGroup = $sSite.SiteGroups[$sFieldValue]

	If($sGroup.Users.Count -ge 0)
	{
		$item["Users"] = ""
		$item.Update()

		foreach($usr in $sGroup.Users)
			{
				if($i -eq 0)
				{
					$item["Users"] = $usr.DisplayName
				}
				else
				{
					$item["Users"] = $item["Users"] + ", " + $usr.DisplayName
				}
				$item.Update()
				$i=$i+1
			}
		$i=0
	}
}
$sSite.dispose()

Save the PowerShell script to your server.

Create a scheduled task to run the script hourly, daily, weekly, monthly…

Export a list of all sites in a Site Collection

How do you use PowerShell to export a list of all the sites in a Site Collection?


if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) {
 Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}

$site = Get-SPSite "http://reinmoto.com/customers"

foreach($s in $site.AllWebs)
 {
 Write-Host $s.title
 Add-Content -Path "C:\file.txt" -Value $s.URL
 $s.Dispose()
 }

User Cannot Access a Site

Scenario:

User works in the office for a few weeks, then leaves.

Same user returns a year later.

The user account was never removed from SharePoint, but the user was unable to access sites, where permissions were directly granted.  Sites were Domain Users was implemented, the user could access sites.

On sites where the user was granted direct permissions, they would get the Error: Access Denied message box.

Fix?

Remove the user account and re-add it.

 

 

crawl component cannot be dismounted sharepoint

Was trying to modify the Search Service Topology and ran into a few errors.

Crawl component cannot be dismounted SharePoint

Search Application Topology Status stuck in Recovering

Both errors were cleared up by running the SharePoint Configuration Wizard on the server in question.

Some other errors that occured:

Retry of query component 0e5ab760-3fa2-462f-99a5-aab5c7655dad-query-7 has failed with error: The system cannot find the file specified.
0x80070002. It will be retried again in 64 seconds.

Query component 0e5ab760-3fa2-462f-99a5-aab5c7655dad-query-7 has been taken out of rotation due to this error: The system cannot find the file specified.
0x80070002. It will be retried in 4 seconds.