This script will add the MSSQL user and create the SNAPSHOT directory.
echo 'Type in the MSSQL password you would like to set'; $wshell= New-Object -ComObject Wscript.Shell ; $wshell.Popup("Type in the MSSQL password you would like to set")
$Password = Read-Host -AsSecureString
echo 'MSSQL Password set!'; $wshell= New-Object -ComObject Wscript.Shell ; $wshell.Popup("MSSQL Password set!")
New-LocalUser "MSSQL" -Password $password -FullName "SQL Replication Account" -Description "DO NOT DELETE, USED WITH REPLICATION"
Add-LocalGroupMember -Group "Administrators" -Member "MSSQL"
echo 'MSSQL user created!'; $wshell= New-Object -ComObject Wscript.Shell ; $wshell.Popup("MSSQL user created!")
New-Item “C:\SNAPSHOT" –type directory
New-SMBShare –Name "SNAPSHOT" -Description "SQL Replication Snapshot" –Path "C:\SNAPSHOT"
Grant-SmbShareAccess -Name SNAPSHOT -AccountName MSSQL -AccessRight FULL
echo 'SNAPSHOT directory created and shared with MSSQL user'; $wshell= New-Object -ComObject Wscript.Shell ; $wshell.Popup("SNAPSHOT directory created and shared with MSSQL user")