Skip to content

Instantly share code, notes, and snippets.

tdewin

Block or report user

Report or block tdewin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View auto-install-vbo.ps1
#auto install
<# plan_vbo365.json sample :
{
"license": { "src":"veeam_backup_microsoft_office_nfr_50.lic" },
"steps": [
{
"src":"Veeam.Backup365_2.0.0.567.msi",
"install":"__file__",
"arguments":[
"/qn",
View move-vboentitydata-sample.ps1
$repo2y = Get-VBORepository -Name repo2y
$repoinf = Get-VBORepository -Name repoinf
$alex = Get-VBOEntityData -Type User -Repository $repo2y -Name "Alex Wilber"
$alex
Move-VBOEntityData -From $repo2y -To $repoinf -User $alex
@tdewin
tdewin / cleanup.ps1
Created Aug 30, 2018
Clean up demo product install
View cleanup.ps1
$prod = "myapp"
while ($($t = get-process | ? { $_.Name -match $prod }; $t -ne $null)) { $t | Stop-Process -Force;sleep -Seconds 1 }
$apps = Get-WmiObject -Class Win32_Product | Where-Object {
$_.Name -match $prod
}
foreach($app in $apps) {
$app.Uninstall();
}
@tdewin
tdewin / Microsoft.PowerShell_profile.ps1
Created Aug 14, 2018
vSphere CLI RDP Manager in $profile
View Microsoft.PowerShell_profile.ps1
function Get-VSPLabConnection {
param(
$profilespath="HKCU:\Software\vSpshereConnections",
$address=""
)
$entries = @(Get-ItemProperty -Path $profilespath)
if ($entries.count -gt 0) {
$procentries = @()
foreach($entry in ($entries | Get-Member | ? { $_.name -match "@$address" } | % { $_.Name })) {
$item = Get-ItemPropertyValue -Path $profilespath -name $entry
@tdewin
tdewin / fileretentioncheck.ps1
Created Jul 11, 2018
Check retention of Veeam files and do something with it
View fileretentioncheck.ps1
$retDays = 14
$path = "c:\myrepository\"
$prevDate = (get-date).AddDays(-$retDays)
$filesDir = get-childitem -Path $path -Recurse -Include "*.vbk","*.vib" -File
$listrm = @()
foreach ($file in $filesDir) {
$fname = $file.FullName
@tdewin
tdewin / md5hash-text.ps1
Created Jul 9, 2018
Calculate md5 hash of text
View md5hash-text.ps1
function md5text { param($text) ([System.Security.Cryptography.MD5]::Create().ComputeHash([System.Text.Encoding]::UTF8.GetBytes($text))| % {$_.toString("x2") }) -join ""}
View start-vbomanuallmount.ps1
function start-vbomanuallmount {
if ($(Get-Module -Name Veeam.Archiver.PowerShell) -eq $null) {
$installpath = Get-ItemPropertyValue -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\Veeam.Archiver.Service' -Name ImagePath -ErrorAction SilentlyContinue
if ($installpath -ne $null) {
$modulepath = Join-Path -Path (split-Path -Parent ($installpath -replace '"', "")) -ChildPath "Veeam.Archiver.PowerShell"
write-verbose "Loading VBO module from : $modulepath"
Import-module $modulepath
}
}
$prx = Get-VBOProxy
@tdewin
tdewin / vbopsrest.ps1
Created Sep 12, 2017
VBO365 Rest API testing with powershell
View vbopsrest.ps1
#ignore self signed
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}
@tdewin
tdewin / add-adoutovbo365.ps1
Last active Nov 29, 2017
Add Users from an OU to VBO365
View add-adoutovbo365.ps1
## variables to set
$ad = "mydomain.com"
$cred = Get-Credential -UserName "administrator" -Message "AD"
$ouname = "My OU"
$orgname = "exchange.mydomain.com"
$reponame = "Default Backup Repository"
##
function New-VBOOUJob {
View justbeforepresenting.ps1
$apps = @('viber','skype','lync','outlook','spotify')
$forceclose = @()
$procs = get-process
foreach($kp in $apps) {
$procs | ? { $_.name -imatch $kp } | % {
$proc = $_
$result = $proc.CloseMainWindow()
if ($result -eq $false) {
$forceclose += $proc
You can’t perform that action at this time.