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
<# | |
.Synopsis | |
Scans for all snapshots including hidden ones on all VM's, or selected ones. | |
.Description | |
Returns a list of snapshots that include hidden and visible ones. Invisble snapshots are considered snapshots that can only be found by searching the VMFS file system for *delta* files. | |
Pipeline support is included. | |
.Example | |
get-allvmsnapshot | |
Returns the total number of snapshot related files in the envionrment as well as a list of VM's with hidden snapshots. |
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
> $ python3 cloudvisreq.py xxxxx mailpieceImg.jpg [±master ●] | |
Wrote 369757 bytes to jsons/mailpieceImg.jpg.json | |
--------------------------------------------- | |
Bounding Polygon: | |
{'vertices': [{'x': 18, 'y': 19}, {'x': 652, 'y': 19}, {'x': 652, 'y': 426}, {'x': 18, 'y': 426}]} | |
Text: | |
Presorted Standard | |
U.S. POSTAGE PAID | |
AMERICAN EXPRESS | |
AMERICAN EXPRESS |
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
#Reboot VM's | |
$vmlist = "RMIP6S", | |
"rmipcs", | |
"rmipts", | |
"rmivcm", | |
"RCIACCT03", | |
"RMIXA02", | |
"RMIXA03", | |
"RMIXA05", | |
"RMIXA06", |
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
connect-viserver rmivc.rci.local | |
$vmlist = "rmiacct","rmifiles1" | |
foreach ($vm in $vmlist) {get-vm $vm | move-vm -Destination NS2} |
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
#Note - For no UAC POP Requires UAC to be disabled. Also, Requires executionpoliy set to bypass, or unrestricted. | |
$arg = 'RESPONSEFILE="\\WCI-APP\Timberline Office\Install Scripts\ClientResponse.log"', | |
'SUPPRESS_REBOOT_DIALOG=true', | |
'/silent', | |
'/debuglog"c:\temp\install_log.log"' | |
#Check for .net 3.5 | |
$fxstate = Get-WindowsCapability -Online -Name NetFX3~~~~ | |
if ($fxstate.state -ne "Installed"){write-host "Installing .Net Framework 3.5"} |
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
#Create a CSV file with a Column called name containing all your VM names, 1 per line. | |
$vmlist = import-csv "c:\your\csv\here.csv" | |
$totaldiskgb = @() | |
foreach ($vm in $vmlist) { | |
$disksum = get-vm $vm.name | get-harddisk | Select-Object CapacityGB | Measure-Object CapacityGB -Sum | |
$totaldiskgb += $disksum.sum | |
} | |
$gb = ($totaldiskgb | measure-object -sum).sum | |
Write-host " Total Size $t GB" |
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
#Make sure you are connected to vCenter | |
$vcenter = 'rgavc2' | |
$serverlist = $global:DefaultVIServer | |
if($serverlist -eq $null) { | |
write-host "Connecting to $vcenter" | |
connect-viserver -Server $vcenter | |
} | |
#User Configurtable Parmaters. Include each VM and it's associated IP in the list below. | |
$vmlist = @{"192.168.0.21" = "temp3"} |
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
$content = Import-Csv 'c:\test.csv' | |
foreach ($user in $content){ | |
New-ADUser -Enabled $True -AccountPassword (ConvertTo-SecureString aiwhc321 -AsPlainText -force) -name $user."Display Name" ` | |
-homeDirectory $user."Home Directory" ` | |
-homedrive $user."Home Drive" ` | |
-scriptPath $user."Script Path" ` | |
-SamAccountName $user."SAM Account Name" ` | |
-path $user."OU Name" |
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
#!/bin/bash | |
#Backup databases | |
echo Backing up databases | |
sudo mysql -Ns -e"SHOW DATABASES" > ~/db_list.txt | |
mkdir ~/db_backup/ | |
cat ~/db_list.txt | while read i | |
echo Backing up $i | |
do sudo mysqldump "$i" > ~/db_backup/"$i".sql | |
done |
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
#Pyhton to couchpotato API | |
import requests | |
from pprint import pprint | |
import json | |
#Get the data | |
data = requests.get("http://slimleech:5001/api/556033fe3c9b4a1caf6fcbed6fd2f66a/media.list") | |
binary = data.content | |
output = json.loads(binary) |