Thursday, September 24, 2015

Better explanation than Technet about Export-SPWeb

technet site for Export-SPWeb :  https://technet.microsoft.com/en-us/library/ee428301.aspx

this site look like not so helpful for me to export the list ...

i prefer this more detail site explanation :

http://blog.blksthl.com/2013/09/05/export-a-document-library-using-export-spweb-and-itemurl/

===========================================================================================

Export-SPWeb
(This is my better version of the TechNet articles on the same CMDlet that does a poor job with the details, I hope that it will help some of you)
SharePoint 2010 | SharePoint 2013
Applies to:  SharePoint Foundation 2010 | SharePoint Server 2010 | SharePoint Foundation 2013 | SharePoint Server 2013 
Exports a site, list, or library.

Export-SPWeb [-Identity]  -Path  [-AssignmentCollection ] [-CompressionSize ] [-Confirm []] [-Force ] [-HaltOnError ] [-HaltOnWarning ] [-IncludeUserSecurity ] [-IncludeVersions [-ItemUrl ] [-NoFileCompression ] [-NoLogFile ] [-UseSqlSnapshot ] [-WhatIf []]
——————–EXAMPLE———————–
Export-SPWeb http://site –Path "c:\temp\site export.cmp" -ItemURL "/subsite/documents"
This example exports the document library at http://site/subsite/documents to a new file called ‘site export.cmp' in the ‘C:\temp’ directory.

Wednesday, September 2, 2015

powershell copy folder to remote computer

$ServerName = Get-Content "C:\Users\nspuum\Desktop\Computers.txt"


foreach ($Server in $ServerName) {

$server

New-Item -ItemType directory -Path "\\$server\d$\software\SP2010 SP2\SP2 LP"

Copy-Item  "D:\software\SP2010 SP2\SP2 LP\*"  "\\$Server\d$\software\SP2010 SP2\SP2 LP" -Recurse -force



}