Wednesday, September 21, 2011

Create WebApplication

$webappname = "myAutomatedWebApp"
$username = "domain\user"
$password = "Pa$$word"
$hostheader = "hostheader"
$port = 80


$content_db_name = "WSS_Content_"+$hostheader
$AppPool = "AppPool" + $webappname
$url="http://"+$hostheader
co
$secpass = convertto-securestring $password -asplaintext -force
$cred = new-object -typeName System.Management.Automation.PsCredential -argumentlist $username,$secpass

new-spmanagedaccount -Credential $cred

new-spwebapplication -name $webappname -port $port -hostheader $hostheader -URL $url -ApplicationPool $AppPool -ApplicationPoolAccount (Get-SPManagedAccount $username) -DatabaseName $content_db_name

No comments:

Post a Comment