0

I cannot export a library.

This is the command I execute:

Export-SPWeb -Identity $sourceUrl -Path $filecmp -ItemUrl "Documenti Condivisi" -Verbose -UseSqlSnapshot -Force

with the following output:

Export-SPWeb : Object reference not set to an instance of an object.
At C:\temp\getlistatit.ps1:46 char:1
+ Export-SPWeb -Identity $sourceUrl -Path $filecmp -ItemUrl "Documenti
Condivisi"  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
    + CategoryInfo          : InvalidData: (Microsoft.Share...CmdletExportWeb:
   SPCmdletExportWeb) [Export-SPWeb], NullReferenceException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletExportWe
   b

VERBOSE: Leaving ProcessRecord Method of Export-SPWeb.
VERBOSE: Leaving EndProcessing Method of Export-SPWeb.

And this comes from the log:

/04/2016 12.58.55] [Folder] [Documenti condivisi]   Error: Object reference not set to an instance of an object.
[19/04/2016 12.58.55] [Folder] [Documenti condivisi]   Debug:    at Microsoft.SharePoint.Deployment.ExportObjectManager.GetUserByLogin(String loginName)
   at Microsoft.SharePoint.Deployment.FolderSerializer.GetUserFromMetaInfo(MetaInfoProperty mip, ExportObjectManager objectManager)
   at Microsoft.SharePoint.Deployment.FolderSerializer.GetMetaInfo(Object metaInfoObject, SPWeb parentWeb, SerializationInfo info, ExportObjectManager objectManager)
   at Microsoft.SharePoint.Deployment.FolderSerializer.GetDataFromDataSet(Object obj, SerializationInfo info, StreamingContext context)
   at Microsoft.SharePoint.Deployment.DeploymentSerializationSurrogate.GetObjectData(Object obj, SerializationInfo info, StreamingContext context)
   at Microsoft.SharePoint.Deployment.XmlFormatter.SerializeObject(Object obj, ISerializationSurrogate surrogate, String elementName, Boolean bNeedEnvelope)
[19/04/2016 12.58.55] FatalError: Object reference not set to an instance of an object.
[19/04/2016 12.58.55] Debug:    at Microsoft.SharePoint.Deployment.ExportObjectManager.GetUserByLogin(String loginName)
   at Microsoft.SharePoint.Deployment.FolderSerializer.GetUserFromMetaInfo(MetaInfoProperty mip, ExportObjectManager objectManager)
   at Microsoft.SharePoint.Deployment.FolderSerializer.GetMetaInfo(Object metaInfoObject, SPWeb parentWeb, SerializationInfo info, ExportObjectManager objectManager)
   at Microsoft.SharePoint.Deployment.FolderSerializer.GetDataFromDataSet(Object obj, SerializationInfo info, StreamingContext context)
   at Microsoft.SharePoint.Deployment.DeploymentSerializationSurrogate.GetObjectData(Object obj, SerializationInfo info, StreamingContext context)
   at Microsoft.SharePoint.Deployment.XmlFormatter.SerializeObject(Object obj, ISerializationSurrogate surrogate, String elementName, Boolean bNeedEnvelope)
   at Microsoft.SharePoint.Deployment.XmlFormatter.Serialize(Stream serializationStream, Object topLevelObject)
   at Microsoft.SharePoint.Deployment.SPExport.SerializeObjects()
   at Microsoft.SharePoint.Deployment.SPExport.Run()
[19/04/2016 12.58.55] Progress: Export did not complete.

I had a similar problem in this post. It's probably related even if I was doing another operation.

I have tried to see if there are any orphaned items but

$db.Repair($false)

gives:

<OrphanedObjects Count="0" />

Have you got any suggestion on how to solve it?

EDIT: Export of an empty template also fails. It gives me this error :

SPSecurityContext: Could not retrieve a valid windows identity for username 'MYDAOMAIN\MYUSER' with UPN 'myemail@mydomain'. UPN is required when Kerberos constrained delegation is used. Exception: System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: WTS0003: The caller is not authorized to access the service. (Fault Detail is equal to An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is: System.UnauthorizedAccessException: WTS0003: The caller is not authorized to access the service.   
 at Microsoft.IdentityModel.WindowsTokenService.CallerSecurity.CheckCaller(WindowsIdentity callerIdentity)    
 at Microsoft.IdentityModel.WindowsTokenService.S4UServiceContract.PerformLogon(Func`1 logonOperation, Int32 pid)    
 at SyncInvokeUpnLogon(Object , Object[] , Object[] )    
 at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)    
 at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)    
 at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)    
 at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)    
 at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet))..

I have to add that the library is beyond every reasonable limit (1200000 files).

  • ItemUrl - Specifies the URL of the Web application, GUID, or object to be exported. The type must be a valid URL. technet.microsoft.com/en-us/library/ff607895.aspx – Sergey B. Hizof Apr 19 '16 at 11:35
  • 1
    @Sergey B. Hizof You can even use a relative path as I did; Check this out: books.google.it/… – Gyonder Apr 19 '16 at 12:27
  • one test, i want to do...can you try to documentlib save as template...with and without content... – Waqas Sarwar MVP Apr 19 '16 at 14:45
  • @Waqas Sarwar MCSE tried export of template without content. Read edit content in case it gives you some insight. – Gyonder Apr 19 '16 at 15:23
  • looks like your Doc Library having the issue...who is the user? – Waqas Sarwar MVP Apr 19 '16 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.