Skip to content

Commit

Permalink
Fix for grant service login and SQL permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
zadj authored Jul 19, 2018
1 parent 6016b2f commit d83e0b7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions AutoRekVMSetup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ New-LocalUser `
-PasswordNeverExpire

# add to logon as service local policy
GrantServiceLogon -username ("{0}\{1}" -f $env:USERDOMAIN, "svc1")
GrantServiceLogon -username ("{0}\{1}" -f $env:COMPUTERNAME, "svc1")

# set clr to sql
Invoke-Sqlcmd -Query "EXEC sp_configure 'show advanced option', '1'; RECONFIGURE; EXEC sp_configure 'clr strict security', '1';RECONFIGURE; EXEC sp_configure; "
Invoke-Sqlcmd -Query "EXEC sp_configure 'show advanced option', '1'; RECONFIGURE; EXEC sp_configure 'clr strict security', '1';RECONFIGURE; EXEC sp_configure; " -Username "sa" -Password "Password@123"

# Configure IIS
Import-Module Servermanager
Expand All @@ -31,7 +31,7 @@ Install-WindowsFeature Web-Windows-Auth, Web-Net-Ext45, Web-Asp-Net45, NET-WCF-H
Function GrantServiceLogon {
[cmdletbinding()]
Param (
[string] $username = ("{0}\{1}" -f $env:USERDOMAIN, $env:USERNAME)
[string] $username = ("{0}\{1}" -f $env:COMPUTERNAME, $env:USERNAME)
)
# End of Parameters
Process {
Expand Down

0 comments on commit d83e0b7

Please sign in to comment.