diff options
author | heqnx <root@heqnx.com> | 2025-07-14 16:16:45 +0300 |
---|---|---|
committer | heqnx <root@heqnx.com> | 2025-07-14 16:16:45 +0300 |
commit | 32a92a4fd19baa6438c0443deb247e93d02b1948 (patch) | |
tree | 8e310eeaac4da16f58badbb8e906f6566c3c0803 /ansible/scripts/setup-websql.ps1 | |
parent | b1ca188b8a16a49b79cd18ae39261fe9c666edf1 (diff) | |
download | ansible-active-directory-range-32a92a4fd19baa6438c0443deb247e93d02b1948.tar.gz ansible-active-directory-range-32a92a4fd19baa6438c0443deb247e93d02b1948.zip |
added defender disabling gpo, changed print messages in scripts, logging set domain network
Diffstat (limited to 'ansible/scripts/setup-websql.ps1')
-rw-r--r-- | ansible/scripts/setup-websql.ps1 | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/ansible/scripts/setup-websql.ps1 b/ansible/scripts/setup-websql.ps1 index 7865091..02e370b 100644 --- a/ansible/scripts/setup-websql.ps1 +++ b/ansible/scripts/setup-websql.ps1 @@ -71,18 +71,18 @@ FTSVCACCOUNT="NT Service\MSSQLFDLauncher" SqlCmd -E -Q "ALTER LOGIN sa ENABLE" SqlCmd -E -Q "ALTER LOGIN sa WITH PASSWORD = '$SvcPassword', CHECK_POLICY=OFF" - Write-Host "[INFO] Added $NetBiosName\$SvcUsername as MSSQL login and sysadmin" - Write-Host "[INFO] Enabled SA login" + Write-Host "[inf] Added $NetBiosName\$SvcUsername as MSSQL login and sysadmin" + Write-Host "[inf] Enabled SA login" } catch { - Write-Host "[ERR] SQL Server setup failed" + Write-Host "[err] SQL Server setup failed" } try { Install-WindowsFeature -Name Web-Server -IncludeManagementTools Install-WindowsFeature -Name Web-Asp-Net45 - Write-Host "[INFO] Installed IIS and ASP.NET" + Write-Host "[inf] Installed IIS and ASP.NET" } catch { - Write-Host "[ERR] Failed to install IIS and ASP.NET" + Write-Host "[err] Failed to install IIS and ASP.NET" } @" @@ -150,9 +150,9 @@ try { Set-ItemProperty "IIS:\AppPools\DefaultAppPool" -Name processModel -Value @{userName="$SvcUsername";password="$SvcPassword";identityType=3} New-NetFirewallRule -DisplayName "HTTP (80)" -Direction Inbound -Protocol TCP -LocalPort 80 -Action Allow Restart-WebAppPool -Name "DefaultAppPool" - Write-Host "[INFO] Site 1 created on port 80" + Write-Host "[inf] Site 1 created on port 80" } catch { - Write-Host "[ERR] Failed to create site 1" + Write-Host "[err] Failed to create site 1" } try { @@ -160,9 +160,9 @@ try { $acl = Get-Acl $wwwroot1 $acl.SetAccessRule($svcRule) Set-Acl -Path $wwwroot1 -AclObject $acl - Write-Host "[INFO] ACL set for $wwwroot1" + Write-Host "[inf] ACL set for $wwwroot1" } catch { - Write-Host "[ERR] Failed to set ACL for $wwwroot1" + Write-Host "[err] Failed to set ACL for $wwwroot1" } try { @@ -176,9 +176,9 @@ try { $acl.SetAccessRule($rule) Set-Acl -Path $wwwroot2 -AclObject $acl Restart-WebAppPool -Name "DefaultAppPool2" - Write-Host "[INFO] Site 2 created on port 8080" + Write-Host "[inf] Site 2 created on port 8080" } catch { - Write-Host "[ERR] Failed to create site 2" + Write-Host "[err] Failed to create site 2" } try { @@ -250,9 +250,9 @@ try { "@ | Out-File "$wwwroot3\sqlquery.aspx" -Force Restart-WebAppPool -Name "SqlQueryAppPool" - Write-Host "[INFO] Site 3 created on port 9090 with SQL query page" + Write-Host "[inf] Site 3 created on port 9090 with SQL query page" } catch { - Write-Host "[ERR] Failed to create SQL query site" + Write-Host "[err] Failed to create SQL query site" } Stop-Transcript |