manual
39 www.microsoft.com/sharepoint
foreach ($site in (get-spsite -limit 5000000 -Webapplication $WebApp))
{ Write-Host "Activating feature " $solutionName "on" $site.url "...";
Write-Host stsadm "-o activatefeature -url" $site.url "-filename"
$featureFileName;
stsadm -o activatefeature -url $site.url -filename $featureFileName
if( $lastexitcode -ne 0 )
{ Write-Host "Something went wrong activating the site feature. Exit
code: " $lastexitcode "`n" -ForegroundColor Red;
$failure = $true;
$error.Clear();
}
}
When she ran the script in her test environment, she found it took more than 12 hours
to run. Nicole then decided to look for a better way of doing things. After talking to
Grant, she found out there was built-in cmdlet to do this exact task. She then tried this
script:
Get-SPSite –Limit ALL –WebApplication $WebAppNameorUrl |%{ Enable-SPFeature
$FeatureIdOrName –url $_.Url }
The script ran in less than one hour. Lesson learned: If Stsadm.exe can do the operation,
Windows PowerShell can do it too, and generally more efficiently.
Managed Accounts
To reduce the load of managing various service accounts in Microsoft® SharePoint®
Server 2010, the concept of managed accounts has been introduced. Much like
managed accounts in Windows Server® 2008, they allow SharePoint Server to take
control of all the service accounts you use. After SharePoint Server has control of these
accounts, it can either manage their passwords — automatically changing them as
necessary — or it can notify you when an accounts password is about to expire, allowing