Skip to content

Instantly share code, notes, and snippets.

<#
.SYNOPSIS
Migrate single Virtual Network Gateway with the NAT Rules between NVGRE Network Services.
.DESCRIPTION
General features of that script:
- Migrate Virtual Network Gateway with several different external IPs
- Good protection from the fool :)
- Show all collected information about Virtual Network Gateway before delete
- You will newer lost of your data
$VmmServerName = "VMM01"
$SQLserver = "VMMDB"
$SQLDatabase = "IploggingDB"
$SQLuser = "MyUser"
$SQLPassword = "SecretPWD"
# Import VMM module.
Import-Module virtualmachinemanager
workflow IP-Logging
{
param
(
[Parameter(Mandatory=$true)]
[String] $VMMJOBID,
[Parameter(Mandatory=$true)]
[object] $NAME,
[Parameter(Mandatory=$true)]
[object] $OPERATION
@Cyreex
Cyreex / Integration-Services-Customization
Created April 10, 2017 14:47
Integration-Services-Customization
workflow Integration-Services-Customization
{
param
(
[Parameter(Mandatory=$true)]
[String] $VMMJOBID
)
#Constants
$TargetProp = "CustomProp"
<div class="drawer-form-item vm-columns clearfix">
<div class="vm-network-container">
<label for="vm-instance-network">{{res "labelNetwork" /}}</label>
<select id="vm-instance-network"
data-link="vmData.network"
data-val="true"
data-val-vm-dropdownValidValueValidator="{{res 'networkIsRequired' _encode='attr' /}}">
{^{for virtualNetworks }}
<option value="{{attr:id}}">{{>displayName}}</option>
{{/for}}
var promise, requestPromise,
i,
networks = [],
deferred = $.Deferred(), vmNet;
var virtualNetworks = data.vmNetworks;
var networkId = data.network;
if (networkId && virtualNetworks && virtualNetworks.length > 0) {
for (i = 0; i < virtualNetworks.length; i++) {
if (virtualNetworks[i].id === networkId) {
vmNet = virtualNetworks[i];
function _updateNetworks() {
var that = this,
sortedNetworkList;
if (this.vmData.subscriptionId) {
$.observable(this.virtualNetworks).refresh([loadingEntryItem]);
global.VMExtension.Model.Ajax.getNetworksWithSubnets(this.vmData.subscriptionId)
.done(function(response) {
sortedNetworkList = response ? response.sort(global.VMExtension.Utilities.dynamicMultiSort([{ propertyName: "displayName", isDescending: false }])) : [];
$.observable(that.virtualNetworks).refresh(sortedNetworkList);
if (that.virtualNetworks.length === 0) {
$VirtualDiskDrive = Get-SCVirtualDiskDrive -VMMServer clvmm01.linby.local -All | where {$_.ID -eq "50b2cc40-72c4-4371-905a-97396b5d597b"}
Set-SCVirtualDiskDrive -VirtualDiskDrive $VirtualDiskDrive -Bus 0 -LUN 0 -VolumeType BootAndSystem -SCSI -JobGroup 3a685e08-ad5c-4805-8359-8c620eaaa8f2
$VM = Get-SCVirtualMachine -VMMServer clvmm01.linby.local -Name "Tema_KS_01" -ID "3bb22b9d-000d-4fcb-948e-4b6f9bd67c7b" | where {$_.VMHost.Name -eq "host12-clu1-ost.linby.local"}
$OperatingSystem = Get-SCOperatingSystem -VMMServer clvmm01.linby.local -ID "50b66924-c64a-4a06-b05a-7e6610c579a2" | where {$_.Name -eq "Windows Server 2012 R2 Standard"}
$UserRole = Get-SCUserRole -VMMServer clvmm01.linby.local -Name "tema@lin.by_37e33e28-b4f8-473e-9dc3-0016b3dbe699" -ID "37e33e28-b4f8-473e-9dc3-0016b3dbe699"
$CPUType = Get-SCCPUType -VMMServer clvmm01.linby.local | where {$_.Name -eq "3.60 GHz Xeon (2 MB L2 cache)"}
Set-SCVirtualMachine -VM $VM -Name "Tema_KS_01" -Description "" -OperatingSystem $OperatingSystem -Owner 'tema@
# Billing-Subscriptions runbook
# Version 0.7.2
workflow Billing-Subscriptions
{
param
(
[Parameter(Mandatory=$false)]
[String] $SubscriptionID,
[Parameter(Mandatory=$true)]
#Billing script v.0.7.1
#SCVMM
$cloudName="LinByCloud"
$vmm_cluster = "clvmm"
$TaskType="Hourly"
### DB CONNECTION
$server = "SCVMMDB"
$Database = "BillingDB"