├── .gitignore ├── AutoSPInstallerFolderStructure.txt ├── LICENSE ├── README.md └── SP ├── 2010 ├── ForeFront │ └── PutExtractedForefrontProtection2010ForSharePointSetupFilesHere.txt ├── LanguagePacks │ └── PutLanguagePacksHere.txt ├── OfficeWebApps │ └── PutOfficeWebAppsFilesHere.txt ├── PDF │ └── ReadMe.txt ├── SharePoint │ └── CopyTheContentsOfTheSharePointMediaHere.txt └── Updates │ └── PutUpdatePackagesHere.txt ├── 2013 ├── ForeFront │ └── PutExtractedForefrontProtection2010ForSharePointSetupFilesHere.txt ├── LanguagePacks │ └── PutLanguagePacksHere.txt ├── ProjectServer │ └── CopyTheContentsOfTheProjectServer2013MediaHere.txt ├── SharePoint │ ├── CopyTheContentsOfTheSharePointMediaHere.txt │ └── prerequisiteinstallerfiles │ │ └── sxs │ │ └── CopyDotNetFrameworkSourceFilesHere.txt └── Updates │ └── PutUpdatePackagesHere.txt ├── 2016 ├── LanguagePacks │ └── PutLanguagePacksHere.txt ├── SharePoint │ ├── CopyTheContentsOfTheSharePointMediaHere.txt │ └── prerequisiteinstallerfiles │ │ └── sxs │ │ └── CopyDotNetFrameworkSourceFilesHere.txt └── Updates │ └── PutUpdatePackagesHere.txt ├── 2019 ├── LanguagePacks │ └── PutLanguagePacksHere.txt ├── SharePoint │ ├── CopyTheContentsOfTheSharePointMediaHere.txt │ └── prerequisiteinstallerfiles │ │ └── sxs │ │ └── CopyDotNetFrameworkSourceFilesHere.txt └── Updates │ └── PutUpdatePackagesHere.txt ├── Automation ├── AutoSPInstallerConfigureRemoteTarget.ps1 ├── AutoSPInstallerInput.xml ├── AutoSPInstallerLaunch.bat ├── AutoSPInstallerMain.ps1 └── AutoSPInstallerModule.psm1 └── SE ├── LanguagePacks └── PutLanguagePacksHere.txt ├── SharePoint └── CopyTheContentsOfTheSharePointMediaHere.txt └── Updates └── PutUpdatePackagesHere.txt /.gitignore: -------------------------------------------------------------------------------- 1 | .vs/VSWorkspaceState.json 2 | .vs/slnx.sqlite 3 | .vs/AutoSPInstaller/v15/.suo 4 | /.vs 5 | -------------------------------------------------------------------------------- /AutoSPInstallerFolderStructure.txt: -------------------------------------------------------------------------------- 1 | \SP\Automation\AutoSPInstallerLaunch.bat 2 | \SP\Automation\AutoSPInstallerInput.xml 3 | \SP\Automation\AutoSPInstallerMain.ps1 4 | \SP\Automation\AutoSPInstallerModule.psm1 5 | \SP\Automation\AutoSPInstallerConfigureRemoteTarget.ps1 6 | \SP\Automation\README.md 7 | 8 | \SP\201x (SharePoint 2010, 2013, 2016, 2019, or SE binary files - e.g. \2019\ or \SE\ - in different folders) 9 | 10 | \SP\201x\LanguagePacks\xx-xx\ (optional) 11 | \SP\201x\LanguagePacks\xx-xx\Updates\ (extract Language Pack Service Pack / Cumulative/Public Updates here) (optional) 12 | OR 13 | \SP\201x\LanguagePacks\ 14 | 15 | \SP\201x\SharePoint\ 16 | \SP\201x\SharePoint\PrerequisiteInstallerFiles\ 17 | \SP\2013\SharePoint\PrerequisiteInstallerFiles\sxs (optional, for offline install of .Net Framework 3.5.1 on Windows 2012/2016) 18 | \SP\201x\SharePoint\Updates (optional, for slipstreaming Service Packs and Public/Cumulative Updates. NOTE not all updates support slipstreaming!) 19 | \SP\2010\OfficeWebApps\ (optional, only required/supported with SP2010) 20 | \SP\201x\PDF\ (optional) 21 | \SP\201x\PDF\pdficon_small.png (optional) 22 | \SP\2010\PDF\PDFiFilter64installer.zip (optional, only required/supported with SP2010) 23 | \SP\2010\PDF\PDFiFilter64installer.msi (optional, only required/supported with SP2010) 24 | \SP\201x\ForeFront\ (optional) 25 | 26 | \SP\2013\ProjectServer\ (copy/extract the contents of the Project Server 2013 DVD/ISO here) 27 | \SP\2013\ProjectServer\Updates (optional, for slipstreaming Service Packs and Public/Cumulative Updates. NOTE not all updates support slipstreaming!) 28 | 29 | \SP\201x\Updates (optional, for installation of SharePoint or Project Server Public/Cumulative Updates instead of or in addition to slipstreaming) -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Brian Lalancette 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AutoSPInstaller 2 | Automated SharePoint 2010/2013/2016/2019/SE PowerShell-based installation tool. 3 | 4 | This project was migrated to GitHub from CodePlex, where it was downloaded over 130,000 times! 5 | 6 | Love AutoSPInstaller? Has it saved you or your company time and money? Have you used it in any of your or your customers' projects or deployments? If so, why not consider [donating](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=QQPQPFRUTVWJJ&lc=CA&item_name=Brian%20Lalancette%27s%20Github%20Projects:&item_number=AutoSPInstaller¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted") towards its ongoing support and development! 7 | -------------------------------------------------------------------------------- /SP/2010/ForeFront/PutExtractedForefrontProtection2010ForSharePointSetupFilesHere.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brianlala/AutoSPInstaller/6c4bcd0b9b40f9e4ba0b492fd634f67414e8b7f1/SP/2010/ForeFront/PutExtractedForefrontProtection2010ForSharePointSetupFilesHere.txt -------------------------------------------------------------------------------- /SP/2010/LanguagePacks/PutLanguagePacksHere.txt: -------------------------------------------------------------------------------- 1 | The best approach is to extract the contents of the downloaded language pack(s) to corresponding subfolders like: 2 | \fr-fr 3 | \de-de 4 | ... 5 | 6 | If you are slipstreaming updates in your SharePoint 201x installation media, make sure you also extract the corresponding language pack updates to the \xx-xx\Updates folder for each language pack. 7 | 8 | Alternately, you can just place the monolithic language pack installers (ServerLanguagePack_XX-XX.exe) along with any update packages (e.g. serverlanguagepack2010sp1-kb2460056-x64-fullfile-xx-xx.exe) in the root of this folder. 9 | Note that updates may not get applied completely in this manner and you may need to re-apply any CUs after the SharePoint config is complete. -------------------------------------------------------------------------------- /SP/2010/OfficeWebApps/PutOfficeWebAppsFilesHere.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brianlala/AutoSPInstaller/6c4bcd0b9b40f9e4ba0b492fd634f67414e8b7f1/SP/2010/OfficeWebApps/PutOfficeWebAppsFilesHere.txt -------------------------------------------------------------------------------- /SP/2010/PDF/ReadMe.txt: -------------------------------------------------------------------------------- 1 | You can pre-download the Adobe PDF iFilter from here: http://download.adobe.com/pub/adobe/acrobat/win/9.x/PDFiFilter64installer.zip 2 | 3 | The official PDF icon is available here: http://helpx.adobe.com/content/dam/kb/en/837/cpsid_83709/attachments/AdobePDF.png 4 | 5 | 6 | Place the .zip (or the extracted .msi) in this folder along with the AdobePDF.png, and AutoSPInstaller can automatically install them in order to be able to index PDF files and display the icon properly in SharePoint search results, document libraries, etc. -------------------------------------------------------------------------------- /SP/2010/SharePoint/CopyTheContentsOfTheSharePointMediaHere.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brianlala/AutoSPInstaller/6c4bcd0b9b40f9e4ba0b492fd634f67414e8b7f1/SP/2010/SharePoint/CopyTheContentsOfTheSharePointMediaHere.txt -------------------------------------------------------------------------------- /SP/2010/Updates/PutUpdatePackagesHere.txt: -------------------------------------------------------------------------------- 1 | You can place the monolithic Public Update or Cumulative Update pack installers (e.g. ubersrv2010-kb2775353-fullfile-x64-glb.exe) in either the root or subfolders here and they will automatically be applied. 2 | 3 | To exclude certain update files from being detected/applied, or certain subfolders from being scanned (e.g. for testing), you can simply set their "hidden" attribute. 4 | 5 | This is an alternative to the slipstream method that may be more reliable in a broader range of scenarios. -------------------------------------------------------------------------------- /SP/2013/ForeFront/PutExtractedForefrontProtection2010ForSharePointSetupFilesHere.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brianlala/AutoSPInstaller/6c4bcd0b9b40f9e4ba0b492fd634f67414e8b7f1/SP/2013/ForeFront/PutExtractedForefrontProtection2010ForSharePointSetupFilesHere.txt -------------------------------------------------------------------------------- /SP/2013/LanguagePacks/PutLanguagePacksHere.txt: -------------------------------------------------------------------------------- 1 | The best approach is to extract the contents of the downloaded language pack(s) to corresponding subfolders like: 2 | \fr-fr 3 | \de-de 4 | ... 5 | 6 | If you are slipstreaming updates in your SharePoint 201x installation media, make sure you also extract the corresponding language pack updates to the \xx-xx\Updates folder for each language pack. 7 | 8 | Alternately, you can just place the monolithic language pack installers (ServerLanguagePack_XX-XX.exe) along with any update packages (e.g. serverlanguagepack2010sp1-kb2460056-x64-fullfile-xx-xx.exe) in the root of this folder. 9 | Note that updates may not get applied completely in this manner and you may need to re-apply any CUs after the SharePoint config is complete. -------------------------------------------------------------------------------- /SP/2013/ProjectServer/CopyTheContentsOfTheProjectServer2013MediaHere.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brianlala/AutoSPInstaller/6c4bcd0b9b40f9e4ba0b492fd634f67414e8b7f1/SP/2013/ProjectServer/CopyTheContentsOfTheProjectServer2013MediaHere.txt -------------------------------------------------------------------------------- /SP/2013/SharePoint/CopyTheContentsOfTheSharePointMediaHere.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brianlala/AutoSPInstaller/6c4bcd0b9b40f9e4ba0b492fd634f67414e8b7f1/SP/2013/SharePoint/CopyTheContentsOfTheSharePointMediaHere.txt -------------------------------------------------------------------------------- /SP/2013/SharePoint/prerequisiteinstallerfiles/sxs/CopyDotNetFrameworkSourceFilesHere.txt: -------------------------------------------------------------------------------- 1 | Copy files from the Windows Server 201x ISO (in \support\sxs) here to use them as a source for the offline installation of the .Net Framework 3.5.1 -------------------------------------------------------------------------------- /SP/2013/Updates/PutUpdatePackagesHere.txt: -------------------------------------------------------------------------------- 1 | You can place the monolithic Public Update or Cumulative Update pack installers (e.g. ubersrv2013-kb4484320-fullfile-x64-glb) in either the root or subfolders here and they will automatically be applied. 2 | 3 | To exclude certain update files from being detected/applied, or certain subfolders from being scanned (e.g. for testing), you can simply set their "hidden" attribute. 4 | 5 | This is an alternative to the slipstream method that may be more reliable in a broader range of scenarios. -------------------------------------------------------------------------------- /SP/2016/LanguagePacks/PutLanguagePacksHere.txt: -------------------------------------------------------------------------------- 1 | The best approach is to extract the contents of the downloaded language pack(s) to corresponding subfolders like: 2 | \fr-fr 3 | \de-de 4 | ... 5 | 6 | If you are slipstreaming updates in your SharePoint 201x installation media, make sure you also extract the corresponding language pack updates to the \xx-xx\Updates folder for each language pack. 7 | 8 | Alternately, you can just place the monolithic language pack installers (ServerLanguagePack_XX-XX.exe) along with any update packages (e.g. serverlanguagepack2010sp1-kb2460056-x64-fullfile-xx-xx.exe) in the root of this folder. 9 | Note that updates may not get applied completely in this manner and you may need to re-apply any CUs after the SharePoint config is complete. -------------------------------------------------------------------------------- /SP/2016/SharePoint/CopyTheContentsOfTheSharePointMediaHere.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brianlala/AutoSPInstaller/6c4bcd0b9b40f9e4ba0b492fd634f67414e8b7f1/SP/2016/SharePoint/CopyTheContentsOfTheSharePointMediaHere.txt -------------------------------------------------------------------------------- /SP/2016/SharePoint/prerequisiteinstallerfiles/sxs/CopyDotNetFrameworkSourceFilesHere.txt: -------------------------------------------------------------------------------- 1 | Copy files from the Windows Server 201x ISO (in \support\sxs) here to use them as a source for the offline installation of the .Net Framework 3.5.1 -------------------------------------------------------------------------------- /SP/2016/Updates/PutUpdatePackagesHere.txt: -------------------------------------------------------------------------------- 1 | You can place the monolithic Public Update or Cumulative Update pack installers (e.g. sts2016-kb4484299-fullfile-x64-glb.exe) in either the root or subfolders here and they will automatically be applied. 2 | 3 | To exclude certain update files from being detected/applied, or certain subfolders from being scanned (e.g. for testing), you can simply set their "hidden" attribute. 4 | 5 | This is an alternative to the slipstream method that may be more reliable in a broader range of scenarios. -------------------------------------------------------------------------------- /SP/2019/LanguagePacks/PutLanguagePacksHere.txt: -------------------------------------------------------------------------------- 1 | The best approach is to extract the contents of the downloaded language pack(s) to corresponding subfolders like: 2 | \fr-fr 3 | \de-de 4 | ... 5 | 6 | If you are slipstreaming updates in your SharePoint 201x installation media, make sure you also extract the corresponding language pack updates to the \xx-xx\Updates folder for each language pack. 7 | 8 | Alternately, you can just place the monolithic language pack installers (ServerLanguagePack_XX-XX.exe) along with any update packages (e.g. serverlanguagepack2010sp1-kb2460056-x64-fullfile-xx-xx.exe) in the root of this folder. 9 | Note that updates may not get applied completely in this manner and you may need to re-apply any CUs after the SharePoint config is complete. -------------------------------------------------------------------------------- /SP/2019/SharePoint/CopyTheContentsOfTheSharePointMediaHere.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brianlala/AutoSPInstaller/6c4bcd0b9b40f9e4ba0b492fd634f67414e8b7f1/SP/2019/SharePoint/CopyTheContentsOfTheSharePointMediaHere.txt -------------------------------------------------------------------------------- /SP/2019/SharePoint/prerequisiteinstallerfiles/sxs/CopyDotNetFrameworkSourceFilesHere.txt: -------------------------------------------------------------------------------- 1 | Copy files from the Windows Server 201x ISO (in \support\sxs) here to use them as a source for the offline installation of the .Net Framework 3.5.1 -------------------------------------------------------------------------------- /SP/2019/Updates/PutUpdatePackagesHere.txt: -------------------------------------------------------------------------------- 1 | You can place the monolithic Public Update or Cumulative Update pack installers (e.g. sts2019-kb4484292-fullfile-x64-glb.exe) in either the root or subfolders here and they will automatically be applied. 2 | 3 | To exclude certain update files from being detected/applied, or certain subfolders from being scanned (e.g. for testing), you can simply set their "hidden" attribute. 4 | 5 | This is an alternative to the slipstream method that may be more reliable in a broader range of scenarios. -------------------------------------------------------------------------------- /SP/Automation/AutoSPInstallerConfigureRemoteTarget.ps1: -------------------------------------------------------------------------------- 1 | # Configures the server for WinRM and WSManCredSSP 2 | Write-Host "Configuring PowerShell remoting..." 3 | $winRM = Get-Service -Name winrm 4 | If ($winRM.Status -ne "Running") {Start-Service -Name winrm} 5 | Set-ExecutionPolicy Bypass -Force 6 | Enable-PSRemoting -Force 7 | Enable-WSManCredSSP -Role Server -Force | Out-Null 8 | # Increase the local memory limit to 1 GB 9 | Set-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB 1024 10 | 11 | #Get out of this PowerShell process 12 | Stop-Process -Id $PID -Force 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /SP/Automation/AutoSPInstallerInput.xml: -------------------------------------------------------------------------------- 1 |  2 | 21 | 24 | 25 | 28 | 29 | 31 | config-AutoSPInstaller.xml 32 | 35 | 36 | 38 | 39 | 40 | 41 | 42 | Enterprise 43 | 46 | false 47 | 49 | false 50 | 51 | 52 | 54 | false 55 | 56 | 60 | 61 | 62 | 63 | 64 | 66 | true 67 | 68 | true 69 | 70 | true 71 | 73 | false 74 | 75 | 76 | 77 | 78 | 79 | 80 | 83 | 84 | true 85 | false 86 | CONTOSO\SP_Farm 87 | 88 | 89 | 90 | 91 | Content_CentralAdmin 92 | 2019 93 | true 94 | 95 | 96 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | SERVER\INSTANCE 107 | 108 | 109 | 115 | AutoSPInstaller 116 | 117 | Config 118 | 119 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 136 | 137 | 139 | 140 | 141 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 159 | 160 | CONTOSO\SP_Services 161 | 162 | 163 | 164 | CONTOSO\SP_PortalAppPool 165 | 166 | 167 | 168 | CONTOSO\SP_ProfilesAppPool 169 | 170 | 171 | 172 | CONTOSO\SP_SearchService 173 | 174 | 175 | 176 | 178 | 179 | CONTOSO\SP_CacheSuperUser 180 | CONTOSO\SP_CacheSuperReader 181 | 182 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 214 | 215 | 234 | 235 | Portal 236 | portal.contoso.com 237 | http://portal.contoso.com 238 | 80 239 | false 240 | true 241 | true 242 | true 243 | false 244 | false 245 | 246 | 247 | 248 | Content_Portal 249 | 251 | 252 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | SERVER\INSTANCE 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 282 | 283 | Portal Home 284 | Portal Home Site 285 | false 286 | 287 | 288 | http://portal.contoso.com/search 289 | 290 | 1033 291 | en-us 292 | false 293 | 294 | 295 | 296 | 297 | MySiteHost 298 | mysites.contoso.com 299 | http://mysites.contoso.com 300 | 80 301 | true 302 | true 303 | true 304 | true 305 | false 306 | false 307 | 308 | 309 | 310 | Content_MySites 311 | 313 | 314 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | SERVER\INSTANCE 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | My Site Host 332 | My Site Host 333 | false 334 | 335 | 336 | http://portal.contoso.com/search 337 | 338 | 1033 339 | en-us 340 | false 341 | 342 | 343 | 344 | 345 | 350 | 351 | 352 | Managed Metadata Service 353 | Managed Metadata Service 354 | 355 | 356 | 357 | Metadata 358 | 360 | 361 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | SERVER\INSTANCE 370 | 371 | 372 | 373 | 374 | 383 | 384 | User Profile Service Application 385 | User Profile Service Application 386 | 387 | personal 388 | false 389 | true 390 | false 391 | CONTOSO\SP_ProfileSync 392 | 393 | 394 | 395 | 396 | Profile 397 | Profile_Sync 398 | Profile_Social 399 | 401 | 402 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | SERVER\INSTANCE 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 60 419 | 60 420 | Default 421 | true 422 | Mozilla/4.0 (compatible; MSIE 4.01; Windows NT; MS Search 6.0 Robot) 423 | 424 | PartlyReduced 425 | SearchIndex 426 | 427 | 428 | 429 | false 430 | 1 431 | Regular 432 | CONTOSO\SP_SearchContent 433 | 434 | 435 | 436 | Search 437 | 439 | 440 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | SERVER\INSTANCE 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | false 469 | Default 470 | 471 | 474 | 475 | 476 | 477 | 478 | 479 | State Service 480 | State Service 481 | 482 | 483 | 484 | StateService 485 | 487 | 488 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | SERVER\INSTANCE 497 | 498 | 499 | 500 | 501 | 502 | 503 | Web Analytics Service Application 504 | 505 | 506 | 507 | WebAnalyticsReporting 508 | WebAnalyticsStaging 509 | 511 | 512 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | SERVER\INSTANCE 521 | 522 | 523 | 524 | 525 | 526 | Usage and Health Data Collection 527 | 528 | 529 | 530 | UsageAndHealth 531 | 533 | 534 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | SERVER\INSTANCE 543 | 544 | 545 | 546 | 547 | 548 | Secure Store Service 549 | Secure Store Service 550 | 551 | 552 | 553 | SecureStore 554 | 556 | 557 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | SERVER\INSTANCE 566 | 567 | 568 | 569 | 570 | 571 | Business Data Connectivity Service 572 | Business Data Connectivity Service 573 | 574 | 575 | 576 | BusinessDataCatalog 577 | 579 | 580 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | SERVER\INSTANCE 589 | 590 | 591 | 592 | 593 | 594 | Word Automation Services 595 | Word Automation Services 596 | 597 | 598 | 599 | WordAutomation 600 | 602 | 603 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | SERVER\INSTANCE 612 | 613 | 614 | 615 | 616 | 617 | 618 | App Management Service 619 | App Management Service 620 | apps.contoso.com 621 | 622 | 623 | 624 | AppManagement 625 | 627 | 628 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | SERVER\INSTANCE 637 | 638 | 639 | 640 | 641 | 642 | 643 | Subscription Settings Service 644 | app 645 | 646 | 647 | 648 | SubscriptionSettings 649 | 651 | 652 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | SERVER\INSTANCE 661 | 662 | 663 | 664 | 665 | 666 | 667 | Work Management Service Application 668 | Work Management Service Application 669 | 670 | 671 | 672 | Machine Translation Service 673 | Machine Translation Service 674 | 675 | 676 | 677 | TranslationService 678 | 680 | 681 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | SERVER\INSTANCE 690 | 691 | 692 | 693 | 694 | 695 | 696 | PowerPoint Conversion Service Application 697 | PowerPoint Conversion Service Application 698 | 699 | 700 | 704 | 705 | 706 | Excel Services Application 707 | CONTOSO\SP_ExcelUser 708 | 709 | 710 | 711 | Visio Graphics Service 712 | Visio Graphics Service 713 | CONTOSO\SP_VisioUser 714 | 715 | 716 | 717 | 718 | Access 2010 Service 719 | Access 2010 Service 720 | 721 | 722 | 723 | Access Services 724 | Access Services 725 | 726 | 727 | 728 | AccessServices 729 | 731 | 732 | 734 | 735 | 736 | 737 | 738 | 739 | 740 | SERVER\INSTANCE 741 | 742 | 743 | 744 | 745 | 746 | 747 | PerformancePoint Service 748 | PerformancePoint Service 749 | CONTOSO\SP_PerfPointUser 750 | 751 | 752 | 753 | 754 | PerformancePoint 755 | 757 | 758 | 760 | 761 | 762 | 763 | 764 | 765 | 766 | SERVER\INSTANCE 767 | 768 | 769 | 770 | 771 | 772 | 774 | 775 | config-OWA-2010.xml 776 | 777 | 778 | Excel Web App 779 | Excel Web App 780 | CONTOSO\SP_ExcelUser 781 | 782 | 783 | 784 | Word Viewing Service 785 | Word Viewing Service 786 | 787 | 788 | PowerPoint Service Application 789 | PowerPoint Service Application 790 | 791 | 792 | 795 | 796 | config-ProjectServer2013.xml 797 | 798 | 799 | Project Server Service Application 800 | Project Server Service Application 801 | PWA 802 | CONTOSO\SP_ProjectServer 803 | 804 | 805 | 806 | 807 | ProjectServer 808 | 810 | 811 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | SERVER\INSTANCE 820 | 821 | 822 | 823 | 824 | 825 | 827 | 828 | 829 | 830 | 831 | 832 | 833 | 834 | 836 | 837 | answerfile-ForeFront-2010.xml 838 | 839 | -------------------------------------------------------------------------------- /SP/Automation/AutoSPInstallerLaunch.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | SETLOCAL 3 | cls 4 | @TITLE -- AutoSPInstaller -- 5 | FOR /F "tokens=2-4 delims=/ " %%i IN ('date /t') DO SET SHORTDATE=%%i-%%j-%%k 6 | FOR /F "tokens=1-3 delims=: " %%i IN ('time /t') DO SET SHORTTIME=%%i-%%j%%k 7 | :: Updated to support passing the input XML file as an argument to this batch file 8 | IF "%1"=="" GOTO GETINPUT 9 | IF EXIST "%~dp0\%1" Set InputFile="%~dp0\%1" 10 | IF EXIST "%1" Set InputFile="%1" 11 | ECHO - Specified Input File: 12 | ECHO - %InputFile% 13 | GOTO START 14 | :GETINPUT 15 | IF EXIST "%~dp0\AutoSPInstallerInput-%COMPUTERNAME%.xml" ( 16 | Set InputFile="%~dp0\AutoSPInstallerInput-%COMPUTERNAME%.xml" 17 | ECHO - Using %COMPUTERNAME%-specific Input File. 18 | GOTO START 19 | ) 20 | IF EXIST "%~dp0\AutoSPInstallerInput-%USERDOMAIN%.xml" ( 21 | Set InputFile="%~dp0\AutoSPInstallerInput-%USERDOMAIN%.xml" 22 | ECHO - Using %USERDOMAIN%-specific Input File. 23 | GOTO START 24 | ) 25 | IF EXIST "%~dp0\AutoSPInstallerInput.xml" ( 26 | Set InputFile="%~dp0\AutoSPInstallerInput.xml" 27 | ECHO - Using standard Input File. 28 | GOTO START 29 | ) 30 | ECHO - Input File not found! Please check for AutoSPInstallerInput.xml, AutoSPInstallerInput-%USERDOMAIN%.xml, or AutoSPInstallerInput-%COMPUTERNAME%.xml 31 | GOTO END 32 | :START 33 | :: Check for PowerShell 34 | IF NOT EXIST "%SYSTEMROOT%\system32\windowspowershell\v1.0\powershell.exe" ( 35 | COLOR 0C 36 | ECHO - "powershell.exe" not found! 37 | ECHO - This script requires PowerShell - install v2.0/3.0, then re-run this script. 38 | COLOR 39 | pause 40 | EXIT 41 | ) 42 | :: Check for PowerShell v2.0 (minimum) 43 | ECHO - Checking for PowerShell 2.0 (minimum)... 44 | "%SYSTEMROOT%\system32\windowspowershell\v1.0\powershell.exe" $host.Version.Major | find "1" >nul 45 | IF %ERRORLEVEL% == 0 ( 46 | COLOR 0C 47 | ECHO - This script requires a minimum PowerShell version of 2.0! 48 | ECHO - Please uninstall v1.0, install v2.0/3.0, then re-run this script. 49 | COLOR 50 | pause 51 | EXIT 52 | ) 53 | ECHO - OK. 54 | GOTO LAUNCHSCRIPT 55 | :LAUNCHSCRIPT 56 | ECHO - Starting AutoSPInstaller... 57 | "%SYSTEMROOT%\system32\windowspowershell\v1.0\powershell.exe" -Command Start-Process "$PSHOME\powershell.exe" -Verb RunAs -ArgumentList "'-NoExit -ExecutionPolicy Bypass %~dp0\AutoSPInstallerMain.ps1 %InputFile%'" 58 | GOTO END 59 | :END 60 | ECHO - AutoSPInstaller launched - finished with AutoSPInstallerLaunch.bat. 61 | pause 62 | ENDLOCAL -------------------------------------------------------------------------------- /SP/Automation/AutoSPInstallerMain.ps1: -------------------------------------------------------------------------------- 1 | param 2 | ( 3 | [string]$inputFile = $(throw '- Need parameter input file (e.g. "\\SPSERVER01\C$\SP\AutoSPInstaller\AutoSPInstallerInput.xml")'), 4 | [string]$targetServer = "", 5 | [string]$remoteAuthPassword = "", 6 | [switch]$Unattended 7 | ) 8 | 9 | # Globally update all instances of "localhost" in the input file to actual local server name 10 | [xml]$xmlInput = (Get-Content $inputFile -ErrorAction Inquire) -replace ("localhost", $env:COMPUTERNAME) # "-ErrorAction Inquire" should show something meaningful now instead of just quickly skipping over a bad or malformed XML 11 | 12 | # =================================================================================== 13 | # 14 | # AutoSPInstaller - See # MAIN for what to run 15 | # 16 | # =================================================================================== 17 | 18 | #region Setup Paths & Environment 19 | 20 | $Host.UI.RawUI.WindowTitle = " -- AutoSPInstaller -- $env:COMPUTERNAME --" 21 | $Host.UI.RawUI.BackgroundColor = "Black" 22 | Clear-Host 23 | $0 = $myInvocation.MyCommand.Definition 24 | $env:dp0 = [System.IO.Path]::GetDirectoryName($0) 25 | $env:bits = Get-Item $env:dp0 | Split-Path -Parent 26 | 27 | #region Source External Functions 28 | Write-Host -ForegroundColor White " - Importing AutoSPInstaller PowerShell Module..." 29 | Import-Module -Name "$env:dp0\AutoSPInstallerModule.psm1" -Force 30 | #endregion 31 | 32 | # Create hash table with product year to major version mappings 33 | $spVersions = @{"2010" = "14"; "2013" = "15"; "2016" = "16"; "2019" = "16"; "SE" = "16"} # SharePoint 2019 and SE still use major build 16 34 | $spYear = $xmlInput.Configuration.Install.SPVersion 35 | if ([string]::IsNullOrEmpty($spYear)) 36 | { 37 | throw "SharePoint version (year) was not specified in `"$inputFile`"" 38 | } 39 | 40 | if ($xmlInput.Configuration.Install.SKU -eq "Foundation") {$product = "Foundation"} 41 | else {$product = "SharePoint"} 42 | 43 | # Check if SharePoint binaries are in the \SP20xx\$product subfolder as per new folder structure 44 | # Look for SP2013+ 45 | If ($spYear -ge 2013) 46 | { 47 | if (Test-Path -Path "$env:bits\$($spYear)\$product\setup.exe" -ErrorAction SilentlyContinue) 48 | { 49 | $env:SPbits = $env:bits+"\$($spYear)\$product" 50 | } 51 | else {Write-Host -ForegroundColor Yellow " - SP$($spYear) was specified in $($inputfile.replace($env:bits,'')),`n - but $env:bits\$($spYear)\$product\setup.exe was not found. Looking for SP2010..."} 52 | } 53 | # If 2013+ bits aren't found, look for SP2010 bits and ensure they match the value specified in $xmlInput 54 | ElseIf ((Test-Path -Path "$env:bits\2010\$product\setup.exe" -ErrorAction SilentlyContinue) -and ($spYear -eq "2010")) 55 | { 56 | $env:SPbits = $env:bits+"\2010\$product" 57 | } 58 | Elseif (Test-Path -Path "$env:bits\$product\setup.exe" -ErrorAction SilentlyContinue) # Use old path convention 59 | { 60 | $env:SPbits = $env:bits+"\$product" 61 | } 62 | if ([string]::IsNullOrEmpty($env:SPbits)) 63 | { 64 | # Changed this to a warning in case we just want to create/configure a farm and are sure that SharePoint is pre-installed 65 | Write-Warning "Cannot locate SharePoint binaries; please check that the files are in the \$product subfolder as per new folder structure." 66 | Pause "proceed if you know that SharePoint is already installed, or Ctrl-C to exit" "y" 67 | # If no setup binaries are present, this might be OK if SharePoint is already installed and we've specified the version in the XML 68 | $spInstalled = $true 69 | # Check to see that we've at least specified the desired version in the XML 70 | if ($spVersions.Keys -contains $spyear) 71 | { 72 | # Grab the version from the hashtable 73 | $spVer = $spVersions.$spYear 74 | } 75 | else {Throw " - Cannot determine version of SharePoint setup binaries, and no Version was specified in `"$(Split-Path -Path $inputFile -Leaf)`"."} 76 | } 77 | else 78 | { 79 | $setupVersion = (Get-Item -Path "$env:SPbits\setup.exe").VersionInfo.ProductVersion 80 | $spVer,$null,$spBuild,$null = $setupVersion -split "\." 81 | } 82 | $PSConfigUI = "$env:CommonProgramFiles\Microsoft Shared\Web Server Extensions\$spVer\BIN\psconfigui.exe" 83 | 84 | $script:DBPrefix = $xmlInput.Configuration.Farm.Database.DBPrefix 85 | If (($dbPrefix -ne "") -and ($null -ne $dbPrefix)) {$script:DBPrefix += "_"} 86 | If ($dbPrefix -like "*localhost*") {$script:DBPrefix = $dbPrefix -replace "localhost","$env:COMPUTERNAME"} 87 | 88 | if ($xmlInput.Configuration.Install.RemoteInstall.Enable -eq $true) 89 | { 90 | if ((Get-ItemProperty -Path "HKLM:\SOFTWARE\AutoSPInstaller\" -ErrorAction SilentlyContinue).CancelRemoteInstall -eq "1") 91 | { 92 | Write-Host -ForegroundColor White " - Disabling RemoteInstall, since we are resuming after a restart..." 93 | $enableRemoteInstall = $false 94 | } 95 | else 96 | { 97 | $enableRemoteInstall = $true 98 | } 99 | } 100 | else 101 | { 102 | $enableRemoteInstall = $false 103 | } 104 | 105 | Write-Host -ForegroundColor White " - Setting power management plan to `"High Performance`"..." 106 | Start-Process -FilePath "$env:SystemRoot\system32\powercfg.exe" -ArgumentList "/s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c" -NoNewWindow 107 | #endregion 108 | 109 | #region Remote Install 110 | Function Install-Remote 111 | { 112 | If ($enableRemoteInstall) 113 | { 114 | StartTracing 115 | If (!$env:RemoteStartDate) {$env:RemoteStartDate = Get-Date} 116 | Write-Host -ForegroundColor Green "-----------------------------------" 117 | Write-Host -ForegroundColor Green "| Automated SP$spYear Remote Installs |" 118 | Write-Host -ForegroundColor Green "| Started on: $env:RemoteStartDate |" 119 | Write-Host -ForegroundColor Green "-----------------------------------" 120 | Enable-CredSSP $remoteFarmServers 121 | ForEach ($server in $remoteFarmServers) 122 | { 123 | If ($xmlInput.Configuration.Install.RemoteInstall.ParallelInstall -eq $true) # Launch each farm server install simultaneously 124 | { 125 | Start-Process -FilePath "$PSHOME\powershell.exe" -ArgumentList "-ExecutionPolicy Bypass Invoke-Command -ScriptBlock { 126 | Import-Module -Name $env:dp0\AutoSPInstallerModule.psm1 -Force; ` 127 | StartTracing -Server $server; ` 128 | Test-ServerConnection -Server $server; ` 129 | Enable-RemoteSession -Server $server -Password $(ConvertFrom-SecureString $($credential.Password)); ` 130 | Install-NetFramework -Server $server -Password $(ConvertFrom-SecureString $($credential.Password)); ` 131 | Install-WindowsIdentityFoundation -Server $server -Password $(ConvertFrom-SecureString $($credential.Password)); ` 132 | Start-RemoteInstaller -Server $server -Password $(ConvertFrom-SecureString $($credential.Password)) -InputFile $inputFile; ` 133 | Pause `"exit`"; ` 134 | Stop-Transcript}" -Verb Runas 135 | Start-Sleep 10 136 | } 137 | Else # Launch each farm server install in sequence, one-at-a-time, or run these steps on the current $targetServer 138 | { 139 | WriteLine 140 | Write-Host -ForegroundColor Green " - Server: $server" 141 | Test-ServerConnection -Server $server 142 | Enable-RemoteSession -Server $server 143 | Install-NetFramework -Server $server 144 | Install-WindowsIdentityFoundation -Server $server 145 | Start-RemoteInstaller -Server $server -InputFile $inputFile 146 | } 147 | } 148 | $env:EndDate = Get-Date 149 | Write-Host -ForegroundColor Green "-----------------------------------" 150 | Write-Host -ForegroundColor Green "| Automated SP$spYear remote installs |" 151 | Write-Host -ForegroundColor Green "| Started on: $env:RemoteStartDate |" 152 | Write-Host -ForegroundColor Green "| Completed: $env:EndDate |" 153 | Write-Host -ForegroundColor Green "-----------------------------------" 154 | If ($isTracing) {Stop-Transcript; $script:isTracing = $false} 155 | } 156 | Else 157 | { 158 | Write-Host -ForegroundColor White " - There are other servers specified as farm members in:" 159 | Write-Host -ForegroundColor White " - $inputFile" 160 | Write-Host -ForegroundColor White " - but is not set to `"true`" - nothing else to do." 161 | } 162 | } 163 | #endregion 164 | 165 | #region Prepare For Install 166 | Function PrepForInstall 167 | { 168 | CheckXMLVersion $xmlInput 169 | CheckInput $inputFile 170 | Write-Host -ForegroundColor White " - Install based on: `n - $inputFile `n - Environment: $($xmlInput.Configuration.getAttribute(`"Environment`")) `n - Version: $($xmlInput.Configuration.getAttribute(`"Version`"))" 171 | ValidateCredentials $xmlInput 172 | ValidatePassphrase $xmlInput 173 | CheckConfigFiles $xmlInput 174 | # Pass SQL username and password to the CheckSQLAccess function if we are using SQL auth 175 | if ($xmlInput.Configuration.Farm.Database.SQLAuthentication.Enable -eq "true") 176 | { 177 | CheckSQLAccess -xmlinput $xmlInput -SqlAccount $xmlInput.Configuration.Farm.Database.SQLAuthentication.SQLUserName -SqlPass $xmlInput.Configuration.Farm.Database.SQLAuthentication.SQLPassword 178 | } 179 | # Otherwise just assume Windows integrated authentication and skip passing SQL login info 180 | else 181 | { 182 | CheckSQLAccess -xmlinput $xmlInput 183 | } 184 | } 185 | #endregion 186 | 187 | #region Install SharePoint binaries 188 | Function Start-Install 189 | { 190 | DisableLoopbackCheck $xmlInput 191 | RemoveIEEnhancedSecurity $xmlInput 192 | UnblockFiles -path "$env:bits\$spYear" 193 | DisableServices $xmlInput 194 | DisableCRLCheck $xmlInput 195 | InstallPrerequisites $xmlInput 196 | ConfigureIISLogging $xmlInput 197 | InstallSharePoint $xmlInput 198 | # Try to apply a recent CU for the AppFabric Caching Service if we're installing at least SP2013 but less than 2019. Note, this check works even if the $spYear is "SE". 199 | if ($spYear -ge 2013 -and $spyear -lt 2019) {Install-AppFabricCU $xmlInput} 200 | InstallOfficeWebApps2010 $xmlInput 201 | InstallProjectServer $xmlInput 202 | InstallLanguagePacks $xmlInput 203 | InstallUpdates $xmlInput 204 | FixTaxonomyPickerBug $xmlInput 205 | if ($spYear -le 2019) # Note, this check works even if the $spYear is "SE". 206 | { 207 | Set-ShortcutRunAsAdmin -shortcutFile "$env:ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft SharePoint $spYear Products\SharePoint $spYear Management Shell.lnk" 208 | } 209 | } 210 | #endregion 211 | 212 | #region Setup Farm 213 | Function Set-FarmConfig ([xml]$xmlInput) 214 | { 215 | [System.Management.Automation.PsCredential]$farmCredential = GetFarmCredentials $xmlInput 216 | [security.securestring]$secPhrase = GetSecureFarmPassphrase $xmlInput 217 | ConfigureFarmAdmin $xmlInput 218 | if ($spYear -le 2019) # No longer need the snapin in SPSE (2021) plus as it uses a module instead. Note, this check works even if the $spYear is "SE". 219 | { 220 | Add-SharePointPSSnapin 221 | } 222 | CreateOrJoinFarm $xmlInput ([security.securestring]$secPhrase) ([System.Management.Automation.PsCredential]$farmCredential) 223 | CheckFarmTopology $xmlInput 224 | ConfigureFarm $xmlInput 225 | ConfigureDiagnosticLogging $xmlInput 226 | ConfigureOfficeWebApps $xmlInput 227 | $languagePackInstalled = (Get-Item -Path "HKLM:\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\$spVer.0\WSS\").GetValue("LanguagePackInstalled") 228 | ConfigureLanguagePacks $xmlInput 229 | AddManagedAccounts $xmlInput 230 | if (($spYear -eq 2016) -and ($languagePackInstalled -eq 1)) 231 | { 232 | Write-Host -ForegroundColor Yellow " - We need to re-launch the script to work around a known issue with SP2016 when language packs are installed." 233 | $scriptCommandLine = $($MyInvocation.Line) 234 | If (Confirm-LocalSession) 235 | { 236 | $scriptCommandLine = "$env:dp0\AutoSPInstallerLaunch.bat $inputFile" 237 | Write-Host -ForegroundColor White " - Re-Launching:" 238 | Write-Host -ForegroundColor White " - $scriptCommandLine" 239 | Start-Process -WorkingDirectory $PSHOME -FilePath "powershell.exe" -ArgumentList "-ExecutionPolicy Bypass $scriptCommandLine -RemoteAuthPassword $password" -Verb RunAs 240 | $script:aborted = $true 241 | Start-Sleep 10 242 | exit 243 | } 244 | } 245 | CreateWebApplications $xmlInput 246 | } 247 | #endregion 248 | 249 | #region Setup Services 250 | Function Set-ServiceConfig ([xml]$xmlInput) 251 | { 252 | ConfigureSandboxedCodeService $xmlInput 253 | CreateStateServiceApp $xmlInput 254 | CreateMetadataServiceApp $xmlInput 255 | # Temporary fix as service gets stuck in 'Provisioning" status for SPSE 256 | if ($spYear -le 2019) 257 | { 258 | ConfigureClaimsToWindowsTokenService $xmlInput 259 | } 260 | CreateUserProfileServiceApplication $xmlInput 261 | CreateSPUsageApp $xmlInput 262 | ConfigureUsageLogging $xmlInput 263 | CreateWebAnalyticsApp $xmlInput 264 | CreateSecureStoreServiceApp $xmlInput 265 | ConfigureFoundationSearch $xmlInput 266 | ConfigureTracing $xmlInput 267 | CreateEnterpriseSearchServiceApp $xmlInput 268 | CreateBusinessDataConnectivityServiceApp $xmlInput 269 | CreateExcelServiceApp $xmlInput 270 | CreateVisioServiceApp $xmlInput 271 | if ($spYear -le 2019) # Only for versions prior to Subscription Edition. Note, this check works even if the $spYear is "SE". 272 | { 273 | CreateAccess2010ServiceApp $xmlInput 274 | if ($spVer -ge 15) # Only for SP2013+ only 275 | { 276 | CreateAccessServicesApp $xmlInput 277 | } 278 | CreatePerformancePointServiceApp $xmlInput 279 | } 280 | CreateWordAutomationServiceApp $xmlInput 281 | CreateProjectServerServiceApp $xmlInput 282 | ConfigureWorkflowTimerService $xmlInput 283 | if ($spYear -eq 2010) # These are for SP2010 / Office Web Apps 2010 only 284 | { 285 | CreateExcelOWAServiceApp $xmlInput 286 | CreatePowerPointOWAServiceApp $xmlInput 287 | CreateWordViewingOWAServiceApp $xmlInput 288 | } 289 | if ($spVer -ge 15) # These are for SP2013+ only 290 | { 291 | CreateAppManagementServiceApp $xmlInput 292 | CreateSubscriptionSettingsServiceApp $xmlInput 293 | CreateWorkManagementServiceApp $xmlInput 294 | CreateMachineTranslationServiceApp $xmlInput 295 | CreatePowerPointConversionServiceApp $xmlInput 296 | ConfigureDistributedCacheService $xmlInput 297 | } 298 | if (((Get-CimInstance -ClassName Win32_OperatingSystem).Version -like "6.2*" -or (Get-CimInstance -ClassName Win32_OperatingSystem).Version -like "6.3*") -and ($spVer -eq 14)) 299 | { 300 | Write-Host -ForegroundColor White " - Installing SMTP Windows feature in a separate PowerShell window..." 301 | Start-Process -FilePath "$PSHOME\powershell.exe" -Verb Runas -ArgumentList "-Command `"Import-Module -Name $env:dp0\AutoSPInstallerModule.psm1 -Force; InstallSMTP (Get-Content $inputFile); Start-Sleep 5`"" -Wait 302 | } 303 | else {InstallSMTP $xmlInput} 304 | ConfigureOutgoingEmail $xmlInput 305 | ConfigureIncomingEmail $xmlInput 306 | Set-PDFSearchAndIcon $xmlInput 307 | ConfigureFoundationWebApplicationService $xmlInput 308 | InstallForeFront $xmlInput 309 | } 310 | #endregion 311 | 312 | #region Finalize Install (perform any cleanup operations) 313 | # Run last 314 | Function Complete-Install ([xml]$xmlInput) 315 | { 316 | # Perform these steps only if the local server is a SharePoint farm server 317 | If (MatchComputerName $farmServers $env:COMPUTERNAME) 318 | { 319 | # Remove Farm Account from local Administrators group to avoid big scary warnings in Central Admin 320 | # But only if the script actually put it there, and we want to leave it there 321 | # (e.g. to work around the issue with native SharePoint backups deprovisioning UPS per http://www.toddklindt.com/blog/Lists/Posts/Post.aspx?ID=275) 322 | $farmAcct = $xmlInput.Configuration.Farm.Account.Username 323 | If (!($runningAsFarmAcct) -and ($xmlInput.Configuration.Farm.Account.AddToLocalAdminsDuringSetup -eq $true) -and ($xmlInput.Configuration.Farm.Account.LeaveInLocalAdmins -eq $false)) 324 | { 325 | $builtinAdminGroup = Get-AdministratorsGroup 326 | Write-Host -ForegroundColor White " - Removing $farmAcct from local group `"$builtinAdminGroup`"..." 327 | $farmAcctDomain,$farmAcctUser = $farmAcct -Split "\\" 328 | try 329 | { 330 | ([ADSI]"WinNT://$env:COMPUTERNAME/$builtinAdminGroup,group").Remove("WinNT://$farmAcctDomain/$farmAcctUser") 331 | If (-not $?) {throw} 332 | } 333 | catch {Write-Host -ForegroundColor White " - $farmAcct already removed from `"$builtinAdminGroup.`""} 334 | # Restart SPTimerV4 so it can now run under non-local Admin privileges and avoid Health Analyzer warning 335 | Write-Host -ForegroundColor White " - Restarting SharePoint Timer Service..." 336 | Restart-Service SPTimerV4 337 | } 338 | Else 339 | { 340 | Write-Host -ForegroundColor White " - Not changing local Admin membership of $farmAcct." 341 | } 342 | 343 | Write-Host -ForegroundColor White " - Adding Network Service to local WSS_WPG group (fixes event log warnings)..." 344 | Try 345 | { 346 | ([ADSI]"WinNT://$env:COMPUTERNAME/WSS_WPG,group").Add("WinNT://NETWORK SERVICE") 347 | If (-not $?) {Throw} 348 | } 349 | Catch {Write-Host -ForegroundColor White " - Network Service is already a member."} 350 | Invoke-HealthAnalyzerJobs 351 | } 352 | 353 | Write-Host -ForegroundColor White " - Completed!`a" 354 | $Host.UI.RawUI.WindowTitle = " -- Completed -- $env:COMPUTERNAME --" 355 | $env:EndDate = Get-Date 356 | } 357 | #endregion 358 | 359 | #region MAIN - Check for input file and start the install 360 | 361 | If (!([string]::IsNullOrEmpty($targetServer))) {$farmServers = $targetServer} 362 | Else {$farmServers = Get-FarmServers $xmlInput} 363 | $remoteFarmServers = $farmServers | Where-Object {-not (MatchComputerName $_ $env:COMPUTERNAME)} 364 | $password = $remoteAuthPassword 365 | If ([string]::IsNullOrEmpty($password)) {$password = $xmlInput.Configuration.Install.AutoAdminLogon.Password} 366 | If (($enableRemoteInstall -and !([string]::IsNullOrEmpty($remoteFarmServers))) -or ($xmlInput.Configuration.Install.AutoAdminLogon.Enable -eq $true)) 367 | { 368 | If (Confirm-LocalSession) 369 | { 370 | While ($credentialVerified -ne $true) 371 | { 372 | If ($password) # In case this is an automatic re-launch of the local script, re-use the password from the remote auth credential 373 | { 374 | Write-Host -ForegroundColor White " - Using pre-provided credentials..." 375 | $credential = New-Object System.Management.Automation.PsCredential $env:USERDOMAIN\$env:USERNAME,$(ConvertTo-SecureString -String $password -AsPlainText -Force -ErrorAction SilentlyContinue) 376 | } 377 | If (!$credential) # Otherwise prompt for the remote auth or AutoAdminLogon credential 378 | { 379 | Write-Host -ForegroundColor White " - Prompting for remote/autologon credentials..." 380 | $credential = $host.ui.PromptForCredential("AutoSPInstaller - Remote/Automatic Install", "Enter Credentials for Remote/Automatic Authentication:", "$env:USERDOMAIN\$env:USERNAME", "NetBiosUserName") 381 | } 382 | $currentDomain = "LDAP://" + ([ADSI]"").distinguishedName 383 | $null,$user = $credential.Username -split "\\" 384 | If (($null -ne $user) -and ($null -ne $credential.Password)) {$password = ConvertTo-PlainText $credential.Password} 385 | Else 386 | { 387 | If ($enableRemoteInstall -and !([string]::IsNullOrEmpty($remoteFarmServers))) {Write-Error " - Credentials are required for remote authentication."; Pause "exit"; Throw} 388 | Else {Write-Host -ForegroundColor Yellow " - No password supplied; skipping AutoAdminLogon."; break} 389 | } 390 | Write-Host -ForegroundColor White " - Checking credentials: `"$($credential.Username)`"..." -NoNewline 391 | $dom = New-Object System.DirectoryServices.DirectoryEntry($currentDomain,$user,$password) 392 | If ($null -ne $dom.Path) 393 | { 394 | Write-Host -ForegroundColor Black -BackgroundColor Green "Verified." 395 | $credentialVerified = $true 396 | } 397 | Else 398 | { 399 | Write-Host -BackgroundColor Red -ForegroundColor Black "Invalid - please try again." 400 | $password = $null 401 | $credential = $null 402 | } 403 | } 404 | } 405 | } 406 | 407 | If (Confirm-LocalSession) {StartTracing} # Only start tracing if this is a local session 408 | If (!$env:StartDate) {$env:StartDate = Get-Date} 409 | Write-Host -ForegroundColor White "-----------------------------------" 410 | Write-Host -ForegroundColor White "| Automated SP$spYear install script |" 411 | Write-Host -ForegroundColor White "| Started on: $env:StartDate |" 412 | Write-Host -ForegroundColor White "-----------------------------------" 413 | 414 | # In case we are running this installer from a non-SharePoint farm server, only do these steps for farm member servers 415 | If (MatchComputerName $farmServers $env:COMPUTERNAME) 416 | { 417 | Try 418 | { 419 | If (Confirm-LocalSession) 420 | { 421 | $spInstalled = Get-SharePointInstall 422 | Write-Host -ForegroundColor White " - SharePoint $spYear binaries are"($spInstalled -replace "True","already" -replace "False","not yet") "installed." 423 | } 424 | PrepForInstall 425 | Start-Install 426 | Write-Host -ForegroundColor White " - SharePoint $spYear binary file installation done!" 427 | 428 | #region Re-Launch Script under PowerShell v2 429 | # Check for SharePoint 2010 on Windows Server 2012, and re-launch script under PowerShell version 2 if it's not already 430 | # Required for compatibility 431 | if (((Get-CimInstance -ClassName Win32_OperatingSystem).Version -like "6.2*" -or (Get-CimInstance -ClassName Win32_OperatingSystem).Version -like "6.3*") -and ($host.Version.Major -gt 2) -and ($spVer -eq 14)) 432 | { 433 | Write-Host -ForegroundColor Yellow " - A version of PowerShell greater than 2.0 was detected." 434 | Write-Host -ForegroundColor Yellow " - We need to re-launch the script to enable PowerShell version 2 for SharePoint $spYear." 435 | $scriptCommandLine = $($MyInvocation.Line) 436 | If (Confirm-LocalSession) 437 | { 438 | Write-Host -ForegroundColor White " - Re-Launching:" 439 | Write-Host -ForegroundColor White " - $scriptCommandLine" 440 | Start-Process -WorkingDirectory $PSHOME -FilePath "powershell.exe" -ArgumentList "-Version 2 -NoExit -ExecutionPolicy Bypass $scriptCommandLine" -Verb RunAs 441 | $aborted = $true 442 | If ($isTracing) {Stop-Transcript; $script:isTracing = $false} 443 | Start-Sleep 10 444 | Write-Host -ForegroundColor White " - You can now safely close this window." 445 | } 446 | exit 447 | } 448 | #endregion 449 | 450 | If (($xmlInput.Configuration.Install.PauseAfterInstall -eq $true) -or ($xmlInput.Configuration.Install.RemoteInstall.ParallelInstall -eq $true)) 451 | { 452 | Pause "proceed with farm configuration" "y" 453 | } 454 | Set-FarmConfig -xmlinput $xmlInput 455 | Set-ServiceConfig -xmlinput $xmlInput 456 | Complete-Install -xmlinput $xmlInput 457 | # We only want to Install-Remote if we aren't already *in* a remote session, and if there are actually remote servers to install! 458 | If ((Confirm-LocalSession) -and !([string]::IsNullOrEmpty($remoteFarmServers))) {Install-Remote} 459 | } 460 | Catch 461 | { 462 | WriteLine 463 | Write-Host -ForegroundColor Yellow " - Script halted!" 464 | If ($null -ne $_.FullyQualifiedErrorId -and $_.FullyQualifiedErrorId.StartsWith(" - ")) 465 | { 466 | # Error messages starting with " - " are thrown directly from this script 467 | Write-Host -ForegroundColor Red $_.FullyQualifiedErrorId 468 | If ((Get-ItemProperty -Path "HKLM:\SOFTWARE\AutoSPInstaller\" -ErrorAction SilentlyContinue).RestartRequired -eq "1") 469 | { 470 | Write-Host -ForegroundColor White " - Setting RunOnce registry entry for AutoSPInstaller..." 471 | # Create the RunOnce key in case it doesn't yet exist (as I discovered on on Win2012) 472 | New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\" -Name RunOnce -ErrorAction SilentlyContinue | Out-Null 473 | New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\RunOnce" -Name AutoSPInstaller -Value "`"$env:dp0\AutoSPInstallerLaunch.bat`" `"$inputFile`"" -Force | Out-Null 474 | If ($xmlInput.Configuration.Install.AutoAdminLogon.Enable -eq $true) 475 | { 476 | If ([string]::IsNullOrEmpty($password)) 477 | { 478 | $password = $xmlInput.Configuration.Install.AutoAdminLogon.Password 479 | If ([string]::IsNullOrEmpty($password)) 480 | { 481 | $password = Read-Host -Prompt " - Please enter the password for $env:USERDOMAIN\$env:USERNAME to enable auto-login" 482 | } 483 | } 484 | If (!([string]::IsNullOrEmpty($password))) 485 | { 486 | Write-Host -ForegroundColor White " - Setting AutoAdminLogon in the registry for $env:USERDOMAIN\$env:USERNAME..." 487 | # Set the AutoAdminLogon values. Adapted from a patch uploaded by Codeplex user Sheppounet (http://www.codeplex.com/site/users/view/Sheppounet) 488 | New-ItemProperty -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\WinLogon" -Name "AutoAdminLogon" -Value 1 -PropertyType "String" -Force | Out-Null 489 | New-ItemProperty -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\WinLogon" -Name "DefaultDomainName" -Value $env:USERDOMAIN -PropertyType "String" -Force | Out-Null 490 | New-ItemProperty -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\WinLogon" -Name "DefaultUserName" -Value $env:USERNAME -PropertyType "String" -Force | Out-Null 491 | New-ItemProperty -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\WinLogon" -Name "DefaultPassword" -Value $password -PropertyType "String" -Force | Out-Null 492 | New-ItemProperty -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\WinLogon" -Name "AutoLogonCount" -Value 1 -PropertyType "Dword" -Force | Out-Null 493 | $restartPrompt = "y" 494 | # Disable UAC so the script can run unobstructed. We will re-enable it as a security precaution when the script re-runs and only disable it again if we get to this point 495 | Set-UserAccountControl 0 496 | } 497 | Else {Write-Host -ForegroundColor Yellow " - No password supplied; skipping AutoAdminLogon."} 498 | } 499 | Else {Write-Host -ForegroundColor White " - AutoAdminLogon is not enabled in $inputFile; set it to `"true`" to enable it."} 500 | Write-Host -ForegroundColor White " - The AutoSPInstaller script will resume after the server reboots and $env:USERDOMAIN\$env:USERNAME logs in." 501 | if ((Confirm-LocalSession) -and ([string]::IsNullOrEmpty($restartPrompt))) {$restartPrompt = Read-Host -Prompt " - Do you want to restart immediately? (y/n)"} 502 | If ($restartPrompt -eq "y") 503 | { 504 | if (!(Confirm-LocalSession)) 505 | { 506 | Write-Host " - Restarting - " 507 | Start-Sleep 5 508 | Restart-Computer -ErrorAction SilentlyContinue 509 | if (!$?) 510 | { 511 | Write-Warning "Restart failed; there may be (an) other user(s) logged in!" 512 | $forceRestart = Read-Host -Prompt " - Do you want to force a restart? (y/n)" 513 | if ($forceRestart -eq "y") {Restart-Computer -Force} 514 | } 515 | } 516 | # If this is a non-remote session, launch Restart-Computer from another PS window/process 517 | else {Start-Process -FilePath "$PSHOME\powershell.exe" -ArgumentList "Write-Host ' - Restarting - '; Start-Sleep 5; Restart-Computer -ErrorAction SilentlyContinue; if (!`$?) {Write-Warning 'Restart failed; there may be (an) other user(s) logged in!'; `$forceRestart = Read-Host -Prompt ' - Do you want to force a restart? (y/n)'; if (`$forceRestart -eq 'y') {Restart-Computer -Force}}"} 518 | $restarting = $true 519 | } 520 | Else {Write-Host -ForegroundColor Yellow " - Please restart your computer to continue AutoSPInstaller."} 521 | } 522 | if (!$restarting) {Pause "exit"} 523 | } 524 | # Lately, loading the snapin throws an error: "System.TypeInitializationException: The type initializer for 'Microsoft.SharePoint.Utilities.SPUtility' threw an exception. ---> System.IO.FileNotFoundException:"... 525 | ElseIf ($_.Exception.Message -like "*Microsoft.SharePoint.Utilities.SPUtility*") 526 | { 527 | Write-Host -ForegroundColor Yellow " - A known (annoying) issue occurred loading the SharePoint PowerShell snapin." 528 | Write-Host -ForegroundColor Yellow " - We need to re-launch the script to clear this condition." 529 | $scriptCommandLine = $($MyInvocation.Line) 530 | If (Confirm-LocalSession) 531 | { 532 | Write-Host -ForegroundColor White " - Re-Launching:" 533 | Write-Host -ForegroundColor White " - $scriptCommandLine" 534 | Start-Process -WorkingDirectory $PSHOME -FilePath "powershell.exe" -ArgumentList "-ExecutionPolicy Bypass $scriptCommandLine -RemoteAuthPassword $password" -Verb RunAs 535 | Start-Sleep 10 536 | } 537 | } 538 | Else 539 | { 540 | #Other error messages are exceptions. Can't find a way to make this Red 541 | $_ | Format-List -Force 542 | } 543 | $env:EndDate = Get-Date 544 | Write-Host -ForegroundColor White "-----------------------------------" 545 | Write-Host -ForegroundColor White "| Automated SP$spYear install script |" 546 | Write-Host -ForegroundColor White "| Started on: $env:StartDate |" 547 | Write-Host -ForegroundColor White "| Aborted: $env:EndDate |" 548 | Write-Host -ForegroundColor White "-----------------------------------" 549 | $aborted = $true 550 | If (!$scriptCommandLine -and (!(Confirm-LocalSession))) {Pause "exit"} 551 | } 552 | Finally 553 | { 554 | # Only do this stuff if this was a local session and it succeeded, not running Server Core, and if we aren't attempting a remote install; 555 | # Otherwise these sites may not be available or 'complete' yet 556 | If ((Confirm-LocalSession) -and !$aborted -and !($enableRemoteInstall) -and !((Get-ItemProperty -Path "HKLM:\Software\Microsoft\Windows NT/Currentversion").InstallationType -eq "Server Core")) 557 | { 558 | # Launch Central Admin 559 | If (ShouldIProvision($xmlInput.Configuration.Farm.CentralAdmin) -eq $true) 560 | { 561 | Write-Host -ForegroundColor White " - Launching Central Admin..." 562 | Start-Process $PSConfigUI -ArgumentList "-cmd showcentraladmin" 563 | } 564 | # Launch any site collections we created, but only if this is a local (non-remote) session and this is a farm server and the Foundation Web Application Service is not disabled 565 | If ((MatchComputerName $farmServers $env:COMPUTERNAME) -and (ShouldIProvision $xmlInput.Configuration.Farm.Services.FoundationWebApplication)) 566 | { 567 | ForEach ($webApp in $xmlInput.Configuration.WebApplications.WebApplication) 568 | { 569 | ForEach ($siteCollection in $webApp.SiteCollections.SiteCollection) 570 | { 571 | $siteURL = $siteCollection.siteURL 572 | If ($null -ne $siteURL) 573 | { 574 | Start-Sleep 30 # Wait for the previous site to load before trying to load this site 575 | Write-Host -ForegroundColor White " - Launching $siteURL..." 576 | Start-Process "$siteURL" -WindowStyle Minimized 577 | } 578 | } 579 | } 580 | } 581 | } 582 | } 583 | } 584 | # If the local server isn't a SharePoint farm server, just attempt remote installs 585 | Else ##If (!($farmServers -like "$env:COMPUTERNAME*")) 586 | { 587 | Install-Remote 588 | Complete-Install 589 | } 590 | If (!$aborted) 591 | { 592 | If (Confirm-LocalSession) # Only do this stuff if this was a local session and it succeeded 593 | { 594 | $startDate = $env:StartDate 595 | Write-Host -ForegroundColor White "-----------------------------------" 596 | Write-Host -ForegroundColor White "| Automated SP$spYear install script |" 597 | Write-Host -ForegroundColor White "| Started on: $startDate |" 598 | Write-Host -ForegroundColor White "| Completed: $env:EndDate |" 599 | Write-Host -ForegroundColor White "-----------------------------------" 600 | If ($isTracing) {Stop-Transcript; $script:isTracing = $false} 601 | Pause "exit" 602 | If ((-not $Unattended) -and (-not (Get-CimInstance -ClassName Win32_OperatingSystem).Version -eq "6.1.7601")) {Invoke-Item $logFile} # We don't want to automatically open the log Win 2008 with SP2013, due to a nasty bug causing BSODs! See https://autospinstaller.codeplex.com/workitem/19491 for more info. 603 | } 604 | # Remove any lingering LogTime values in the registry 605 | Remove-ItemProperty -Path "HKLM:\SOFTWARE\AutoSPInstaller\" -Name "LogTime" -ErrorAction SilentlyContinue 606 | } 607 | 608 | #endregion 609 | 610 | # =================================================================================== 611 | # LOAD ASSEMBLIES 612 | # =================================================================================== 613 | #[void][System.Reflection.Assembly]::Load("Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c") 614 | -------------------------------------------------------------------------------- /SP/SE/LanguagePacks/PutLanguagePacksHere.txt: -------------------------------------------------------------------------------- 1 | The best approach is to extract the contents of the downloaded language pack(s) to corresponding subfolders like: 2 | \fr-fr 3 | \de-de 4 | ... 5 | 6 | If you are slipstreaming updates in your SharePoint 201x installation media, make sure you also extract the corresponding language pack updates to the \xx-xx\Updates folder for each language pack. 7 | 8 | Alternately, you can just place the monolithic language pack installers (ServerLanguagePack_XX-XX.exe) along with any update packages (e.g. serverlanguagepack2010sp1-kb2460056-x64-fullfile-xx-xx.exe) in the root of this folder. 9 | Note that updates may not get applied completely in this manner and you may need to re-apply any CUs after the SharePoint config is complete. -------------------------------------------------------------------------------- /SP/SE/SharePoint/CopyTheContentsOfTheSharePointMediaHere.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brianlala/AutoSPInstaller/6c4bcd0b9b40f9e4ba0b492fd634f67414e8b7f1/SP/SE/SharePoint/CopyTheContentsOfTheSharePointMediaHere.txt -------------------------------------------------------------------------------- /SP/SE/Updates/PutUpdatePackagesHere.txt: -------------------------------------------------------------------------------- 1 | You can place the monolithic Public Update installers (e.g. sts-subscription-kb5002045-fullfile-x64-glb.exe) in either the root or subfolders here and they will automatically be applied. 2 | 3 | To exclude certain update files from being detected/applied, or certain subfolders from being scanned (e.g. for testing), you can simply set their "hidden" attribute. 4 | 5 | This is an alternative to the slipstream method that may be more reliable in a broader range of scenarios. --------------------------------------------------------------------------------