Tuesday, September 16, 2008

Import Export SiteCollection using STSADM

Export:


stsadm -o export -url http://localhost/sites/recovery -filename recovery.export -versions 4 -includeusersecurity
Create Site Collection:
Create a site collection because IMPORT command doesn't create a new site collection
stsadm -o createsite -url http://localhost/sites/recovery_copy -owneremail administrator@company.com -ownerlogin domain\administrator -sitetemplate STS#1
Import:
stsadm -o import -url http://localhost/sites/recovery_copy -filename recovery.export -includeusersecurity
Note :
Please note import / export is only used to backup/restore a sub-web ( SPWeb ). For backup/restore of site collection you will need Backup / Restore commands from STSADM or Powershell

Creating multiple sites/webs using STSADM

CreateSites.bat

for /f "skip=1 tokens=1-4" %%a in (sites.txt) do @stsadm -o createsite -url http://server/sites/%%a -sitetemplate STS#1 -owneremail %%b -ownerlogin %%c -title %%d

for /f "skip=1 tokens=1-4" %%a in (webs.txt) do @stsadm -o createweb -url http://server/%%a -sitetemplate STS#1 -title %%d

pause
sites.txt
URL OwnersEmail OwnerLogin Title
Site01 administrator@company.com administrator SiteNo1
Site02 administrator@company.com administrator SiteNo2
Site03 administrator@company.com administrator SiteNo3
Site04 administrator@company.com administrator SiteNo4
Webs.txt
URL Title
Web01 WebName1
Web02 WebName2
Web03 WebName3
Web04 WebName4
Article:
http://www.robvanderwoude.com/ntfortokens.html
http://www.geocities.com/rick_lively/MANUALS/COMMANDS/F/FOR_F.HTM

Monday, September 15, 2008

Verify and Upload Form Template from Command line


stsadm –o verifyformtemplate –filename path\filename

stsadm –o uploadformtemplate –filename path\filename
Article:
http://technet.microsoft.com/en-us/library/cc262921.aspx

Friday, September 12, 2008

Learn SharePoint

I think this is the most common question I get from anyone who is new to Sharepoint.
Here's my favorites. Also one strong recommendation from my side is , dont buy 10 books and dont read 100 blogs .. trust me you will be most lost. Focus on reading SDK , its awesome and just buy one good book which you can read on the way to work in Metro

:-)

Video's

MSDN
Sharepoint Videos
Watch and Learn Training
Sharepoint Community

SDK's
http://msdn.microsoft.com/en-us/library/bb931736.aspx ( MOSS )
http://msdn.microsoft.com/en-us/library/bb931737.aspx ( WSS )

Training Material
Training Wssdemo

VHD's
www.microsoft.com/vhd

Books
<<<----- My recommendations you can see on left side.

Automate SharePoint

STSADM Custom Extensions
Automating SharePoint 2007 Configurations via STSADM Custom Extensions
http://stsadm.blogspot.com/2007/08/stsadm-commands_09.html

SharePoint PowerShell Scripts
A must have!
http://www.codeplex.com/iLoveSharePoint

Debug SharePoint

SharePoint Portal Server Support Report Tool (SPSReport)
The SPS Reporting Tool is utilized to gather detailed information regarding a systems current configuration. The data collected will assist the Microsoft Support Professional with fault isolation. The reporting tool DOES NOT make any registry changes or modifications to the operating system.
http://www.codeplex.com/spsreport/Release/ProjectReleases.aspx?ReleaseId=5706

WinDbg
http://www.microsoft.com/whdc/devtools/debugging/install64bit.mspx

Fiddler
HTTP traffic monitors for IE
http://www.fiddler2.com/fiddler2/

Live HTTP Headers 0.14
HTTP traffic monitors for FireFox
https://addons.mozilla.org/en-US/firefox/addon/3829

SharePoint SUSHI
http://www.codeplex.com/sushi

Logging Solution ( Multiple options )
http://hristopavlov.wordpress.com/sptraceview/
http://www.codeplex.com/wssmosslogfilereader/

SpsDev.Com ULS Log Reader
http://www.spsdev.com/ulsreader.aspx

SharePoint Log Viewer
http://www.codeplex.com/SPLogViewer

SharePoint Logging Spy
http://www.codeplex.com/sharepointloggingspy

Business Data Catalog Sample File

<LobSystem
Type="Database"
Version="1.0.0.01"
Name="AdventureWorks"
xmlns="http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog">


<AccessControlList>
<AccessControlEntry Principal="domain\you">
<Right BdcRight="Execute"/>
<Right BdcRight="Edit"/>
<Right BdcRight="SetPermissions"/>
<Right BdcRight="SelectableInClients"/>
</AccessControlEntry>
<AccessControlEntry Principal="domain\BDCUsers">
<Right BdcRight="Execute"/>
<Right BdcRight="SelectableInClients"/>
</AccessControlEntry>
</AccessControlList>


<LobSystemInstances>
<LobSystemInstance Name="AdventureWorksDB">
<Properties>
<Property Name="AuthenticationMode" Type="System.String">PassThrough</Property>
<Property Name="DatabaseAccessProvider" Type="System.String">SqlServer</Property>
<Property Name="RdbConnection Data Source" Type="System.String">SQLServerMachineName</Property>
<Property Name="RdbConnection Initial Catalog" Type="System.String">AdventureWorks</Property>
<Property Name="RdbConnection Integrated Security" Type="System.String">SSPI</Property>
</Properties>
</LobSystemInstance>
</LobSystemInstances>

<Entities>
<Entity Name="Customer">

<Properties>
<Property Name="Title" Type="System.String">Name</Property>
</Properties>

<Identifiers>
<Identifier Name="CustomerID" TypeName="System.Int32"/>
</Identifiers>


<Methods>
<Method Name ="GetCustomers">
<Properties>
<Property Name="RdbCommandText" Type="System.String">
SELECT CustomerID,LastName + ', ' + FirstName as Name,Phone, EmailAddress
FROM Sales
</Property>

<Property Name="RdbCommandType" Type="System.String">Text</Property>
</Properties>

<Parameters>
<Parameter Direction="Return" Name="Customers">
<TypeDescriptor TypeName="System.Data.IDataReader, System.Data, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" IsCollection="true" Name="CustomerDataReader">
<TypeDescriptors>
<TypeDescriptor TypeName="System.Data.IDataRecord, System.Data,Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Name="CustomerDataRecord">
<TypeDescriptors>
<TypeDescriptor TypeName="System.Int32" IdentifierName="CustomerID" Name="customerID" />
<TypeDescriptor TypeName="System.String" Name="Name" />
<TypeDescriptor TypeName="System.String" Name="Phone" />
<TypeDescriptor TypeName="System.String" Name="EmailAddress" />
</TypeDescriptors>
</TypeDescriptor>
</TypeDescriptors>
</TypeDescriptor>
</Parameter>
</Parameters>

<MethodInstances>
<MethodInstance
Name="CustomerFinderInstance" Type="Finder" ReturnParameterName="Customers" ReturnTypeDescriptorName="CustomerDataReader" />

</MethodInstances>

</Method>
</Methods>
</Entity>
</Entities>

</LobSystem>
Articles:
http://msdn.microsoft.com/en-us/office/bb251754.aspx