This repository has been archived by the owner on Dec 6, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 395
/
uninstall-xp0.ps1
71 lines (68 loc) · 2.52 KB
/
uninstall-xp0.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#####################################################
#
# Uninstall Sitecore
#
#####################################################
$ErrorActionPreference = "Stop"
. $PSScriptRoot\settings.ps1
Write-Host "*******************************************************" -ForegroundColor Green
Write-Host " Uninstalling Sitecore $SitecoreVersion" -ForegroundColor Green
Write-Host " Sitecore: $SitecoreSiteName" -ForegroundColor Green
Write-Host " xConnect: $XConnectSiteName" -ForegroundColor Green
Write-Host "*******************************************************" -ForegroundColor Green
Push-Location $AssetsRoot
$uninstallParams = @{
Path = $SingleDeveloperConfiguration
SqlServer = $SqlServer
SqlAdminUser = $SqlAdminUser
SqlAdminPassword = $SqlAdminPassword
SolrUrl = $SolrUrl
SolrRoot = $SolrRoot
SolrService = $SolrService
Prefix = $SolutionPrefix
XConnectCertificateName = $XConnectSiteName
IdentityServerCertificateName = $IdentityServerSiteName
IdentityServerSiteName = $IdentityServerSiteName
LicenseFile = $LicenseFile
XConnectPackage = $XConnectPackage
SitecorePackage = $SitecorePackage
IdentityServerPackage = $IdentityServerPackage
XConnectSiteName = $XConnectSiteName
SitecoreSitename = $SitecoreSiteName
PasswordRecoveryUrl = $SitecoreSiteUrl
SitecoreIdentityAuthority = $IdentityServerUrl
XConnectCollectionService = $XConnectSiteUrl
ClientSecret = $IdentityClientSecret
AllowedCorsOrigins = $IdentityAllowedCorsOrigins
SitecoreAdminPassword = $SitecoreAdminPassword
}
try {
Uninstall-SitecoreConfiguration @uninstallParams *>&1 | Tee-Object XP0-SingleDeveloper-Uninstall.log
}
catch
{
write-host "Sitecore XP0 Single Developer Uninstall Failed" -ForegroundColor Red
throw
}
finally {
Pop-Location
}
# Remove App Pool membership
try
{
Remove-LocalGroupMember "Performance Log Users" "IIS AppPool\$SitecoreSiteName"
Write-Host "Removed IIS AppPool\$SitecoreSiteName from Performance Log Users" -ForegroundColor Green
}
catch
{
Write-Host "Could not find IIS AppPool\$SitecoreSiteName in Performance Log Users" -ForegroundColor Yellow
}
try
{
Remove-LocalGroupMember "Performance Monitor Users" "IIS AppPool\$SitecoreSiteName"
Write-Host "Removed IIS AppPool\$SitecoreSiteName from Performance Monitor Users" -ForegroundColor Green
}
catch
{
Write-Host "Could not find IIS AppPool\$SitecoreSiteName to Performance Monitor Users" -ForegroundColor Yellow
}