SharePoint au Quotidien

 

Retour page Accueil
Remonter

 

 

 

 

 

 

 

 

Comment se servir de SPS Config :

Pour ceux qui veulent voir et savoir avant d'installer, voici la VB Script en question :

--------------------------------------------------------------------------------------------------------------------------

<?xml version="1.0" standalone="yes" ?>

<job>

<?job debug="true" error="true"?>

<comment>

This script, spsconfig.wsh is used to configure SPS servers to work with additional host names

in an extranet, intranet, or internal hosting environment.

</comment>

<script language="vbscript">

<![CDATA[

Option Explicit

Dim oArgs, oFileSystem, oWshShell, oWebService, oIE, oIETestPage, oItem, oOption

Dim iArgItem, sSiteName, sProxyName, aAuth, aWorkspaces, sCurrentHosts

Dim aWinHTTPSettings, iByteCounter, sCmd, sWorkspace

Dim bConfigWeb, bConfigProxy, bConfigSub, bConfigHosts, bDiags, sTestName, sAuth

'MAIN Routine Begin-------------------------------------------------------------------------------------------------------

'Process Command Line Arguments

Set oArgs = WScript.Arguments

iArgItem = 0 : bConfigWeb = False : bConfigProxy = False

While iArgItem < oArgs.Count

Select Case LCase(oArgs(iArgItem))

Case "-name","-n":

iArgItem = iArgItem + 1

If (iArgItem >= oArgs.Count) then DisplayUsage

sSiteName=oArgs(iArgItem) : bConfigWeb = True

Case "-auth","-a":

iArgItem = iArgItem + 1

If (iArgItem >= oArgs.Count) then DisplayUsage

If ((oArgs(iArgItem) < 0) or (oArgs(iArgItem) > 2)) then DisplayUsage

aAuth = Array(0,0,0)

aAuth(oArgs(iArgItem)) = -1

Case "-workspaces","-w":

iArgItem = iArgItem + 1

If (iArgItem >= oArgs.Count) then DisplayUsage

aWorkspaces = Split(oArgs(iArgItem), ",", -1)

Case "-proxy","-p":

iArgItem = iArgItem + 1

If (iArgItem >= oArgs.Count) then DisplayUsage

sProxyName=lcase(oArgs(iArgItem)) : bConfigProxy = True

Case "-subscription","-s": bConfigSub = True

Case "-hosts","-h": bConfigHosts = True

Case "-diags","-d": bDiags = True

Case "-help","-?": DisplayUsage

End Select

iArgItem = iArgItem + 1

Wend

Set oArgs = Nothing

On Error Resume Next

'Open Shell and file objects for registry and file system access

Set oWshShell = WScript.CreateObject("WScript.Shell")

Set oFileSystem = CreateObject("Scripting.FileSystemObject")

'Get Proxy Server name from proxycfg registry settings - used by both command line and UI

If not bConfigProxy then 'The user did not specify a command line proxy server name

sProxyName=""

aWinHTTPSettings = oWshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\WinHttpSettings")

If aWinHTTPSettings(12) = "" then DisplayError 1

for iByteCounter = 16 to (15+aWinHTTPSettings(12)) : sProxyName=sProxyName&chr(aWinHTTPSettings(iByteCounter)) :Next

End If

If iArgItem > 0 then 'A command line entry was specified

'Perform Tasks for Command Line Usage

'------------------------------------

If bConfigWeb or bConfigProxy then 'Something valid was specified

'Open IIS object for configuring IIS

Set oWebService = GetObject("IIS://LocalHost/W3SVC")

if not IsObject(oWebService) then DisplayError 1

If bConfigWeb then '--- Create Web Site and Configure Proxy

'Fill in default values if necessary

If not IsArray(aAuth) then aAuth=Array(0,0,-1)

If not IsArray(aWorkspaces) then aWorkspaces=GetWorkspaceList(oWebService)

If IsEmpty(aWorkspaces) then DisplayError 2

If CreateWebSite(oWshShell, oWebService, sSiteName, aAuth, aWorkspaces) <> 0 then DisplayError Err.Number

If bConfigSub then If SubscriptionServer(sSiteName) = "" then DisplayError 4

If bConfigHosts then If AddHosts(oWshShell, oFileSystem, sSiteName) <> 0 then DisplayError 7

If Proxycfg (oWshShell, sProxyName, GetHostNames(oWebService)) <> 0 then DisplayError 5

If bDiags then

sTestName = sSiteName & "/" & aWorkspaces(0)

Call OpenIE(oIETestPage, "http://"&sTestName)

Call ViewTest(oFileSystem, oWebService, Left(sTestName, InstrRev(sTestName, "/")))

oWshShell.Run "cmd /k ping "&Left(sTestName, Instr(sTestName, "/")-1)&"&ipconfig",1

oWshShell.AppActivate "ping "&Left(sTestName, Instr(sTestName, "/")-1)

End If

ElseIf bConfigProxy then '--- Only Configure Proxy

If Proxycfg (oWshShell, sProxyName, GetHostNames(oWebService)) <> 0 then DisplayError 5

End If

'Display results

If sProxyName = "" then sProxyName = "SPSFakeProxy:80"

wscript.echo "SPS configuration completed:"

If sSiteName <> "" then

wscript.echo "New Web Site="&sSiteNAme&" and Proxy Server=" & sProxyName

Else

wscript.echo "Updated Proxy Server=" & sProxyName

End If

Else 'User did not specify host name or proxy server name

DisplayUsage

End If

Else

'Perform Tasks with User Interface

'---------------------------------

'--- OPEN Internet Explorer for User Interface ---

Call OpenIE(oIE, "")

oIE.Document.All.IntroPage.style.display=""

oWshShell.AppActivate "sharePoint Portal Server Configuration Tool"

 

'--- LOOP waiting for UI commands ---

sCmd = ""

Do While Err = 0

Select Case sCmd

Case "Quit" 'User is quitting

Exit Do

Case "LoadConfig" '--- LOAD form data and display configuration page ---

oIE.Document.All.IntroPage.style.display="none"

oIE.Document.All.LoadingPage.style.display=""

'Open IIS object for configuring IIS - This may take a while so do this after intro page in IE is open

Set oWebService = GetObject("IIS://LocalHost/W3SVC")

if not IsObject(oWebService) then DisplayError 1

sCurrentHosts=GetHostNames(oWebService)

oIE.Document.SPSForm.Proxy.Value = sProxyName

aWorkspaces=GetWorkspaceList(oWebService)

if IsEmpty(aWorkspaces) then DisplayError 2

for each sWorkspace in aWorkspaces

If sWorkspace <> "" then

Set oOption = oIE.Document.createElement("OPTION")

oIE.Document.SPSForm.Workspaces.options.add(oOption)

oOption.innerText=sWorkspace : oOption.Value=sWorkspace : oOption.Selected=sWorkspace

End If

Next

oIE.Document.All.SubServerText.innerHTML=oIE.Document.All.SubServerText.innerHTML&SubscriptionServer("")

oIE.Document.All.LoadingPage.style.display="none"

oIE.Document.All.ConfigPage.style.display=""

Case "PerformConfig" '--- PROCESS configuration data and display Finish Page---

oIE.Document.All.ConfigPage.style.display="none"

oIE.Document.All.WorkingPage.style.display=""

'--- GET Values from UI Page

bConfigWeb=oIE.Document.SPSForm.ConfigWeb.Checked

bConfigProxy=oIE.Document.SPSForm.ConfigProxy.Checked

bConfigSub=oIE.Document.SPSForm.Subscription.Checked

bConfigHosts=oIE.Document.SPSForm.Hosts.Checked

sSiteName=oIE.Document.SPSForm.HostName.Value

If sSiteName="" then sSiteName="<Enter Server Name>"

oIE.Document.SPSForm.TestName.Value=sTestName

If bConfigWeb then sCurrentHosts=sCurrentHosts&sSiteName&";"

sProxyName=oIE.Document.SPSForm.Proxy.Value

aAuth=Array(0,0,0)

aAuth(0)=oIE.Document.SPSForm.Auth(0).Checked : aAuth(1)=oIE.Document.SPSForm.Auth(1).Checked : aAuth(2)=oIE.Document.SPSForm.Auth(2).Checked

For each oItem in oIE.Document.SPSForm.Auth

If oItem.Checked then sAuth = oItem.Value 'sAuth is for summary table later

Next

sWorkspace=""

For each oItem in oIE.Document.SPSForm.Workspaces

If oItem.Selected then sWorkspace = sWorkspace&oItem.Value&","

Next

If sWorkspace="" then DisplayError 2 'No workspace selected by user

aWorkspaces=Split(sWorkspace, ",")

sTestName=sSiteName & "/" & aWorkspaces(0) 'sTestName for use on validation page

 

'--- PERFORM Configuration

If bConfigWeb then '--- Create Web Site and Configure Proxy

If CreateWebSite(oWshShell, oWebService, sSiteName, aAuth, aWorkspaces) <> 0 then DisplayError Err.Number

If bConfigSub then If SubscriptionServer(sSiteName) = "" then DisplayError 4

If bConfigHosts then If AddHosts(oWshShell, oFileSystem, sSiteName) <> 0 then DisplayError 7

If Proxycfg (oWshShell, sProxyName, GetHostNames(oWebService)) <> 0 then DisplayError 5

ElseIf bConfigProxy then '--- Only Configure Proxy

If Proxycfg (oWshShell, sProxyName, GetHostNames(oWebService)) <> 0 then DisplayError 5

End If

'Open new IE window since all IE windows were closed by proxycfg

If bConfigWeb or bConfigProxy then 'Proxy setting was configured

Call OpenIE(oIE, "")

aWorkspaces=GetWorkspaceList(oWebService)

for each sWorkspace in aWorkspaces

If sWorkspace <> "" then

Set oOption=oIE.Document.createElement("OPTION")

oIE.Document.SPSForm.Workspaces.options.add(oOption)

oOption.innerText=sWorkspace : oOption.Value=sWorkspace : oOption.Selected=sWorkspace

End If

Next

'Reset Form Values

oIE.Document.SPSForm.Proxy.Value=sProxyName

oIE.Document.All.SubServerText.innerHTML=oIE.Document.All.SubServerText.innerHTML&SubscriptionServer("")

oIE.Document.SPSForm.TestName.Value=sTestName

End If

 

'--- CONFIGURE summary table on finish page

oIE.Document.All.WorkingPage.style.display="none"

If bConfigWeb then

oIE.Document.All.tWeb1.bgcolor="#00FF00" : oIE.Document.All.tWeb1Name.bgcolor="#00FF00"

oIE.Document.All.tWeb1Name.InnerHTML="<font size=2><b>"&sSiteName&"</b></font>"

oIE.Document.All.tWeb2.bgcolor="#00FF00" : oIE.Document.All.tWeb2Name.bgcolor="#00FF00"

oIE.Document.All.tWeb2Name.InnerHTML="<font size=2>Done</font>"

oIE.Document.All.tWeb3.bgcolor="#00FF00" : oIE.Document.All.tWeb3Name.bgcolor="#00FF00"

If sAuth = "Anonymous" then

oIE.Document.All.tWeb3Name.InnerHTML="<font size=2><b>Anonymous</b> authentication - ensure the "_

& "Internet Guest (I_USRComputername) account has permissions to SPS</font>"

Else

oIE.Document.All.tWeb3Name.InnerHTML="<font size=2><b>"&sAuth&"</b> authentication</font>"

End If

oIE.Document.All.tValidate.bgcolor="#00FF00"

If bConfigSub then

oIE.Document.All.tSubServer.bgcolor="#00FF00" : oIE.Document.All.tSubServerName.bgcolor="#00FF00"

oIE.Document.All.tSubServerName.InnerHTML="<font size=2><b>"&SubscriptionServer("")&"</b></font>"

Else

oIE.Document.All.tSubServerName.InnerHTML="<font size=2>"&SubscriptionServer("")&"</font>"

End If

If bConfigHosts then

oIE.Document.All.tDNS.bgcolor="#00FF00"

oIE.Document.All.tDNS.innerHTML="<font size=2><b>Host name mapping added to local hosts file</b></font>"

End If

Else 'In case the user is configuring multiple sites (chose restart button) need to reset these values

oIE.Document.All.tWeb1.bgcolor="#FFFF00" : oIE.Document.All.tWeb1Name.bgcolor="#FFFF00"

oIE.Document.All.tWeb1Name.InnerHTML=""

oIE.Document.All.tWeb2.bgcolor="#FFFF00" : oIE.Document.All.tWeb2Name.bgcolor="#FFFF00"

oIE.Document.All.tWeb2Name.InnerHTML=""

oIE.Document.All.tWeb3.bgcolor="#FFFF00" : oIE.Document.All.tWeb3Name.bgcolor="#FFFF00"

oIE.Document.All.tWeb3Name.InnerHTML=""

oIE.Document.All.tValidate.bgcolor="#FFFF00"

oIE.Document.All.tSubServer.bgcolor="#FFFF00" : oIE.Document.All.tSubServerName.bgcolor="#FFFF00"

oIE.Document.All.tSubServerName.InnerHTML="<font size=2>"&SubscriptionServer("")&"</font>"

oIE.Document.All.tDNS.bgcolor="#FFFF00"

oIE.Document.All.tDNS.innerHTML="<font size=2>Host file was not configured</font>"

End If

If bConfigProxy then

oIE.Document.All.tIE.bgcolor="#00FF00"

oIE.Document.All.tProxy.bgcolor="#00FF00" : oIE.Document.All.tProxyName.bgcolor="#00FF00"

oIE.Document.All.tProxyName.InnerHTML="<font size=2><b>Proxy server = "&sProxyName&"</b></font>"

Else

oIE.Document.All.tIE.bgcolor="#FFFF00"

oIE.Document.All.tProxy.bgcolor="#FFFF00" : oIE.Document.All.tProxyName.bgcolor="#FFFF00"

oIE.Document.All.tProxyName.InnerHTML="<font size=2>Proxy server = "&sProxyName&"</font>"

End If

If sProxyName <> "SPSFakeProxy:80" then oIE.Document.All.ProxyConfigText.style.display="none"

oIE.Document.All.FinishPage.style.display=""

Case "Validate" 'User clicked continue on Finish page - opening validation page

oIE.Document.All.FinishPage.style.display="none"

oIE.Document.All.ValidatePage.style.display=""

Case "ViewWorkspace" 'User viewing workspace on validation page

If lcase(left(sSiteName,7))="http://" then

Call OpenIE(oIETestPage, oIE.Document.SPSForm.TestName.Value)

Else

Call OpenIE(oIETestPage, "http://"&oIE.Document.SPSForm.TestName.Value)

End If

If Err <> 0 then Err.Clear 'In case window closed before it was finished opening

Case "ViewTest" 'User viewing test page on validation page

Call ViewTest(oFileSystem, oWebService, Left(oIE.Document.SPSForm.TestName.Value, _

InstrRev(oIE.Document.SPSForm.TestName.Value, "/")))

Case "ViewPing" 'User pinging host name on validation page

oWshShell.Run "cmd /k ping "&Left(oIE.Document.SPSForm.TestName.Value, _

Instr(oIE.Document.SPSForm.TestName.Value, "/")-1)&"&ipconfig",1

oWshShell.AppActivate "ping "&Left(oIE.Document.SPSForm.TestName.Value, _

Instr(oIE.Document.SPSForm.TestName.Value, "/")-1)

End Select

sCmd = ""

WScript.Sleep 300 'Keep CPU free while waiting for user input

If oIE.ReadyState = 0 then Exit Do 'If the onQuit event does not fire, this will exit the loop

Loop

End If

If Err <> 0 then DisplayError Err.Number 'Catch any errors

Set oFileSystem = Nothing : Set oWshShell = Nothing : Set oIE = Nothing : Set oWebService = Nothing

Wscript.Quit

'MAIN Routine End---------------------------------------------------------------------------------------------------------

'-----------------------------------------------------------------------------------------------------------------

'EVENT Handlers - for the 8 UI buttons

'-----------------------------------------------------------------------------------------------------------------

'*************************************************************************************************************************

Sub CancelEvent()

'User selecting Cancel - this will cause the oIE_onQuit subroutine to be called as well

'*************************************************************************************************************************

oIE.Quit

sCmd = "Quit"

End Sub

'*************************************************************************************************************************

Sub IntroEvent()

'--- LOAD data and display configuration page ---

'*************************************************************************************************************************

sCmd = "LoadConfig"

End Sub

'*************************************************************************************************************************

Sub ConfigEvent()

'--- PROCESS configuration data and display Finish Page---

'Before processing host is checked to ensure not a duplicate

'*************************************************************************************************************************

Dim aList, sItem

sCmd = "PerformConfig"

If oIE.Document.SPSForm.ConfigWeb.Checked then 'Only need to check name if this is enabled

aList = Split(sCurrentHosts,";")

For each sItem in aList

If sItem = oIE.Document.SPSForm.HostName.Value then 'Duplicate name

If sItem = "" then

oIE.Document.Script.DisplayAlert("You must enter a host name if Configure New Virtual Web Site is selected")

Else

oIE.Document.Script.DisplayAlert("This host name already exists, please choose another."&vbCrLf&vbCrLf& _

"Note: The following host names are currently in use:"&vbCrLf&Left(sCurrentHosts,Len(sCurrentHosts)-1))

End If

sCmd = ""

End If

Next

'Fix up any bad names entered - remove http:// at front and / at end

If lcase(left(oIE.Document.SPSForm.HostName.Value,7))="http://" then _

oIE.Document.SPSForm.HostName.Value=right(oIE.Document.SPSForm.HostName.Value,len(oIE.Document.SPSForm.HostName.Value)-7)

If lcase(left(oIE.Document.SPSForm.HostName.Value,7))="http:\\" then _

oIE.Document.SPSForm.HostName.Value=right(oIE.Document.SPSForm.HostName.Value,len(oIE.Document.SPSForm.HostName.Value)-7)

If right(oIE.Document.SPSForm.HostName.Value,1)="/" or right(oIE.Document.SPSForm.HostName.Value,1)="\" then _

oIE.Document.SPSForm.HostName.Value=left(oIE.Document.SPSForm.HostName.Value,len(oIE.Document.SPSForm.HostName.Value)-1)

End If

End Sub

'*************************************************************************************************************************

Sub NamesEvent()

'--- Display Hosts names retrieved from IIS---

'*************************************************************************************************************************

If sCurrentHosts <> "" then

oIE.Document.Script.DisplayAlert("The following host names are currently in use:"&vbCrLf&Left(sCurrentHosts,Len(sCurrentHosts)-1))

Else

oIE.Document.Script.DisplayAlert("No host names are configured for the Web servers on this computer.")

End If

End Sub

'*************************************************************************************************************************

Sub FinishEvent()

'--- DISPLAY validation page ---

'*************************************************************************************************************************

sCmd="Validate"

End Sub

'*************************************************************************************************************************

Sub ViewWorkspaceEvent()

'--- VIEW Workspace test ---

'Verify host name first

'*************************************************************************************************************************

If Instr(oIE.Document.SPSForm.TestName.Value,"/") = 0 then

oIE.Document.Script.DisplayAlert("The name of the server to test must be in the form HostName/Workspace")

ElseIf Instr(oIE.Document.SPSForm.TestName.Value,"Enter Server Name") <> 0 then

oIE.Document.Script.DisplayAlert("Specify a server name to view")

Else

sCmd="ViewWorkspace"

End If

End Sub

'*************************************************************************************************************************

Sub ViewTestEvent()

'--- VIEW Test Page test ---

'Verify host name first

'*************************************************************************************************************************

If Instr(oIE.Document.SPSForm.TestName.Value,"/") = 0 then

oIE.Document.Script.DisplayAlert("The name of the server to test must be in the form HostName/Workspace")

ElseIf Instr(oIE.Document.SPSForm.TestName.Value,"Enter Server Name") <> 0 then

oIE.Document.Script.DisplayAlert("Specify a server name to view")

Else

sCmd="ViewTest"

End If

End Sub

'*************************************************************************************************************************

Sub ViewPingEvent()

'--- VIEW Ping test ---

'Verify host name first

'*************************************************************************************************************************

If Instr(oIE.Document.SPSForm.TestName.Value,"/") = 0 then

oIE.Document.Script.DisplayAlert("The name of the server to test must be in the form HostName/Workspace")

ElseIf Instr(oIE.Document.SPSForm.TestName.Value,"Enter Server Name") <> 0 then

oIE.Document.Script.DisplayAlert("Specify a server name to view")

Else

sCmd="ViewPing"

End If

End Sub

'*************************************************************************************************************************

Sub RestartEvent()

'--- Restart script with configuration page ---

'*************************************************************************************************************************

oIE.Document.All.FinishPage.style.display="none"

oIE.Document.All.ValidatePage.style.display="none"

oIE.Document.All.ConfigPage.style.display=""

End Sub

'*************************************************************************************************************************

Sub ProxyEvent()

'--- Open a Window with ProxyCfg ---

'*************************************************************************************************************************

'Run Proxycfg

owshShell.Run "cmd /k "&chr(34)&oWshShell.RegRead("HKLM\Software\Microsoft\Sharepoint Portal Server\InstallPath")&"\bin"&"\proxycfg.exe"&chr(34),1

If Err <> 0 then DisplayError 5 'Return error because we could not run proxycfg

End Sub

'--- End Event Subroutines---

 

 

'-----------------------------------------------------------------------------------------------------------------

'Subroutines and Functions

'-----------------------------------------------------------------------------------------------------------------

'*************************************************************************************************************************

Sub OpenIE(oIE, sPage)

'Opens instance of Internet Explorer

'Navigates to sPage - if sPage is empty, navigate to main UI page and keep IE object

'*************************************************************************************************************************

Set oIE = WScript.CreateObject("InternetExplorer.Application")

If sPage <> "" then 'Not the main UI page, separate IE Window

with oIE .top=100 : .left=150 : .height=650 : .width=650 : .resizable = 1

.menubar = 1 : .toolbar=1 : .addressbar=1 : .statusbar=1 : .visible=1 :End With

oIE.navigate sPage : While oIE.Busy : WScript.Sleep 100 : Wend

Set oIE = nothing

Else

With oIE : .top=50 : .left=100 : .height=650 : .width=650 : .resizable = 1

.menubar=0 : .toolbar=0 : .statusbar=0 : End With

oIE.navigate("about:blank") : While oIE.Busy : WScript.Sleep 100 : Wend

oIE.Document.Open "text/html" 'Open document for writing

oIE.Document.Write GetResource("HTML_Page")

oIE.Document.Close

oIE.Document.All.StartPage.style.display="none"

oIE.visible = 1

'Connect button click events to script event handler

oIE.Document.All.IntroContinue.OnClick = GetRef("IntroEvent")

oIE.Document.All.ConfigContinue.OnClick = GetRef("ConfigEvent")

oIE.Document.All.ConfigNames.OnClick = GetRef("NamesEvent")

oIE.Document.All.FinishContinue.OnClick = GetRef("FinishEvent")

oIE.Document.All.ViewWorkspace.OnClick = GetRef("ViewWorkspaceEvent")

oIE.Document.All.ViewTest.OnClick = GetRef("ViewTestEvent")

oIE.Document.All.ViewPing.OnClick = GetRef("ViewPingEvent")

oIE.Document.All.Restart.OnClick = GetRef("RestartEvent")

oIE.Document.All.Restart2.OnClick = GetRef("RestartEvent")

oIE.Document.All.IntroCancel.OnClick = GetRef("CancelEvent")

oIE.Document.All.ConfigCancel.OnClick = GetRef("CancelEvent")

oIE.Document.All.ValidateCancel.OnClick = GetRef("CancelEvent")

oIE.Document.All.ValidateCancel2.OnClick = GetRef("CancelEvent")

oIE.Document.All.ProxyLink.OnClick = GetRef("ProxyEvent")

End If

End Sub

'*************************************************************************************************************************

Sub oIE_OnQuit()

'User closing IE window

'*************************************************************************************************************************

sCmd = "Quit"

End Sub

'*************************************************************************************************************************

Function GetHostNames(oWebService)

'Get all host names used to avoid duplicates later

'Returns string with all host names separated by a semicolons

'*************************************************************************************************************************

Dim oWebServer, sHostNames, sBinding

sHostNames = ""

For Each oWebServer in oWebService

If oWebServer.class = "IIsWebServer" then

For each sBinding in oWebServer.ServerBindings

if Mid(sBinding, InstrRev(sBinding, ":")+1, Len(sBinding)) <> "" then _

sHostNames = sHostNames & Mid(sBinding, InstrRev(sBinding, ":")+1, Len(sBinding)) & ";"

Next

End If

Next

GetHostNames = sHostNames

End Function

'*************************************************************************************************************************

Function GetWorkspaceList(oWebService)

'Returns array of workspaces

'*************************************************************************************************************************

Dim oDefaultSiteRoot, sWorkspace, oWebVirtualDir

Set oDefaultSiteRoot = GetObject("IIS://LocalHost/W3SVC/1/root")

sWorkspace=""

For Each oWebVirtualDir in oDefaultSiteRoot

If oWebVirtualDir.Class = "IIsWebVirtualDir" then

If Instr(oWebVirtualDir.Path,"\\.\backofficestorage\localhost\SharePoint Portal Server") then

If ((oWebVirtualDir.Name <> "Public") and (oWebVirtualDir.Name <> "SharePoint Portal Server")) then _

sWorkspace = sWorkspace & oWebVirtualDir.Name & ","

End If

End If

Next

If sWorkspace <> "" then

GetWorkspaceList = Split(sWorkspace, ",")

Else

GetWorkspaceList = Empty

End If

End Function

'*************************************************************************************************************************

Function CreateWebSite(oWshShell, oWebService, sSiteName, aAuth, aWorkspaces)

' This subroutine creates a new IIS Web site and necessary SPS virtual directories

' The TestName field is field in for the Validation Page

' Function returns error code

'*************************************************************************************************************************

Dim iSite, sBinding, sWork

Dim oServer, oVroot, oDefaultSiteRoot, oDest, oWebServer, oWebVirtualDir

'Some users have added http:// to the name, need to remove that if it is there - needed here for command line use

If lcase(left(sSiteName,7))="http://" then sSiteName=right(sSiteName,len(sSiteName)-7)

'Get site number and avoid duplicate virtual server bindings

'Note the UI will prevent duplicates, however this is still needed for command line users

iSite = 1

For Each oWebServer in oWebService

If oWebserver.class = "IIsWebServer" then

If CInt(oWebserver.Name) => iSite then iSite = oWebserver.Name+1

For each sBinding in oWebserver.ServerBindings

if lcase(Mid(sBinding, InstrRev(sBinding, ":")+1, Len(sBinding))) = lcase(sSiteName) then Err.Raise 3

Next

End If

Next

If Err <> 0 then

CreateWebSite=Err.Number

Exit Function

End If

Set oServer = oWebService.Create("IIsWebServer", iSite)

oServer.ServerBindings = ":80:"&sSiteName : oServer.ServerComment = sSiteName

oServer.SetInfo

'Get Object for Default Web Site - for default path, and finding workspaces vroots to copy to new web site

Set oDefaultSiteRoot = GetObject("IIS://LocalHost/W3SVC/1/root")

'Create default virtual directory for new site

Set oVroot = oServer.Create("IIsWebVirtualDir", "ROOT")

oVroot.Path = oDefaultSiteRoot.Path : oVroot.Defaultdoc = oDefaultSiteRoot.Defaultdoc

oVroot.AccessRead = true : oVroot.AccessScript = true

oVroot.AuthAnonymous = aAuth(0) : oVroot.AuthBasic = aAuth(1) : oVroot.AuthNTLM = aAuth(2)

oVroot.AppCreate2 2 : oVroot.AppFriendlyName = "Default Application"

oVroot.SetInfo

oServer.Start

'Create SPS related vdirs (ExchWeb, MSOffice, Public, SPS, workspaces)

For Each oWebVirtualDir in oDefaultSiteRoot

If oWebVirtualDir.Class = "IIsWebVirtualDir" then

If ((oWebVirtualDir.Name="Exchweb") or (oWebVirtualDir.Name="MSOffice") or _

(oWebVirtualDir.Name="Public") or (oWebVirtualDir.Name="SharePoint Portal Server")) then

Set oDest = oWebService.CopyHere("1/root/"&oWebVirtualDir.Name,iSite&"/root/"&oWebVirtualDir.Name)

oDest.AuthAnonymous = aAuth(0) : oDest.AuthBasic = aAuth(1) : oDest.AuthNTLM = aAuth(2)

oDest.SetInfo

End If

End IF

Next

'Create workspaces the user selected from the UI or command line

For Each sWork in aWorkspaces

If sWork <> "" then

Set oDest = oWebService.CopyHere("1/root/"&sWork,iSite&"/root/"&sWork)

oDest.AuthAnonymous = aAuth(0) : oDest.AuthBasic = aAuth(1) : oDest.AuthNTLM = aAuth(2)

oDest.SetInfo

End If

Next

Set oDest = Nothing : Set oVroot = Nothing : Set oServer = Nothing : Set oDefaultSiteRoot = Nothing

'Enable Web Discussions for new site

oWshShell.RegWrite "HKLM\Software\Microsoft\Office\9.0\Web Server\"&iSite&"\", ""

oWshShell.RegWrite "HKLM\Software\Microsoft\Office\9.0\Web Server\"&iSite&"\EnableDiscussions", 1 ,"REG_DWORD"

oWshShell.RegWrite "HKLM\Software\Microsoft\Office\9.0\Web Server\"&iSite&"\EnableSubscriptions", 1 ,"REG_DWORD"

oWshShell.RegWrite "HKLM\Software\Microsoft\Office\9.0\Web Server\"&iSite&"\Server Collaboration Object", "ServerCollab1"

oWshShell.RegWrite "HKLM\Software\Microsoft\Office\9.0\Web Server\"&iSite&"\Server Root Url", "http://" &sSiteName

End Function

 

'*************************************************************************************************************************

Function Proxycfg(oWshShell, sProxyName, sHostNames)

'This is a script to correctly configure ServerXMLHTTP proxy settings for SPS

'The routine calls proxycfg because vbscript does not registry write a binary blob larger than 32 bits

'Function returns error code

'*************************************************************************************************************************

Dim sBypass, sProxycfgApp, sPrefix, Process

'Bypass internal FQDN names and intranet addresses

sBypass = sHostNames & "<local>"

'If no proxy name specified, configure fake proxy and add web part gallery site to bypass list

If sProxyName = "" or sProxyName = "SPSFakeProxy:80" then

sProxyName = "SPSFakeProxy:80"

sBypass = "*.microsoft.com;" & sBypass

End If

'Get Proxycfg path

On Error Resume Next

sProxycfgApp=chr(34)&oWshShell.RegRead("HKLM\Software\Microsoft\Sharepoint Portal Server\InstallPath")&"\bin"&"\proxycfg.exe"&chr(34)

If Err <> 0 then 'Return error because we could not locate installpath in the registry

On Error Goto 0

ProxyCfg = 5

Exit Function

End If

'Run Proxycfg

ProxyCfg = owshShell.Run(sProxycfgApp&" -d -p " &sProxyName& " " &chr(34)&sBypass&chr(34),0,TRUE)

 

sPrefix = "HKLM\Software\Microsoft\Windows\CurrentVersion\Internet Settings\"

oWshShell.regWrite sPrefix & "ProxyServer", sProxyName

If sProxyName = "SPSFakeProxy:80" then

sBypass="*;"&sByPass

End If

oWshShell.regWrite sPrefix & "ProxyOverride", sBypass

oWshShell.regWrite sPrefix & "ProxyEnable", 1, "REG_DWORD"

'Close all IE windows for setting to take effect

for each Process In GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery("select * from Win32_Process where Name='iexplore.exe'") : Process.terminate () : Next

End Function

'*************************************************************************************************************************

Function AddHosts(oWshShell, oFileSystem, sSiteName)

'Add host name and IP address to system hosts file

'*************************************************************************************************************************

Dim oFile, sFileData, oIPConfigSet, oIPConfig, sIP, i

On Error Resume Next

Set oFile = oFileSystem.OpenTextFile(oWshShell.ExpandEnvironmentStrings("%WINDIR%")&"\system32\drivers\etc\hosts", 1)

If Err <> 0 then 'File not found

Err.Clear

AddHosts=7

bConfigHosts=False

Exit Function

End If

'Do not add duplicate name to file

While not oFile.AtEndofStream

sFileData = oFile.ReadLine

If Instr(sFileData, sSiteName) <> 0 then Exit Function

Wend

'If you have a multihomed machine, you will get the last IP address

Set oIPConfigSet = GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery _

("select IPAddress from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")

For each oIPConfig in oIPConfigSet

If Not IsNull(oIPConfig.IPAddress) then

For i=LBound(oIPConfig.IPAddress) to UBound(oIPConfig.IPAddress) : sIP = oIPConfig.IPAddress(i) : Next

End If

Next

Set oFile = oFileSystem.OpenTextFile(oWshShell.ExpandEnvironmentStrings("%WINDIR%")&"\system32\drivers\etc\hosts", 8)

oFile.WriteLine sIP & " " &sSiteName

oFile.close

Set oFile = Nothing

End Function

'*************************************************************************************************************************

Function SubscriptionServer(sServerName)

'If sServername is blank, retrieve the servername, otherwise set it

'Error will occur if the Web Storage System (msexchangeis) is not running - which returns "" for the name

'*************************************************************************************************************************

Dim InfoNT, Rec, Conn, Flds

Set InfoNT = CreateObject("WinNTSystemInfo")

Set Rec = CreateObject("ADODB.Record")

Set Conn = CreateObject("ADODB.Connection")

Conn.Provider = "ExOLEDB.DataSource"

Conn.Open "http://" & InfoNT.ComputerName & "/SharePoint Portal Server/workspaces/"

If Err <> 0 then

Err.Clear

SubscriptionServer=""

Exit Function

End If

Rec.Open "http://" & InfoNT.ComputerName & "/SharePoint Portal Server/workspaces/", Conn, 3

Set Flds = Rec.Fields

If sServerName = "" then

If Flds("urn:schemas-microsoft-com:publishing:ServerURL") = "" then

SubscriptionServer = InfoNT.Computername

Else

SubscriptionServer = Flds("urn:schemas-microsoft-com:publishing:ServerURL")

End If

Else

Flds("urn:schemas-microsoft-com:publishing:ServerURL") = sServerName

Flds.Update

SubscriptionServer = sServerName

End If

End Function

'*************************************************************************************************************************

Sub ViewTest(oFileSystem, oWebService, sSiteName)

'Create a temporary test page and open in separate browser window

'*************************************************************************************************************************

Dim oDefaultSite, oFile, oWebServer, oIETestPage

' Use root path of Default Web Site - since that is what all of the created sites are based off of

Set oDefaultSite = GetObject("IIS://LocalHost/W3SVC/1/root")

' Create test page

Set oFile = oFileSystem.CreateTextFile(oDefaultSite.Path & "\spsconfigtest.asp", True)

oFile.WriteLine("<html>")

oFile.WriteLine("<h1>SPS Configuration Test Page</h1>")

oFile.WriteLine("You connected to the virtual Web site: <b>")

oFile.WriteLine("<% Select Case Request.ServerVariables("&chr(34)&"INSTANCE_ID"&chr(34)&")")

For Each oWebServer in oWebService

If oWebServer.class = "IIsWebServer" then

oFile.WriteLine(" Case "&oWebServer.Name&" response.write "&chr(34)&oWebServer.ServerComment&chr(34))

End If

Next

oFile.WriteLine("End Select")

oFile.WriteLine("%></b> <BR> ")

oFile.WriteLine("Server IP Address = <b><%= Request.ServerVariables("&chr(34)&"LOCAL_ADDR"&chr(34)&") %> </b><BR> ")

oFile.WriteLine("<%If Request.ServerVariables("&chr(34)&"AUTH_TYPE"&chr(34)&") = "&chr(34)&"Negotiate"&chr(34)&" then ")

oFile.WriteLine(" response.write "&chr(34)&"Server Authentication Method = <b>Negotiate (Integrated Windows)</b><br>"&chr(34))

oFile.WriteLine(" ElseIf Request.ServerVariables("&chr(34)&"AUTH_TYPE"&chr(34)&") = "&chr(34)&chr(34)&" then ")

oFile.WriteLine(" response.write "&chr(34)&"Server Authentication Method = <b>"&chr(34)&"&Request.ServerVariables("&chr(34)&"AUTH_TYPE"&chr(34)&")&"&chr(34)&"</b><BR>"&chr(34))

oFile.WriteLine(" Else")

oFile.WriteLine(" response.write "&chr(34)&"Server Authentication Method = <b>"&chr(34)&"&Request.ServerVariables("&chr(34)&"AUTH_TYPE"&chr(34)&")&"&chr(34)&"</b><BR>"&chr(34))

oFile.WriteLine(" End If%> ")

oFile.WriteLine("Server Authenticated User = <b><%= Request.ServerVariables("&chr(34)&"AUTH_USER"&chr(34)&") %> </b><BR> ")

oFile.WriteLine("</html>")

oFile.Close

Set oFile = Nothing

'Open test page in browser

If not lcase(left(sSiteName,7))="http://" then sSiteName = "http://"&sSiteName

Call OpenIE(oIETestPage, Left(sSiteName, Instr(8,sSiteName, "/"))&"spsconfigtest.asp")

'Delete test page

oFileSystem.DeleteFile(oDefaultSite.Path & "\spsconfigtest.asp")

Set oDefaultSite = Nothing

End Sub

'*************************************************************************************************************************

Sub DisplayUsage

'Display command line parameters

'*************************************************************************************************************************

wscript.echo "spsconfig [--name|-n www.hostname.com] specifies host name for the Web site" _

&chr(13)&chr(10)& " [--workspaces|-w List] where List is separated with commas" _

&chr(13)&chr(10)& " [--auth|-a 0|1|2] where 0=Anonymous, 1=Basic, 2=Windows Integrated" _

&chr(13)&chr(10)& " [--subscription|-s] configures the server used in subscription mail" _

&chr(13)&chr(10)& " [--hosts|-h] adds an entry to the hosts file for the host" _

&chr(13)&chr(10)& " [--proxy|-p ProxyServerName:Port] configures the proxy server name" _

&chr(13)&chr(10)& " [--diags|-d] Opens 3 diagnostic windows to the newly created site" _

&chr(13)&chr(10)& " [--help|-?]" _

&chr(13)&chr(10)& "" _

&chr(13)&chr(10)& "This tool configures an IIS virtual Web site with the parameters specified," _

&chr(13)&chr(10)& "and/or configures your portal and Internet Explorer proxy server settings." _

&chr(13)&chr(10)& "" _

&chr(13)&chr(10)& "If workspaces are not specified, all workspaces are copied to the new Web site." _

&chr(13)&chr(10)& "If the authentication method is not specified, Windows Integrated is used." _

&chr(13)&chr(10)& "" _

&chr(13)&chr(10)& "Note proxy server settings are always configured when creating a new Web site" _

&chr(13)&chr(10)& "for use with SPS. If you do not specify a proxy server name, a default proxy " _

&chr(13)&chr(10)& "server is configured (this is required by SPS). Both the portal and Internet" _

&chr(13)&chr(10)& "Explorer are updated (this will close any open Internet Explorer windows)." _

&chr(13)&chr(10)& "" _

&chr(13)&chr(10)& "Example: spsconfig -n www.company.com -w work1,work2 -a 2 -s -h -p proxy:80"

wscript.quit

End Sub

 

'*************************************************************************************************************************

Sub DisplayError (iMsg)

'Display error messages, will exit script if necessary

'Uses global variable oIE

'*************************************************************************************************************************

Dim sMsg

Select Case iMsg

Case 1: sMsg = "IIS or SPS not detected. Run this script on your Sharepoint Portal Server computer."

Case 2: sMsg = "SPS workspaces not detected on the Default Web Server (or selected on the configuration page) - at least one workspace must be available and selected."

Case 3: sMsg = "A duplicate host name has been found. Run the script again with a new name."

Case 4: sMsg = "Can't access the Web Storage System, ensure it is started."

Case 5: sMsg = "Error running proxycfg.exe. Ensure SPS is installed and proxycfg is located in your Sharepoint Portal Server\bin directory"

Case 6: sMsg = "Cannot find the data entry page spsconfigscreen.htm." _

&chr(13)&chr(10)& "Type spsconfig -? to see available command line options."

Case 7: sMsg = "Cannot find \winnt\system32\drivers\etc\hosts file - hosts file not updated"

Case -2147024893: sMsg = "An invalid workspace name was specified."&vbCrLf&"You will need to delete and recreate this virtual Web site."

Case 462: Set oIE = Nothing 'IE Window closed

Case Else: sMsg = "An error occurred, the error message is: "&Err.Number&" "&Err.Description

End Select

If IsObject(oIE) then

oIE.Document.Script.DisplayAlert(sMsg)

Else

wscript.echo sMsg

End If

If iMsg <> 7 then 'End script...except for hosts file not found error which is not fatal

If IsObject(oIE) then oIE.Quit 'Ensure IE gets closed if an error occurs

wscript.quit(1)

End If

End Sub

]]>

