2012-05-10 3 views
2

Je viens de commencer à travailler avec SharePoint 2010 (vous pourriez dire un peu tardif!) J'ai créé une liste via l'interface graphique comme je le ferais normalement avec SharePoint 2007. Je voudrais puis utilisez Gary la pointe stsadm extensions pour extraire les champs XML et les placer dans une fonctionnalité dans Visual Studio.SharePoint 2010 Exportation des champs de site dans un fichier XML

Je me demandais si cela pouvait encore être fait! Je ne trouve pas la commande gl-Exportsitecolumns dans les commandes stsadm 2010!

Existe-t-il une alternative PowerShell?

Toute aide ou conseil serait grandement apprécié.

Vive Truez

Répondre

2

Je ne sais pas comme alternative Powershell. MAIS solution très facile peut être ce morceau de code:

$w = Get-SPWeb http://localhost/subweb 
$w.Fields | select SchemaXml # option 1: prints all xml to console 
$w.Fields | select schemaxmlwithresourcetokens # option 2: the same, but with resource tokens 
$w.Fields | %{ $_.schemaxml } | out-file c:\temp\fields.xml -encoding unicode #option 3: saves output to text file 
+0

Cheers! Fonctionne un régal :) – Truezplaya

1

L'alternative à powershell se trouve ici: export-and-importcreate-site-content.html par Phil Childs

$sourceWeb = Get-SPWeb http://portal 
$xmlFilePath = "C:\Install\Script-SiteContentTypes.xml" 

#Create Export File 
New-Item $xmlFilePath -type file -force 

#Export Content Types to XML file 
Add-Content $xmlFilePath "<?xml version=`"1.0`" encoding=`"utf-8`"?>" 
Add-Content $xmlFilePath "`n<ContentTypes>" 
$sourceWeb.ContentTypes | ForEach-Object { 
    if ($_.Group -eq "Custom Content Types") { 
     Add-Content $xmlFilePath $_.SchemaXml 
    } 
} 
Add-Content $xmlFilePath "</ContentTypes>" 

$sourceWeb.Dispose() 
Questions connexes