This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import base64 | |
import re | |
import xml.etree.ElementTree as ElementTree | |
import xml.etree.ElementTree as ET | |
from datetime import datetime, timedelta | |
from requests.packages.urllib3.exceptions import InsecureRequestWarning | |
import pandas as pd | |
# Disable SSL certificate validation warning |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-PsSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue | |
#Connect-VBRServer -Server localhost | |
#Use backup Older than X Days | |
$olderthandays = 3 | |
#GFS Set Your retention | |
$Monthly = 6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$verbose=$False;if ($args[0] -eq "-verbose" -or $args[0] -eq "--v") {$verbose=$True;write-output ""} | |
$info="Started "+(date) | |
write-output $info | |
$logpath="C:\ProgramData\Veeam\Backup" | |
$disp="Check for fastclone in backup logs for server "+(hostname) | |
write-output $disp | |
$jobs=(Get-VBRJob | ?{$_.jobtype -eq "Backup"}) | |
$data=@(); | |
foreach ($j in ($jobs)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try{$path=($args -match "-path=").substring(6)} | |
catch{Write-host "missing path argument" -fore red} | |
try{$myhost=($args -match "-host=").substring(6)} | |
catch{Write-host "missing host argument" -fore red} | |
if (!$path.contains('\')) { | |
Write-host "suspiscious path provided $path. please use quotes for arguments." -fore red | |
exit | |
} | |
$unc="\\$myhost\"+$path.replace(':','$') | |
try {gci $unc -erroraction stop > $null} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Log { | |
<# | |
.Synopsis | |
Function to log input string to file and display it to screen | |
.Description | |
Function to log input string to file and display it to screen. Log entries in the log file are time stamped. Function allows for displaying text to screen in different colors. | |
.Parameter String | |
The string to be displayed to the screen and saved to the log file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Auth Get Token | |
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]" | |
$headers.Add("Authorization", "Bearer") | |
$headers.Add("Content-Type", "application/x-www-form-urlencoded") | |
add-type @" | |
using System.Net; | |
using System.Security.Cryptography.X509Certificates; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add veeam snapin | |
Add-PSSnapin VeeamPSSnapin | |
# Connect to veeam backup server | |
Connect-VBRServer -Server "veeam" -User "Usernamer" -Password "****" | |
# Assign veriables to each restore point being used & Credntials for mount process |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-PSSnapin VeeamPSSnapin | |
Connect-VBRServer -Server "YOUR BACKUP SERVER" | |
$restorepointNC = Get-VBRBackup -Name "Azurestack Infrastructure" | Get-VBRRestorePoint -Name "AzS-NC01" | Sort-Object $_.creationtime -Descending | Select -First 1 | |
$restorepointACS = Get-VBRBackup -Name "Azurestack Infrastructure" | Get-VBRRestorePoint -Name "AzS-ACS01" | Sort-Object $_.creationtime -Descending | Select -First 1 | |
$restorepointWAS = Get-VBRBackup -Name "Azurestack Infrastructure" | Get-VBRRestorePoint -Name "AzS-WAS01" | Sort-Object $_.creationtime -Descending | Select -First 1 | |
$restorepointWASP = Get-VBRBackup -Name "Azurestack Infrastructure" | Get-VBRRestorePoint -Name "AzS-WASP01" | Sort-Object $_.creationtime -Descending | Select -First 1 | |
$restorepointSRN = Get-VBRBackup -Name "Azurestack Infrastructure" | Get-VBRRestorePoint -Name "AzS-SRNG01" | Sort-Object $_.creationtime -Descending | Select -First 1 | |
$restorepointGW = Get-VBRBackup -Name "Azurestack Infrastructure" | Get-VBRRestorePoint -Name "AzS-Gwy01" | Sort- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Start-VBRVMRestoreToAzure -RestorePoint $restorepointNC -Subscription $subscription -StorageAccount $storageaccount -VmSize $vmsizeSMALL -VirtualNetwork $network -VirtualSubnet $subnet -ResourceGroup $resourcegroup -VmName Azs-NC01-Azure -Reason "TESTING MY NEW SCRIPT" | |
Start-VBRVMRestoreToAzure -RestorePoint $restorepointACS -Subscription $subscription -StorageAccount $storageaccount -VmSize $vmsizeSMALL -VirtualNetwork $network -VirtualSubnet $subnet -ResourceGroup $resourcegroup -VmName Azs-ACS01-Azure -Reason "TESTING MY NEW SCRIPT" | |
Start-VBRVMRestoreToAzure -RestorePoint $restorepointWAS -Subscription $subscription -StorageAccount $storageaccount -VmSize $vmsizeMEDIUM -VirtualNetwork $network -VirtualSubnet $subnet -ResourceGroup $resourcegroup -VmName Azs-WAS01-Azure -Reason "TESTING MY NEW SCRIPT" | |
Start-VBRVMRestoreToAzure -RestorePoint $restorepointWASP -Subscription $subscription -StorageAccount $storageaccount -VmSize $vmsizeMEDIUM -VirtualNetwork $network -VirtualSubnet $subnet -ResourceGroup $resou |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$vmsizeSMALL = Get-VBRAzureVMSize -Subscription $subscription -Location $location -Name Standard_A2_v2 | |
$vmsizeMEDIUM = Get-VBRAzureVMSize -Subscription $subscription -Location $location -Name Standard_A4_v2 | |
$vmsizeLARGE = Get-VBRAzureVMSize -Subscription $subscription -Location $location -Name Standard_A8_v2 |
NewerOlder