{"id":21032481,"url":"https://github.com/majkinetor/install-sqlserver","last_synced_at":"2025-05-15T13:31:09.827Z","repository":{"id":76786457,"uuid":"251584372","full_name":"majkinetor/Install-SqlServer","owner":"majkinetor","description":"Powershell script to install MS SQL Server unattended","archived":false,"fork":false,"pushed_at":"2025-02-05T09:17:11.000Z","size":191,"stargazers_count":22,"open_issues_count":0,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-13T12:05:14.830Z","etag":null,"topics":["installer-script","powershell","sql-server","unattended-installation","windows"],"latest_commit_sha":null,"homepage":null,"language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/majkinetor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-31T11:34:18.000Z","updated_at":"2025-04-07T10:53:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"e80c7d5c-a1ca-4e27-894b-58d589ea0383","html_url":"https://github.com/majkinetor/Install-SqlServer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/majkinetor%2FInstall-SqlServer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/majkinetor%2FInstall-SqlServer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/majkinetor%2FInstall-SqlServer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/majkinetor%2FInstall-SqlServer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/majkinetor","download_url":"https://codeload.github.com/majkinetor/Install-SqlServer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254349275,"owners_count":22056312,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["installer-script","powershell","sql-server","unattended-installation","windows"],"created_at":"2024-11-19T12:43:22.734Z","updated_at":"2025-05-15T13:31:09.808Z","avatar_url":"https://github.com/majkinetor.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Install-SqlServer\n\n[![](https://img.shields.io/badge/version-1.1-green)](https://github.com/majkinetor/Install-SqlServer)\n\nThis script installs MS SQL Server on Windows OS silently from ISO image that can be available locally or downloaded from the Internet.\nTranscript of entire operation is recorded in the log file.\n\nThe script lists parameters provided to the native setup but hides sensitive data. See the provided links for SQL Server silent install details.\n\nThe installer is tested with SQL Servers 2016-2022 and PowerShell 3-7.\n\n## Prerequisites\n\n1. Windows OS\n2. Administrative rights\n1. MS SQL Server ISO image [optional]\n\n## Usage\n\nThe fastest way to install core SQL Server is to run in administrative shell:\n\n```ps1\n./Install-SqlServer.ps1 -EnableProtocols\n```\n\nThis will download and install **SQL Server Development Edition** and enable all protocols. Provide your own ISO image of any edition using `ISOPath` script parameter.\n\nThis assumes number of default parameters and installs by default only `SQLEngine` feature. Run `Get-Help ./Install-SqlServer.ps1 -Full` for parameter details.\n\nTo **test installation**, after running this script execute:\n\n```ps1\n# Set-Alias sqlcmd \"$Env:ProgramFiles\\Microsoft SQL Server\\Client SDK\\ODBC\\170\\Tools\\Binn\\SQLCMD.EXE\"\n\"SELECT @@version\" | sqlcmd\n```\n\n## Notes\n\n- Behind the proxy use `HTTP_PROXY` environment variable\n- SQL Server Management Studio isn't distributed along with SQL Server any more. Install via chocolatey: [`cinst sql-server-management-studio`](https://chocolatey.org/packages/sql-server-management-studio)\n- On PowerShell 5 progress bar significantly slows down the download. Use `$progressPreference = 'silentlyContinue'` to disable it prior to calling this function.\n- SQL Server Development Edition has all features of Enterprise Edition and you can license it as Enterprise edition if needed.\n\n### How to find SQL Server direct download\n\n1. Download evaluation installer from official site\n    - Example for v2022: https://www.microsoft.com/en-us/evalcenter/download-sql-server-2022\n    - This downloads file: `SQL2022-SSEI-Eval.exe`\n1. Unpack evalutation installer exe using 7zip\n    - This unpacks its resources and other stuff as text files\n1. Search for `.iso` in files\n    - For example using [dngrep](https://dngrep.github.io)\n\nSee ticket [#3](https://github.com/majkinetor/Install-SqlServer/issues/3#issuecomment-1536174746) for details.\n\n### Direct download list\n\n1. [2022 Development Edition](https://download.microsoft.com/download/3/8/d/38de7036-2433-4207-8eae-06e247e17b25/SQLServer2022-x64-ENU-Dev.iso)\n2. [2019 Development Edition](https://download.microsoft.com/download/7/c/1/7c14e92e-bdcb-4f89-b7cf-93543e7112d1/SQLServer2019-x64-ENU-Dev.iso)\n\n## Troubleshooting\n\n### Installation issues on Windows 11\n\nIt is possible that on some devices running Windows 11, SQL Server installation will fail to complete or start, [due to system disk sector size greater than 4 KB](https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/database-file-operations/troubleshoot-os-4kb-disk-sector-size).\n\nYou can confirm this by running:\n\n```pwsh\nfsutil fsinfo sectorinfo \u003cvolume pathname\u003e\n```\n\nTo resolve this, add a new key to the registry using:\n\n```pwsh\nREG ADD \"HKLM\\SYSTEM\\CurrentControlSet\\Services\\stornvme\\Parameters\\Device\" /v \"ForcedPhysicalSectorSizeInBytes\" /t   REG_MULTI_SZ /d \"* 4095\" /f\n```\n\nValidate if the key was added successfully:\n\n```pwsh\nREG QUERY \"HKLM\\SYSTEM\\CurrentControlSet\\Services\\stornvme\\Parameters\\Device\" /v \"ForcedPhysicalSectorSizeInBytes\"\n```\n\nand run the installation script again.\n\n### Installing on remote machine using PowerShell remote session\n\nThe following errors may occur:\n\n    There was an error generating the XML document\n        ... Access denied\n        ... The computer must be trusted for delegation and the current user account must be configured to allow delegation\n\n**The solution**: Use WinRM session parameter `-Authentication CredSSP`.\n\nTo be able to use it, the following settings needs to be done on both local and remote machine:\n\n1. On local machine using `gpedit.msc`, go to *Computer Configuration -\u003e Administrative Templates -\u003e System -\u003e Credentials Delegation*.\u003cbr\u003e\nAdd `wsman/*.\u003cdomain\u003e` (set your own domain) in the following settings\n    1. *Allow delegating fresh credentials with NTLM-only server authentication*\n    2. *Allow delegating fresh credentials*\n1. The remote machine must be set to behave as CredSSP server with `Enable-WSManCredSSP -Role server`\n\n## Links\n\n- [Install SQL Server from the Command Prompt](https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-2016-from-the-command-prompt)\n    - [Features](https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-2016-from-the-command-prompt#Feature)\n    - [Accounts](https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-2016-from-the-command-prompt#Accounts)\n- [Download SQL Server Management Studio](https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms)\n- [Editions and features](https://docs.microsoft.com/en-us/sql/sql-server/editions-and-components-of-sql-server-2017)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmajkinetor%2Finstall-sqlserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmajkinetor%2Finstall-sqlserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmajkinetor%2Finstall-sqlserver/lists"}