Author Posts

January 1, 2012 at 12:00 am

by andyf at 2013-04-22 06:53:54

Hi all,
Basically I am following the guide below, I have re-installed exchange etc etc now I am trying to run the script to re-install the sbs2008 roles
http://exchangemaster.wordpress.com/2010/01/03/how-to-fully-re-install-exchange-on-sbs-2008-3/
The main problem I am having is with
New-OWAVirtualDirectory -WebsiteName “SBS Web Applications” -OwaVersion “Exchange2003or2000? -VirtualDirectoryType “Exadmin” -ExternalAuthenticationMethods Fba
New-OWAVirtualDirectory -WebsiteName “SBS Web Applications” -OwaVersion “Exchange2003or2000? -VirtualDirectoryType “Mailboxes” -ExternalAuthenticationMethods Fba
New-OWAVirtualDirectory -WebsiteName “SBS Web Applications” -OwaVersion “Exchange2003or2000? -VirtualDirectoryType “Exchweb” -ExternalAuthenticationMethods Fba
New-OWAVirtualDirectory -WebsiteName “SBS Web Applications” -OwaVersion “Exchange2003or2000? -VirtualDirectoryType “PublicFolders” -ExternalAuthenticationMethods Fba

When this is run it results in error:
Incomplete string token. At C:\Windows\System32\sbsALLrolereinstall.ps1:57 char:117 + New-OWAVirtualDirectory -WebsiteName "SBS Web Applications" -OwaVersion "Exchange2003or2000" -VirtualDirectoryType "M < <<< ailboxes" -ExternalAuthenticationMethods Fba
Any ideas how to fix this?
cheers

by andyf at 2013-04-22 07:37:40

Full Script

$LocalServerName = hostname$ActiveSyncMailboxName = "Windows SBS Mobile Mailbox Policy" + " " + $LocalServerName
$OABVDir = $LocalServerName + "\OAB (SBS Web Applications)"

$OAB = Get-OfflineAddressBook | Select-Object -Property Name

$strDomainDNS = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain().Name

$DomainAdmins = $strDomainDNS + "\Domain Admins"

$OrgName = Get-OrganizationConfig | Select-Object -Property DistinguishedName

$DefaultExchangeCertificate = "CN=" + $LocalServerName

Get-ExchangeCertificate | Where { $_.Subject -eq "$DefaultExchangeCertificate" } | ForEach { Remove-ExchangeCertificate -Thumbprint $_.Thumbprint }

Set-ForeignConnector "Windows SBS Company Web Connector $LocalServerName" -SourceTransportServers $LocalServerName

REG ADD HKLM\SYSTEM\CurrentControlSet\Services\MSExchangeIS\ParametersSystem /v "Disable MAPI Clients" /t REG_SZ /d 0.0.0-5.3164.0

Get-MailboxDatabase | Set-MailboxDatabase -OfflineAddressBook $OAB.Name -DeletedItemRetention "30.00:00:00?

Get-StorageGroup | Set-StorageGroup -CircularLoggingEnabled 1

Remove-OWAVirtualDirectory -Identity "Owa (Default Web Site)" -Confirm:$false

Remove-OWAVirtualDirectory -Identity "Exadmin (Default Web Site)" -Confirm:$false

Remove-OWAVirtualDirectory -Identity "Exchange (Default Web Site)" -Confirm:$false

Remove-OWAVirtualDirectory -Identity "Exchweb (Default Web Site)" -Confirm:$false

Remove-OWAVirtualDirectory -Identity "Public (Default Web Site)" -Confirm:$false

Remove-WebServicesVirtualDirectory -Identity "EWS (Default Web Site)" -Confirm:$false

Remove-ActiveSyncVirtualDirectory -Identity "Microsoft-Server-ActiveSync (Default Web Site)" -Confirm:$false

Remove-OabVirtualDirectory -Identity "OAB (Default Web Site)" -Force:$true -Confirm:$false

