Posts Tagged ‘Power Shell’
$sourceWebUrl = $args[0]
$destWebUrl = $args[1]
$path = “c:\Sriram\Contents\”
$lists = @(“ideastream”, “Clients”)
foreach($list in $lists)
{
Write-Host (“Exporting ” + $sourceWebUrl + “/lists/” + $list)
export-spweb $sourceWebUrl -ItemUrl (“/lists/” + $list) -IncludeUserSecurity -IncludeVersions All -path ($path + $list + “.cmp”) -nologfile -force
“Exporting complete.”
Write-Host (“Importing ” + $destWebUrl + “/lists/” + $list)
import-spweb $destWebUrl -IncludeUserSecurity -path ($path + $list + “.cmp”) -nologfile
“Importing Complete”
}
$doclibs = @(“sitecollectionimages”)
foreach($doclib in $doclibs)
{
Write-Host (“Exporting ” + $sourceWebUrl + “/” + $doclib)
export-spweb $sourceWebUrl -ItemUrl (“/” + $doclib) -IncludeUserSecurity -IncludeVersions All -path ($path + $doclib + “.cmp”) -nologfile -force
“Exporting complete.”
Write-Host (“Importing ” + $destWebUrl + “/” + $doclib)
import-spweb $destWebUrl -IncludeUserSecurity -path ($path + $doclib + “.cmp”) -nologfile
“Importing Complete”
}
MOSS Enable Disable Claims Authentication on Existing Web Application using Powershell
Posted on: June 6, 2011
If we have a web application created and want to enable Claims authentication on the site, we can do it with a Power Shell command.
$objWeb = Get-SPWebApplication http://MyWebApp
$objWeb.UseClaimsAuthentication=1
$objWeb.Update()
Now you can goto the Zone settings of the Web Application via Central Administration and can configure Membership provider and Role provider by enabling FBA on the site.
Set the UseClaimsAuthentication to zero if if needs to be disabled.