run script on second server

Feb 15, 2011 at 3:21 PM
Edited Feb 15, 2011 at 3:22 PM

When I run the script on second server, I set <CentralAdmin Provision="False"> AutoSPInstallInput.xml file. But I still got the following error,

New-SPSite : Cannot find an SPWebApplication object that contains the following
 Name, Id, or Url: http://servername.
At D:\Software\SPS2010\AutoSPInstallerV2\AutoSPInstallerFunctions.ps1:1038 char
:66
+             If (($Template -ne $null) -and ($Template -ne "")) {New-SPSite <<
<<  -Url $SiteURL -OwnerAlias $OwnerAlias -SecondaryOwnerAlias $env:USERDOMAIN\
$env:USERNAME -ContentDatabase $database -Description $SiteCollName -Name $Site
CollName -Language $LCID -Template $Template | Out-Null}
    + CategoryInfo          : InvalidData: (Microsoft.Share...SPCmdletNewSite:
   SPCmdletNewSite) [New-SPSite], SPCmdletPipeBindException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletNewSite
 
 - Launching http://secondservername...
 - Setting up managed paths for "http://secondservername:80"
 - Setting up explicit managed path "search" at "http://secondservername:80"
 - Setting up explicit managed path "help" at "http://secondservername:80"
 - Deleting managed path "sites" at "http://secondservername:80"
 - Done setting up managed paths at "http://secondservername:80"
 - Applying object cache accounts to "http://secondservername:80"...
 - Done applying object cache accounts to "http://secondservername:80"
 - Web app "MySite Host" already provisioned.
 - Creating Site Collection "http://secondservername:8080"...
New-SPSite : Cannot find an SPWebApplication object that contains the following
 Name, Id, or Url: http://secondservername:8080.
At D:\Software\SPS2010\AutoSPInstallerV2\AutoSPInstallerFunctions.ps1:1038 char
:66
+             If (($Template -ne $null) -and ($Template -ne "")) {New-SPSite <<
<<  -Url $SiteURL -OwnerAlias $OwnerAlias -SecondaryOwnerAlias $env:USERDOMAIN\
$env:USERNAME -ContentDatabase $database -Description $SiteCollName -Name $Site
CollName -Language $LCID -Template $Template | Out-Null}
    + CategoryInfo          : InvalidData: (Microsoft.Share...SPCmdletNewSite:
   SPCmdletNewSite) [New-SPSite], SPCmdletPipeBindException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletNewSite

Should I delete the following section from AutoSPInstallInput.xml file when run the script on the second server? 

<WebApplications>
        <WebApplication type="Portal"
                        name="Connections Portal"
                        applicationPool="Connections_AppPool"
                        applicationPoolAccount="usrdom\sharepointadmin"
                        url="http://localhost"
                        port="80"
                        databaseName="ConnectionsContentDB"
                        useClaims="True">
            <ManagedPaths>
                <ManagedPath relativeUrl="search" explicit="true" />
                <ManagedPath relativeUrl="help" explicit="true" />
                <ManagedPath relativeUrl="sites" delete="true" />
            </ManagedPaths>
            <SiteCollections>
                <SiteCollection siteUrl="http://localhost"
                                owner="usrdom\sharepointadmin"
                                name="Connections Home"
                                description="Connections Portal Home Site"
                                SearchUrl="http://localhost/search"
                                CustomTemplate="false"
                                Template="SPSPORTAL#0"
                                LCID="1033">
                    <!--<UserSolutions>
            <UserSolution path=".\Solutions\PortalHomeSite.wsp" name="PortalHomeSite.wsp" />
          </UserSolutions>-->
                    <!--<Features>
            <Feature name="Portal.Branding_PortalHomeBranding" />
          </Features>-->
                </SiteCollection>
            </SiteCollections>
        </WebApplication>
        <WebApplication type="MySiteHost"
                        name="MySite Host"
                        applicationPool="MySite_AppPool"
                        applicationPoolAccount="usrdom\sharepointadmin"
                        url="http://localhost"
                        port="8080"
                        databaseName="MySites_Content"
                        useClaims="True">
            <SiteCollections>
                <SiteCollection siteUrl="http://localhost:8080"
                                owner="usrdom\sharepointadmin"
                                name="My Site Host"
                                description="My Site Host"
                                SearchUrl="http://localhost/search"
                                CustomTemplate="false"
                                Template="SPSMSITEHOST#0"
                                LCID="1033" />
            </SiteCollections>
            <ManagedPaths>
                <ManagedPath relativeUrl="personal" explicit="false"/>
                <ManagedPath relativeUrl="sites" delete="true" />
            </ManagedPaths>
        </WebApplication>
    </WebApplications>

Thanks in advance,

Peter

Coordinator
Feb 15, 2011 at 6:33 PM

Actually this seems to have nothing to do with Central Admin, rather you should put http://firstserver in the Input XML file wherever you now see http://localhost - or whatever the host part of the URL is for your Portal and My Site host. I believe the script is looking for web apps with the name of the second server, but there aren't any.

Brian

Feb 15, 2011 at 6:46 PM

OK. I removed the following section from AutoSPInstallInput.xml file when run the script on the second server, 

<WebApplications>
.........

</WebApplications>

The installation went through with one error.

The installation trys to open the configuration wizard on second server instead,

http://secondservername:2010/_admin/adminconfigintro.aspx?scenarioid=adminconfig&welcomestringid=farmconfigurationwizard_welcome 

the correct url should be

http://firstservername:2010/_admin/adminconfigintro.aspx?scenarioid=adminconfig&welcomestringid=farmconfigurationwizard_welcome

is there any thing i am missing here?

Thanks in advance,

Feb 16, 2011 at 1:54 PM
Edited Feb 16, 2011 at 1:56 PM

Hi Brian,

I followed you instruction to put http://firstserver in the Input XML file to replace http://localhost and run the script on the second server. It finished successfully and also no error logged in log file. the only thing happened is at the end the browser tried to open farmconfigurationwizard_welcome page from second server url

http://secondserver:2010/_admin/adminconfigintro.aspx?scenarioid=adminconfig&welcomestringid=farmconfigurationwizard_welcome 

instead of from open the page from the first server url

http://firstserver:2010/_admin/adminconfigintro.aspx?scenarioid=adminconfig&welcomestringid=farmconfigurationwizard_welcome

If this is the only url issue, I don't think it is an issue for me at all.  

Thanks in advance,