February 19, 2021 at 12:58 pm
Hello ,
I'm looking for automated SQL server installation process via powershell
I don't know why my script does not support the path defined for the data file or log file or the path of the backup it always takes the default value C: \ Program Files \ Microsoft SQL Server \
attached My script
$HostName = Hostname
D:\Setup.exe /ACTION=Install /FEATURES=SQLEngine,Replication,IS,Conn,FullText `
/INSTANCENAME=Abdallah`
/SQLSVCACCOUNT="NT Service\MSSQLServer" `
/AGTSVCACCOUNT="NT Service\SQLServerAgent" `
/FTSVCACCOUNT="NT Service\MSSQLFDLauncher" `
/ISSVCACCOUNT="NT Service\MsDtsServer150" `
/AGTSVCSTARTUPTYPE="Automatic" `
/TCPENABLED="1" `
/FILESTREAMLEVEL="3" `
/FILESTREAMSHARENAME="MSSQLSERVER" `
/INSTALLSQLDATADIR="c:\backup" `
/SQLBACKUPDIR="c:\Backup" `
/SQLUSERDBDIR="c:\backup" `
/SQLUSERDBLOGDIR="c:\backup" `
/SQLTEMPDBFILECOUNT=4 `
/UpdateEnabled=FALSE `
/SECURITYMODE=SQL /SAPWD="admin" /SQLSYSADMINACCOUNTS="$Hostname\Administrateur" `
/SQLUSERDBDIR="c:\backup" `
/SQLUSERDBLOGDIR="c:\backup" `
/SQLTEMPDBDIR="c:\backup" `
/SQLTEMPDBLOGDIR="c:\backup" `
/SQLTEMPDBFILESIZE=256 `
/SQLTEMPDBFILEGROWTH=64 `
/SQLTEMPDBLOGFILESIZE=256 `
/SQLTEMPDBLOGFILEGROWTH=256 `
/HELP="False" /INDICATEPROGRESS="False" /QUIET="True" /QUIETSIMPLE="False" `
/X86="False" /ENU="True" /ERRORREPORTING="False" /SQMREPORTING="False" `
/SQLSVCINSTANTFILEINIT=TRUE `
/IACCEPTSQLSERVERLICENSETERMS
CLEAR
thank you for your help
February 20, 2021 at 1:10 pm
Thanks for posting your issue and hopefully someone will answer soon.
This is an automated bump to increase visibility of your question.
April 8, 2021 at 2:29 pm
The $Hostname is not parsed at runtime. You need to hardcode the hostname, or use an .ini file.
Or, try my approach and use dbatools:
this way you can install multiple instances at once, in parallel.
Hope this helps!
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy