mirror of
https://dev.azure.com/effectory/Survey%20Software/_git/Cloud%20Engineering
synced 2026-02-27 18:52:18 +01:00
Added more storage scripts #115638
This commit is contained in:
@@ -3,9 +3,17 @@ $AzureSQLDatabaseName = "yyyy"
|
||||
$SQLOutput = ""
|
||||
|
||||
try {
|
||||
$AzureSQLServerName = $AzureSQLServerName + ".database.windows.net"
|
||||
$Cred = Get-AutomationPSCredential -Name "SQLServerUser-AzureAutomation"
|
||||
$SQLOutput = $(Invoke-Sqlcmd -ServerInstance $AzureSQLServerName -Username $Cred.UserName -Password $Cred.GetNetworkCredential().Password -Database $AzureSQLDatabaseName -Query "exec [dbo].[AzureSQLMaintenance] @Operation='all' ,@LogToTable=1" -QueryTimeout 65535 -ConnectionTimeout 60 -Verbose) 4>&1
|
||||
$AzureSQLServerName = $AzureSQLServerName + ".database.windows.net"
|
||||
|
||||
Disable-AzContextAutosave -Scope Process
|
||||
$AzureContext = (Connect-AzAccount -Identity).context
|
||||
|
||||
$token = (Get-AzAccessToken -ResourceUrl https://database.windows.net).Token
|
||||
|
||||
$SQLOutput = $(Invoke-Sqlcmd -ServerInstance $AzureSQLServerName `
|
||||
-Database $AzureSQLDatabaseName `
|
||||
-AccessToken "$token" `
|
||||
-Query "exec [dbo].[AzureSQLMaintenance] @Operation='all' ,@LogToTable=1" -QueryTimeout 65535 -ConnectionTimeout 60 -Verbose) 4>&1
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user