Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block PixelRobots

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 Azure_Run_Command.ps1
Invoke-AzureRmVMRunCommand -ResourceGroupName '<myResourceGroup>' -Name '<myVMName>' -CommandId 'RunPowerShellScript' -ScriptPath '<pathToScript>' -Parameter @{"arg1" = "var1";"arg2" = "var2"}
View Bulkadd_AZ_DNS.PS1
#Bulk Import A Records
Import-CSV -Path "C:\scripts\arecords.csv" | ForEach-Object { New-AzureRmDnsRecordSet -Name $_.Name -RecordType $_.RecordType -ZoneName $_.ZoneName -ResourceGroupName $_.ResourceGroupName-Ttl $_.TTL -DnsRecords (New-AzureRmDnsRecordConfig -IPv4Address $_.Value) }
#Bulk Import CNAME Records
Import-CSV -Path "C:\scripts\cnamerecords.csv" | ForEach-Object { New-AzureRmDnsRecordSet -Name $_.Name -RecordType $_.RecordType -ZoneName $_.ZoneName -ResourceGroupName $_.ResourceGroupName-Ttl $_.TTL -DnsRecords (New-AzureRmDnsRecordConfig -Cname $_.Value) }
View Azure_locks.ps1
#Resource Lock
$LockName = "LockCloudWitnes"
$ResourceName = "pixelcloudwitness"
$ResourceType = (Get-AzureRmResource -Name $ResourceName).resourcetype
New-AzureRmResourceLock -LockLevel CanNotDelete -LockName $LockName -ResourceName $ResourceName -ResourceType $ResourceType -ResourceGroupName $RGName
#Resource Group Lock
$LockName = "PIXELLABLock"
View vNet_Peering.ps1
New-NetFirewallRule -DisplayName "Allow ICMPv4-In" -Protocol ICMPv4
$vnet1Name = 'Pixel1'
$vnet1RG = 'Pixel1'
$vnet2Name = 'Pixel2'
$vnet2RG = 'Pixel2'
$vnet1 = Get-AzureRmVirtualNetwork -Name $vnet1Name -ResourceGroupName $vnet1RG
$vnet2 = Get-AzureRmVirtualNetwork -Name $vnet2Name -ResourceGroupName $vnet2RG
View Azure_subscription_selector.ps1
$SubscriptionId = (Get-AzureRmSubscription | select Name, State, SubscriptionId, TenantId | Out-GridView -Title "Azure Subscription Selector" -PassThru).SubscriptionId
Get-AzureRmSubscription -SubscriptionId $SubscriptionId | Select-AzureRmSubscription
View Delete_Empty_RGs_Azure.ps1
#Log in to Azure account
#Get list of Azure Subscription ID's
$Subs = (get-AzureRMSubscription).ID
#Loop through the subscriptions to find all empty Resource Groups and store them in $EmptyRGs
ForEach ($sub in $Subs) {
Select-AzureRmSubscription -SubscriptionId $Sub
$AllRGs = (Get-AzureRmResourceGroup).ResourceGroupName
View Azure Stack Polices.ps1
invoke-webrequest -OutFile
expand-archive -DestinationPath . -Force
cd AzureStack-Tools-master
Import-Module .\Policy\AzureStack.Policy.psm1
View Domain.json
"$schema": "",
"contentVersion": "",
"parameters": {
"adminUsername": {
"type": "string",
"metadata": {
"description": "The name of the administrator account of the new VM and domain"
View Hyper-V_Groups.ps1
# Create new VM Group
New-VMGroup -Name "BackEnd" -GroupType VMCollectionType -Verbose
# Add VMs to VM Collection Group
Add-VMGroupMember -Name "BackEnd" -VM (Get-VM "SQL01"),(Get-VM "SQL02")
# Verify Group Members
(Get-VMGroup -Name "BackEnd").VMMembers
# Find group VM is member of
View backup_and_delete_unlinked_gpos.ps1
Script used to find all unlinked gpos, back them up and then delete them.
The script searches your logged on domain for unlinked GPO's. It then backs them up to a folder on the C:\. It will then remove them. It also creates a log file in the same directory.
You can’t perform that action at this time.