Hp OneView Bedienungsanleitung Seite 293

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 309
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 292
try
{
$savedLoginJson = "[" + $savedLoginJson + "]"
$savedloginVals = $savedLoginJson | convertFrom-Json
$SecStrLoginname = $savedloginVals.userName | ConvertTo-SecureString -ErrorAction stop
$loginname =
[Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecStrLoginName))
$hostname = $savedloginVals.hostname
$SecStrPassword = $savedloginVals.password | ConvertTo-SecureString -ErrorAction stop
$password =
[Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecStrpassword))
}
catch [System.Exception]
{
if ($global:interactiveMode -eq 1)
{
Write-Host "Failed to get credentials: " + $error[0].Exception.Message
}
else
{
Write-EventLog -EventId 100 -LogName Application -Source backup.ps1 -Message "Failed to get credentials: "
+ $error[0].Exception.Message
}
}
#determines the active Api version
$global:scriptApiVersion = getApiVersion $global:scriptApiVersion $hostname
if ($global:scriptApiVersion -eq $null)
{
if ($global:interactiveMode -eq 1)
{
Write-Host "Could not determine appliance Api version"
}
Write-EventLog -EventId 100 -LogName Application -Source backup.ps1 -Message "Could not determine appliance
Api version"
return
}
#sends the login request to the machine, gets an authorized session ID if successful
$authValue = login-appliance $loginname $password $hostname
if ($authValue -eq $null)
{
if ($global:interactiveMode -eq 1)
{
Write-Host "Failed to receive login session ID."
}
Write-EventLog -EventId 100 -LogName Application -Source backup.ps1 -Message "Failed to receive login session
ID."
return
}
#sends the request to start the backup process, returns the taskResource object
$taskResource = backup-Appliance $authValue.sessionID $hostname
if ($taskResource -eq $null)
{
if ($global:interactiveMode -eq 1)
{
Write-Host "Could not initialize backup"
}
Write-EventLog -EventId 100 -LogName Application -Source backup.ps1 -Message "Could not initialize backup"
return
}
#loops to keep checking how far the backup has gone
$taskResource = waitFor-completion $taskResource $authValue.sessionID $hostname
if ($taskResource -eq $null)
{
if ($global:interactiveMode -eq 1)
{
Write-Host "Could not fetch backup status"
}
Write-EventLog -EventId 100 -LogName Application -Source backup.ps1 -Message "Could not fetch backup status"
return
}
#gets the backup resource
$backupResource = get-backupResource $taskResource $authValue.sessionID $hostname
if ($backupResource -eq $null)
C.1 Beispiel für ein Sicherungsskript 293
Seitenansicht 292
1 2 ... 288 289 290 291 292 293 294 295 296 297 298 ... 308 309

Kommentare zu diesen Handbüchern

Keine Kommentare