</script>

 

 

 

<resource id="HTML_Page">

<![CDATA[

<html>

<head>

<meta name="VI60_defaultClientScript" content="VBScript">

<meta http-equiv="Content-Type"

content="text/html; charset=windows-1252">

<meta name="GENERATOR" content="Microsoft FrontPage 5.0">

<meta name="ProgId" content="FrontPage.Editor.Document">

<title>SharePoint Portal Server Configuration Tool</title>

</head>

<body bgcolor="#FFFFCC" bgproperties="fixed">

<script language="VBScript">

'*************************************************************************************************************************

Sub window_onload()

'*************************************************************************************************************************

StartPage.style.display=""

IntroPage.style.display="none"

LoadingPage.style.display="none"

ConfigPage.style.display="none"

WorkingPage.style.display="none"

FinishPage.style.display="none"

ValidatePage.style.display="none"

SPSForm.ConfigProxy.Disabled=True

End Sub

'*************************************************************************************************************************

Public Sub DisplayAlert(sText)

'*************************************************************************************************************************

window.alert(sText)

End Sub

'*************************************************************************************************************************

Sub ProxyCheckBox()

'*************************************************************************************************************************

If SPSForm.ConfigWeb.Checked then

SPSForm.ConfigProxy.Checked=True

SPSForm.ConfigProxy.Disabled=True

Else

SPSForm.ConfigProxy.Disabled=False

End If

End Sub

</script>

<script language="JScript">

document.onkeydown=keyDown;

// Disable F5 Refresh

function keyDown(){

if(event.keyCode==116) {event.returnValue= false; event.cancelBubble=true; event.keyCode=0;}

}

</script>

<DIV ID="StartPage">The SPS configuration Windows does not support refresh.

<p>Please close this window and restart spsconfig.wsf.</p>

</DIV>

<DIV ID="IntroPage">

<p align="center"><b><font size="5">Welcome to the SharePoint Portal Server <br>

Site Configuration

Tool</font></b></p>

<p align="left">This tool is a companion to the SPS Extranet white paper and

will automate many of the tasks in it. The green rows in the following table are configured by this tool; items in yellow must be configured separately.</p>

<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">

<tr><td bordercolor="#000000" bgcolor="#00FF00"><font size="2">Configure the

Proxy Setting on the SharePoint Portal Server Computer</font></td></tr>

<tr><td bgcolor="#FFFF00"><font size="2">Create a DNS Entry</font></td></tr>

<tr><td bgcolor="#00FF00"><font size="2">Create a New Web Site in Internet Information Server (IIS)</font></td></tr>

<tr><td bgcolor="#00FF00"><font size="2">Enable Discussions on the New Web Site</font></td></tr>

<tr><td bgcolor="#00FF00"><font size="2">Modify the Security Settings on the New Web Site</font></td></tr>

<tr><td bgcolor="#FFFF00"><font size="2">Configure the Proxy Server</font></td></tr>

<tr><td bgcolor="#00FF00"><font size="2">Test the Extranet from Your Intranet</font></td></tr>

<tr><td bgcolor="#FFFF00"><font size="2">Test the Extranet from the Internet</font></td></tr>

<tr><td bgcolor="#00FF00"><font size="2">Specify the Server Name to Use in Subscription E-mail Notifications</font></td></tr>

<tr><td bgcolor="#FFFF00"><font size="2">Enable Secure Sockets Layer (SSL)</font></td></tr>

<tr><td bgcolor="#00FF00"><font size="2">Specify an Internal FQDN for the SharePoint Portal Server Computer</font></td></tr>

<tr><td bgcolor="#FFFF00"><font size="2">Enable SharePoint Portal Server to Crawl Sites on the Internet</font></td></tr>

<tr><td bgcolor="#FFFF00"><font size="2">Enable SharePoint Portal Server to Crawl another SharePoint

Portal Server Computer across the Internet</font></td></tr>

</table>

<p> Note this tool will not modify the Default Web Site settings.&nbsp; This

tool creates and configures a separate virtual Web site per the recommendations

in the Extranet white paper. If you would later like to reverse the changes made by this tool, you can simply delete

the created Web site (with the IIS administration MMC snap-in) and reset your proxy server settings.</p>

<p> For this tool to complete successfully, you must run it on the SharePoint

Portal Server computer with an account that can administer the server.</p>

<p align="center">

<form name="IntroForm">

<p align="center">

<input type="button" id="IntroContinue" value="Continue">

<input type="button" id="IntroCancel" value="Exit Tool"></p></form>

</div>

<DIV ID="ConfigPage">

<form name="SPSForm">

<p align="center"><b><font size="4">Enter Site Configuration</font></b></p>

<fieldset style="padding: 2">

<legend>

<input type="checkbox" name="ConfigWeb" value="2" onclick="ProxyCheckBox" checked>Configure New Virtual

Web Site </legend>

<p><b>Web Site Host Name</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<input type="text" size="40" name="HostName">&nbsp;<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

(specify extranet or intranet FQDN or new host name)<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<input type="checkbox" name="Subscription" value="2" checked>Use this server

name in subscription emails <br>

<DIV ID="SubServerText">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - the current server name is: </DIV>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<input type="checkbox" name="Hosts" value="2" checked>Add name to hosts file

(this is useful for testing) <br>

<b>Workspaces </b>

(select those to enable on new Web site)<b><br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </b>

<select size="3" name="Workspaces" multiple></select><br>

<b>Authentication Configuration</b> (only one can be selected per virtual Web site)<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<input type="radio" value="Anonymous" name="Auth">Anonymous access<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

Authenticated access:<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<input type="radio" name="Auth" value="Basic">Basic authentication (password

sent in clear text)<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<input type="radio" name="Auth" value="Integrated Windows" checked>Integrated Windows authentication</fieldset></p>

<fieldset style="padding: 2">

<legend><input type="checkbox" name="ConfigProxy" value="2" checked>Configure Proxy Server Settings </legend>

<p><b>Proxy Server:Port&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </b><input type="text" size="40" name="proxy"><br>

<b>(i.e. proxy:80)</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

Note: This configures the proxy settings for the portal and

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

Internet Explorer. A restart of Internet Explorer is required.<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

If you do not enter a proxy server name, a 'fake' proxy name is <br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

used (SPSFakeProxy) - this is required for SPS operation.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

</p>

</fieldset></p>

<p align="center">

<input type="button" id="ConfigContinue" value="Perform Configuration">&nbsp;

<input type="button" id="ConfigNames" value="Display Host Names In Use">&nbsp;

<input type="button" id="ConfigCancel" value="Exit Tool"></p>

</DIV>

<DIV ID="LoadingPage">

<h1>Loading...</h1>

<p>Loading configuration information from Internet Information Server and Sharepoint Portal Server, please wait.</p>

</DIV>

<DIV ID="WorkingPage">

<h1>Working...</h1>

<p>Configuring Internet Information Server, Sharepoint Portal Server and Internet Explorer, please wait.</p>

<p>This window will close and reopen when configuring Internet Explorer proxy server settings.</p>

</DIV>

<DIV ID="FinishPage">

<p align="center"><b><font size="4">SPS Configuration Completed!</font></b></p>

<p align="left">The following tasks in green were configured, while the yellow tasks were not. Instructions to

manually complete the tasks in yellow can be found in the SPS extranet

<a target="_blank" href="http://www.microsoft.com/sharepoint/techinfo/Extranet.asp">white paper</a>.</p>

<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="" id="AutoNumber2">

<tr><td bgcolor="#FFFF00" ID="tProxy" width="460"><font size="2">Configure the Proxy Settings</font></td>

<td bgcolor="#FFFF00" ID="tProxyName" width="417">&nbsp;</td></tr>

<tr><td bgcolor="#FFFF00" width="143"><font size="2">Create a DNS Entry</font></td>

<td bgcolor="#FFFF00" ID="tDNS" width="755"><font size="2">Host file was not configured</font></td></tr>

<tr><td bgcolor="#FFFF00" ID="tWeb1" width="460"><font size="2">Create a New Web Site in IIS</font></td>

<td bgcolor="#FFFF00" ID="tWeb1Name" width="417">&nbsp;</td></tr>

<tr><td bgcolor="#FFFF00" ID="tWeb2" width="460"><font size="2">Enable Discussions on the New Web Site</font></td>

<td bgcolor="#FFFF00" ID="tWeb2Name" width="417">&nbsp;</td></tr>

<tr><td bgcolor="#FFFF00" ID="tWeb3" width="460"><font size="2">Modify the Security on the New Web Site</font></td>

<td bgcolor="#FFFF00" ID="tWeb3Name" width="417">&nbsp;</td></tr>

<tr><td bgcolor="#FFFF00" ID="tSubServer" width="460"><font size="2">Specify the Server Name to Use in Subscription E-mail Notifications</font></td>

<td bgcolor="#FFFF00" ID="tSubServerName" width="417">&nbsp;</td></tr>

<tr><td bgcolor="#FFFF00" ID="tIE" colspan="2" width="899"><font size="2">Internal FQDN Mapping: (Internet Explorer on server

configured to access server FQDN names - manually configure other internal clients by adding FQDN names to Intranet

zone or proxy server exception list)

<tr><td bgcolor="#FFFF00" width="397"><font size="2">Test the Extranet from Your Intranet</font></td>

<td bgcolor="#FFFF00" ID="tValidate" width="502"><font size="2">(click Validate Configuration below to test)</font></td></tr>

<tr><td bgcolor="#FFFF00" colspan="2" width="899"><font size="2">Test the Extranet from the Internet</font></td></tr>

<tr><td bgcolor="#FFFF00" colspan="2" width="899"><font size="2">Enable Secure Sockets Layer (SSL)</font></td></tr>

<tr><td bgcolor="#FFFF00" colspan="2" width="899"><font size="2">Enable SharePoint Portal Server to Crawl Sites on the Internet</font></td></tr>

<tr><td bgcolor="#FFFF00" colspan="2" width="899"><font size="2">Enable SharePoint Portal Server to

Crawl another SharePoint Portal Server Computer across the Internet</font></td></tr>

<tr><td bgcolor="#FFFF00" colspan="2" width="899"><font size="2">Configure the Proxy Server</font></td></tr>

</table>

<DIV ID="ProxyConfigText">

<br><b>Proxy Configuration Note:</b><br>

Because you did not specify a proxy server, a fake proxy server was configured for both Internet Explorer and the

portal (ServerXMLHTTP component). This is required for SharePoint Portal Server to work with Integrated Windows

authentication. The Internet Explorer proxy server exception list is configured to bypass the fake proxy server

for all addresses. If you use Internet Explorer on the SPS server - it will use the Intranet zone policy for all

sites accessed.

<br>If you are not using Integrated Windows (NTLM) authentication to access any of your SPS workspaces, you can

disable the fake proxy server in Internet Explorer and configure the SPS portal proxy server setting by running

"proxycfg -d".</DIV>

<p align="center">

<input type="button" name="FinishContinue" value="Validate Configuration">&nbsp;

<input type="button" id="Restart" value="Create New Configuration">&nbsp;

<input type="button" id="ValidateCancel" value="Exit Tool""></p></DIV>

<DIV ID="ValidatePage">

<p align="center"><b><font size="4">SPS Configuration Validation / Troubleshooting</font></b></p>

<p>Server hostname/workspace:

<input type="text" size="50" name="TestName"></p>

<p>Perform the following tasks to verify your server is working:</p>

<p>

<fieldset style="padding: 2">

<legend><input type="button" id="ViewWorkspace" value="View Workspace">&nbsp;&nbsp;&nbsp; </legend>

If you can view the portal and open the

Documents Library dashboard without error, you have successfully validated your

configuration. If the portal was not displayed correctly, the following may have occurred:</p>

<ul>

<li><b>Name Resolution:</b> <i>The Web site cannot be found.</i> Verify name resolution below. If you receive this message

and a proxy server error message, verify Internet Explorer is configured to bypass the proxy server for the server's FQDN name.</li>

<li><b>Security:</b> <i>HTTP/1.1 401 Unauthorized:</i> Verify the permissions to the SPS site for the account you

are using (or Internet Guest for Anonymous sites)</li>

<li><b>General:</b> <i>Script error -2147217895</i>: Reboot the server and try verification again.</li>

<li><b>General:</b> <i>Script error -2147221499</i>: Ensure

<SPAN id="ProxyLink"><u>proxycfg</u></SPAN> has the right settings

and your account does not have a blank password.</li></ul>

</fieldset>

<BR>

<fieldset>

<legend><input type="button" id="ViewTest" value="View Test Page">&nbsp;

<input type="button" id="ViewPing" value="Ping Host Name"></legend>

If you can view the temporary test page created by this script (spsconfigtest.asp),

you have validated that the virtual Web site and name resolution are working.

If 'pinging' your server's host name succeeds, you have validated that TCP/IP name resolution is working.

</fieldset>

<p>For further troubleshooting, refer to the SPS Extranet

<a target="_blank" href="http://www.microsoft.com/sharepoint/techinfo/Extranet.asp">white paper</a>.</p>

<p align="center">

&nbsp;&nbsp;

<input type="button" id="Restart2" value="Create New Configuration">&nbsp;

<input type="button" id="ValidateCancel2" value="Exit Tool"">

</form></DIV>

</body>

</html>

]]>

</resource>

</job>

--------------------------------------------------------------------------------------------------

Et voilà pas plus compliqué que cela ;+)

http://www.microsoft.com/sharepoint/techinfo/reskit/spsextranet.asp


(C) 2001 Microsoft Corporation. All rights reserved.

EROL / FICHE 34 : 21-févr.-2004 19:05:17 +0100  
 

 

Retour page Accueil ] Remonter ]

Envoyez un courrier électronique à EROL GIRAUDY (attention nospam dans l'E-mail) pour toute question ou remarque concernant ce site Web et visitez la rubrique Condition Utilisation et CNIL. Copyright © 2002 EROL (les sigles et logos ci-après sont la propriété de : Microsoft, Supinfo, Adobe, Compaq, HP, Sybari, Veritas, Moreover, K-map, Vyapin, Plumtree, Ixos, TooStore, K-Map, eRoom, DocKIT,NQL, Only4gurus, Nsius, Sharepointexperts, Iora, Erol, KCura, FrontPages, Nsi, Frontlook, IBuySpyPortal, moreover, slipstick, networknowledge, clubsps.org )
Dernière modification : samedi, 21. février 2004 19:05