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
$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 |
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
#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; | |
} |
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
## 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 { |
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 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 |
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 md5text { param($text) ([System.Security.Cryptography.MD5]::Create().ComputeHash([System.Text.Encoding]::UTF8.GetBytes($text))| % {$_.toString("x2") }) -join ""} |
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
$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 |
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 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 |
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
$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(); | |
} |
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
$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 |
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
#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", |
OlderNewer