I've tried to add another web app to the current farm. I ran the last recommended version and the script aborted while running through the 3rd web app (of 5 total). The error message is at the end of this post. I've checked the code and found the problem. This error only occurs if "some" site collections are already created. The script is calling Get-SPSite without any params and it is filtering the result that came back for the URL. In a typical fresh installation at this point there are only a few site collections in place. In my environment we hit the default limit Get-SPSite returns. We need to modify the lines to add a parameter " -Limit ALL" for all Get-SPSite calls (also in future versions). Another workaround would be to use Get-SPSite –Identity <URL> and see if the returned value is $null.
http://autospinstaller.codeplex.com/SourceControl/changeset/view/91143#1713919
-> Line: 1618
$GetSPSiteCollection = Get-SPSite | Where-Object {$_.Url -eq $SiteURL}
to
$GetSPSiteCollection = Get-SPSite -Limit ALL | Where-Object {$_.Url -eq $SiteURL}
-> Line: 1940
If (!(Get-SPSite | Where-Object {(($_.Url -like "$MySiteURL*") -and ($_.Port -eq "$MySitePort"))}))
to
If (!(Get-SPSite -Limit ALL | Where-Object {(($_.Url -like "$MySiteURL*") -and ($_.Port -eq "$MySitePort"))}))
Exception : System.ArgumentException: Another site already exists a
t http://WEBURL.COMPANY.com. Delete this si
te before attempting to create a new site with the same
URL, choose a new URL, or create a new inclusion at th
e path you originally specified. ---> Microsoft.SharePo
int.SPException: Another site already exists at http://
WEBURL.COMPANY.com. Delete this site before
attempting to create a new site with the same URL, cho
ose a new URL, or create a new inclusion at the path yo
u originally specified.
--- End of inner exception stack trace ---
at Microsoft.SharePoint.Administration.SPConfigurati
onDatabase.CreateSite(SPWebApplication application, SPC
ontentDatabase database, String originalPath, Guid id,
Guid siteSubscriptionId, Boolean useHostHeaderAsSiteNam
e, Boolean bDeleted, DateTime deletionTime)
at Microsoft.SharePoint.Administration.SPConfigurati
onDatabase.CreateSite(SPWebApplication application, SPC
ontentDatabase database, String path, Boolean useHostHe
aderAsSiteName)
at Microsoft.SharePoint.Administration.SPSiteCollect
ion.Add(SPContentDatabase database, SPSiteSubscription
siteSubscription, String siteUrl, String title, String
description, UInt32 nLCID, String webTemplate, String o
wnerLogin, String ownerName, String ownerEmail, String
secondaryContactLogin, String secondaryContactName, Str
ing secondaryContactEmail, String quotaTemplate, String
sscRootWebUrl, Boolean useHostHeaderAsSiteName)
at Microsoft.SharePoint.PowerShell.SPCmdletNewSite.C
Comments: ** Comment from web user: GeekDotNet **
http://autospinstaller.codeplex.com/SourceControl/changeset/view/91143#1713919
-> Line: 1618
$GetSPSiteCollection = Get-SPSite | Where-Object {$_.Url -eq $SiteURL}
to
$GetSPSiteCollection = Get-SPSite -Limit ALL | Where-Object {$_.Url -eq $SiteURL}
-> Line: 1940
If (!(Get-SPSite | Where-Object {(($_.Url -like "$MySiteURL*") -and ($_.Port -eq "$MySitePort"))}))
to
If (!(Get-SPSite -Limit ALL | Where-Object {(($_.Url -like "$MySiteURL*") -and ($_.Port -eq "$MySitePort"))}))
Exception : System.ArgumentException: Another site already exists a
t http://WEBURL.COMPANY.com. Delete this si
te before attempting to create a new site with the same
URL, choose a new URL, or create a new inclusion at th
e path you originally specified. ---> Microsoft.SharePo
int.SPException: Another site already exists at http://
WEBURL.COMPANY.com. Delete this site before
attempting to create a new site with the same URL, cho
ose a new URL, or create a new inclusion at the path yo
u originally specified.
--- End of inner exception stack trace ---
at Microsoft.SharePoint.Administration.SPConfigurati
onDatabase.CreateSite(SPWebApplication application, SPC
ontentDatabase database, String originalPath, Guid id,
Guid siteSubscriptionId, Boolean useHostHeaderAsSiteNam
e, Boolean bDeleted, DateTime deletionTime)
at Microsoft.SharePoint.Administration.SPConfigurati
onDatabase.CreateSite(SPWebApplication application, SPC
ontentDatabase database, String path, Boolean useHostHe
aderAsSiteName)
at Microsoft.SharePoint.Administration.SPSiteCollect
ion.Add(SPContentDatabase database, SPSiteSubscription
siteSubscription, String siteUrl, String title, String
description, UInt32 nLCID, String webTemplate, String o
wnerLogin, String ownerName, String ownerEmail, String
secondaryContactLogin, String secondaryContactName, Str
ing secondaryContactEmail, String quotaTemplate, String
sscRootWebUrl, Boolean useHostHeaderAsSiteName)
at Microsoft.SharePoint.PowerShell.SPCmdletNewSite.C
Comments: ** Comment from web user: GeekDotNet **
Looks like this is fixed in the meantime. could be closed.