Skip to content

Instantly share code, notes, and snippets.

View cevans3505's full-sized avatar

CEvans cevans3505

  • Veeam Software
  • Columbus, OH
View GitHub Profile
@cevans3505
cevans3505 / Adjust-PeriodicCopyIntervals.ps1
Last active April 28, 2022 18:22
Customer requested a script to modify multiple Backup Copy Jobs from 30 day copy intervals to 1 day (because multiple jobs needed to complete initial seed). This script will gather all BCJs currently set to 30 day interval that have finished with their initial task and list them to the user and ask for confirmation before making adjustments.
#Checking elevation rights
if (!(New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator))
{
Write-Host "You're running PowerShell without elevated rights. Please re-run this script using PowerShell as an Administrator." -BackgroundColor Black -ForegroundColor Red
$null = Read-Host 'Press [ENTER] to exit.'
Exit
}
#Get current user for logging purposes
Import-Module Veeam.Backup.PowerShell -ErrorAction SilentlyContinue -WarningAction SilentlyContinue
@cevans3505
cevans3505 / Get-VeeamGuestLogs.ps1
Last active May 5, 2022 19:23
Used to easily capture all the logs necessary for troubleshooting issues with in-guest processing (SQL, Exchange, Active Directory, etc.).
#Verify running PowerShell as Administrator
Write-Console "Checking elevation rights..." "White" 1
if (!(New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Console "PowerShell does not have elevated rights. Please open a PowerShell window as Administrator and run the script again." "Red" 3
Exit
}
else {
Write-Console "PowerShell is running with Administrator privileges. Starting data collection..."
}
@cevans3505
cevans3505 / Get-Azure-IPs.ps1
Created April 6, 2022 15:54
Get IP Ranges for Azure endpoints
Write-Host "
List of valid Azure regions:
uswestcentral
uswest2
uswest
ussouth
usnorth
useast2euap
useast2
@cevans3505
cevans3505 / Get-VeeamNetStats.ps1
Last active March 29, 2022 20:18
Get-VeeamNetStats
function Get-VeeamNetStats
{
$properties = 'Protocol','LocalAddress','LocalPort'
$properties += 'RemoteAddress','RemotePort','State','ProcessName','PID'
netstat -ano | Select-String -Pattern '\s+(TCP|UDP)' | % {
$item = $_.line.split( " ",[System.StringSplitOptions]::RemoveEmptyEntries )
if ( $item[1] -notmatch '^\[::' )