diff --git a/Modules/NetAppService.ps1 b/Modules/NetAppService.ps1 index 6e0e30c..f6d18c1 100644 --- a/Modules/NetAppService.ps1 +++ b/Modules/NetAppService.ps1 @@ -35,7 +35,7 @@ function Invoke-NetAppRestRequest { Uri = $fullUri Method = $Method Headers = $headers - TimeoutSec = 10 + TimeoutSec = 3 } if ($Body) { diff --git a/Modules/ShareSyncService.ps1 b/Modules/ShareSyncService.ps1 index 6d44e4e..79fe4eb 100644 --- a/Modules/ShareSyncService.ps1 +++ b/Modules/ShareSyncService.ps1 @@ -44,7 +44,8 @@ SELECT $useLive = if ($Config -and $Config.MsSql) { [bool]$Config.MsSql.UseLive } else { $false } if ($useLive) { try { - $connStr = Build-SqlConnectionString -Server $Config.MsSql.Server -AuthType $Config.MsSql.AuthType -Username $Config.MsSql.Username -Password $Config.MsSql.Password + $timeout = if ($Config.MsSql.ConnectionTimeout) { [int]$Config.MsSql.ConnectionTimeout } else { 3 } + $connStr = Build-SqlConnectionString -Server $Config.MsSql.Server -AuthType $Config.MsSql.AuthType -Username $Config.MsSql.Username -Password $Config.MsSql.Password -Timeout $timeout $conn = New-Object System.Data.SqlClient.SqlConnection($connStr) $conn.Open() $cmd = $conn.CreateCommand() diff --git a/Modules/SqlService.ps1 b/Modules/SqlService.ps1 index 02dc5a1..47f5dc6 100644 --- a/Modules/SqlService.ps1 +++ b/Modules/SqlService.ps1 @@ -81,7 +81,7 @@ function Get-SqlDatabases { $auth = $Config.MsSql.AuthType $user = $Config.MsSql.Username $pass = $Config.MsSql.Password - $timeout = if ($Config.MsSql.ConnectionTimeout) { [int]$Config.MsSql.ConnectionTimeout } else { 10 } + $timeout = if ($Config.MsSql.ConnectionTimeout) { [int]$Config.MsSql.ConnectionTimeout } else { 3 } $connStr = Build-SqlConnectionString -Server $server -AuthType $auth -Username $user -Password $pass -Timeout $timeout $conn = New-Object System.Data.SqlClient.SqlConnection($connStr) diff --git a/config.json b/config.json index b35d64f..0241506 100644 --- a/config.json +++ b/config.json @@ -1,35 +1,35 @@ -{ - "ActiveDirectory": { - "UseLive": true, - "DomainController": "dc01.corp.local", - "Domain": "corp.local", - "UseLdaps": false, - "BaseOU": "DC=corp,DC=local", - "Username": "", - "Password": "" - }, - "NetApp": { - "UseLive": true, - "Password": "", - "IgnoreSslErrors": true, - "ClusterEndpoint": "https://10.200.10.50", - "DefaultSvm": "svm_cifs_prod01", - "Port": 443, - "Username": "admin" - }, - "MsSql": { - "AuthType": "Integrated", - "Username": "sa", - "BackupDirectory": "C:\\Backups", - "DefaultDatabase": "master", - "Password": "", - "ConnectionTimeout": 10, - "UseLive": true, - "Server": "localhost" - }, - "Application": { - "LiveMode": true, - "AutoRefreshSeconds": 60, - "Theme": "Dark" - } -} \ No newline at end of file +{ + "Application": { + "LiveMode": false, + "Theme": "Dark", + "AutoRefreshSeconds": 60 + }, + "ActiveDirectory": { + "UseLive": false, + "DomainController": "dc01.corp.local", + "Domain": "corp.local", + "BaseOU": "DC=corp,DC=local", + "UseLdaps": false, + "Username": "", + "Password": "" + }, + "NetApp": { + "UseLive": false, + "ClusterEndpoint": "https://10.200.10.50", + "Port": 443, + "DefaultSvm": "svm_cifs_prod01", + "Username": "admin", + "Password": "", + "IgnoreSslErrors": true + }, + "MsSql": { + "UseLive": false, + "Server": "localhost", + "AuthType": "Integrated", + "Username": "sa", + "Password": "", + "DefaultDatabase": "master", + "ConnectionTimeout": 3, + "BackupDirectory": "C:\\Backups" + } +}