Remove-UMVirtualDirectory -Identity "UnifiedMessaging (Default Web Site)" -Confirm:$false

Remove-AutodiscoverVirtualDirectory -Identity "Autodiscover (Default Web Site)" -Confirm:$false

Remove-OWAVirtualDirectory -Identity "Exadmin (SBS Web Applications)" -Confirm:$false

Remove-OWAVirtualDirectory -Identity "Exchange (SBS Web Applications)" -Confirm:$false

Remove-OWAVirtualDirectory -Identity "Public (SBS Web Applications)" -Confirm:$false

New-OWAVirtualDirectory -WebsiteName "SBS Web Applications" -OwaVersion "Exchange2007? -ExternalAuthenticationMethods Fba

Set-OWAVirtualDirectory -InternalUrl "https://sites/owa/" -ClientAuthCleanupLevel "Low" -LogonFormat "UserName" -DefaultDomain $strDomainDNS -Identity "Owa (SBS Web Applications)"

New-OWAVirtualDirectory -WebsiteName "SBS Web Applications" -OwaVersion "Exchange2003or2000" -VirtualDirectoryType "Exadmin" -ExternalAutheticationMethods Fba
New-OWAVirtualDirectory -WebsiteName "SBS Web Applications" -OwaVersion "Exchange2003or2000" -VirtualDirectoryType "Mailboxes" -ExternalAutheticationMethods Fba
New-OWAVirtualDirectory -WebsiteName "SBS Web Applications" -OwaVersion "Exchange2003or2000" -VirtualDirectoryType "Exchweb" -ExternalAutheticationMethods Fba
New-OWAVirtualDirectory -WebsiteName "SBS Web Applications" -OwaVersion "Exchange2003or2000" -VirtualDirectoryType "Publicfolders" -ExternalAutheticationMethods Fba

New-WebServicesVirtualDirectory -WebsiteName "SBS Web Applications" -InternalUrl "https://Sites/EWS/Exchange.asmx" -basicauthentication 1 -windowsauthentication 1

New-ActiveSyncVirtualDirectory -WebsiteName "SBS Web Applications" -InternalUrl "https://Sites/Microsoft-Server-ActiveSync" -ExternalAuthenticationMethods Basic -InternalAuthenticationMethods Basic

New-OabVirtualDirectory -WebsiteName "SBS Web Applications" -InternalUrl "https://Sites/OAB"

Set-OabVirtualDirectory -PollInterval "30" -Identity "oab (sbs web applications)"

New-UMVirtualDirectory -WebsiteName "SBS Web Applications" -InternalUrl "https://Sites/UnifiedMessaging/Service.asmx"

New-AutodiscoverVirtualDirectory -WebsiteName "SBS Web Applications" -InternalUrl "https://Sites/Autodiscover/Autodiscover.xml" -BasicAuthentication 1 -WindowsAuthentication 1

Set-ClientAccessServer -Identity $LocalServerName -AutoDiscoverServiceInternalUri "https://sites/Autodiscover/Autodiscover.xml"

Set-OfflineAddressBook $OAB.Name -VirtualDirectories $OABVDir -Versions Version2,Version3,Version4 -PublicFolderDistributionEnabled:$True

iisreset /noforce

cd $env:windir\system32\inetsrv

.\appcmd.exe unlock config "-section:system.webserver/security/authentication/windowsauthentication"

.\appcmd.exe set config "SBS Web Applications/ews" "-section:windowsAuthentication" "-useKernelMode:False" /commit:apphost

.\appcmd.exe set config "SBS Web Applications/AutoDiscover" "-section:windowsAuthentication" "-useKernelMode:False" /commit:apphost

.\appcmd.exe set config "SBS Web Applications/oab" "-section:windowsAuthentication" "-useKernelMode:False" /commit:apphost

.\appcmd.exe set site "Default Web Site" /Bindings:http/*:80:

.\appcmd.exe start site "Default Web Site"

.\appcmd.exe start site "SBS Web Applications"