Skip to content

Commit

Permalink
new goodness!
Browse files Browse the repository at this point in the history
  • Loading branch information
adbertram committed Nov 28, 2018
1 parent f7a8355 commit 799363d
Show file tree
Hide file tree
Showing 18 changed files with 211 additions and 0 deletions.
@@ -0,0 +1 @@
This is a TechSnips internal identifier text file. It can be safely removed if you've downloaded this.
@@ -0,0 +1,12 @@

az vm list

az lock create --name DelLock --lock-type CanNotDelete --resource-group rg-we-TestVMs --resource-name TestVM1 --resource-type Microsoft.Compute/virtualMachines

az lock list

az lock list --resource-group rg-we-TestVMs

$vmlock=$(az lock show --name DelLock --resource-group rg-we-TestVMs --resource-name TestVM1 --resource-type Microsoft.Compute/virtualMachines --output tsv --query id)

az lock delete --ids $vmlock
@@ -0,0 +1 @@
This is a TechSnips internal identifier text file. It can be safely removed if you've downloaded this.
@@ -0,0 +1,31 @@

$server = ''

Enter-PSSession $server

# See if the Web Management feature is installed
Get-WindowsFeature Web-Mgmt-Service

# Add Web Management Feature
Add-WindowsFeature Web-Mgmt-Service

# Get the current value of EnableRemoteManagement
Get-ItemProperty -Path 'HKLM:\Software\Microsoft\WebManagement\Server' -Name EnableRemoteManagement

# Change EnableRemoteManagement value to 1 to allow remote connections
Set-ItemProperty -Path 'HKLM:\Software\Microsoft\WebManagement\Server' -Name EnableRemoteManagement -Value 1

# Get the Web Management Service Firewall rule
Get-NetFirewallRule IIS-WebServerRole-WMSVC-In-TCP

# New-NetFirewallRule -DisplayName "Web Management Service" -Direction Inbound -LocalPort 8172 -Protocol TCP -Action Allow

# Get the Web Management Service status
Get-Service WMSVC

# Start the Web Management Service
Start-Service WMSVC

# Set the WMSVC service to start automatically
Set-Service WMSVC -StartupType Automatic

@@ -0,0 +1 @@
This is a TechSnips internal identifier text file. It can be safely removed if you've downloaded this.
@@ -0,0 +1,20 @@

$EXT = Get-AzureRmVmImagePublisher -Location "UKWest" | Get-AzureRmVMExtensionImageType | Get-AzureRmVMExtensionImage
$EXT | Select-Object Type, PublisherName, Version | ft -AutoSize

$PublicSettings = @{"workspaceId" = "d45a477a-765f-40b3-8656-a721be15xxxx"}
$ProtectedSettings = @{"workspaceKey" = "3fuiw7DqvJ0OUWQ+Aj9/Z7Pw5YLGBKQw6kAbd6Qz8H2t7gc66YRbkwAnoZeL5JssXh9jZuy0OuJbFtLrQtxxxx=="}

$splat = @{
ExtensionName = "Microsoft.EnterpriseCloud.Monitoring"
Publisher = "Microsoft.EnterpriseCloud.Monitoring"
ExtensionType = "MicrosoftMonitoringAgent"
ResourceGroupName = "RG-WE-TESTVMS"
VMName = "TestVM1"
TypeHandlerVersion = "1.0"
Settings = $PublicSettings
ProtectedSettings = $ProtectedSettings
Location = "westeurope"
AsJob = $True
}
Set-AzureRmVMExtension @splat
@@ -0,0 +1 @@
This is a TechSnips internal identifier text file. It can be safely removed if you've downloaded this.
@@ -0,0 +1,16 @@

#Connect-AzureRmAccount

New-AzureRMResourceGroup -name DNSZones -location "westeurope"

New-AzureRmDnsZone -Name domain.com -ResourceGroupName DNSZones

Get-AzureRmDnsZone

Get-AzureRmDnsRecordSet -ZoneName domain.com -resourcegroupname DNSZones

New-AzureRmDnsRecordSet -Name www -RecordType A -ZoneName domain.com -ResourceGroupName DNSZones -Ttl 3600 -DnsRecords (New-AzureRmDnsRecordConfig -IPv4Address "10.10.10.10")

Remove-AzureRmDnsRecordSet -name ww -RecordType CNAME -ZoneName domain.com -ResourceGroupName DNSZones

Remove-AzureRmDnsZone -Name domain.com -ResourceGroupName DNSZones
@@ -0,0 +1 @@
This is a TechSnips internal identifier text file. It can be safely removed if you've downloaded this.
@@ -0,0 +1,14 @@

az group create --name DNSZones --location "westeurope"

az network dns zone create -g DNSZones -n domain.com

az network dns zone list

az network dns record-set a add-record -g DNSZones -z domain.com -n www -a 10.10.10.10

az network dns record-set cname set-record -g DNSZones -z domain.com -n ww -c www.domain.com

az network dns record-set cname remove-record -g DNSZones -z domain.com -n ww -c ww.domain.com

az group delete --name DNSZones
@@ -0,0 +1 @@
This is a TechSnips internal identifier text file. It can be safely removed if you've downloaded this.
@@ -0,0 +1,16 @@
Connect-AzureRmAccount

New-AzureRmResourceLock

$splat =@{
LockName = 'ROLock'
LockLevel = 'Readonly'
ResourceGroupName = 'rg-we-TestVMs'
Force = $true
}

New-AzureRmResourceLock @splat

Get-AzureRmResourceLock | Select-Object Name, ResourceName, Properties

Get-AzureRmResourceLock | Out-GridView -PassThru | Remove-AzureRmResourceLock -Force
@@ -0,0 +1 @@
This is a TechSnips internal identifier text file. It can be safely removed if you've downloaded this.
@@ -0,0 +1,16 @@
#Check to see if the module is already installed
Get-Module -ListAvailable | Where-Object -Property Name -Like "*Azure*"

#Install the AzureRM module from the PowerShell Gallery
Install-Module -Name AzureRM

#Connect and authenticate to your Azure subscription
Connect-AzureRmAccount

#Verify success by listing resource groups
Get-AzureRmResourceGroup | Select-Object -Property ResourceGroupName,Location

#Add the PowerShell Gallery as a trusted repository
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Get-PSRepository

@@ -0,0 +1 @@
This is a TechSnips internal identifier text file. It can be safely removed if you've downloaded this.
@@ -0,0 +1,69 @@
Uninstall Calculator:

Get-AppxPackage *windowscalculator* | Remove-AppxPackage
Uninstall 3D Builder:

Get-AppxPackage *3dbuilder* | Remove-AppxPackage
Uninstall Calendar and Mail:

Get-AppxPackage *windowscommunicationsapps* | Remove-AppxPackage
Uninstall Alarms and Clock:

Get-AppxPackage *windowsalarms* | Remove-AppxPackage
Uninstall Camera:

Get-AppxPackage *windowscamera* | Remove-AppxPackage
Uninstall Get Office:

Get-AppxPackage *officehub* | Remove-AppxPackage
Uninstall Get Started:

Get-AppxPackage *getstarted* | Remove-AppxPackage
Uninstall Get Skype:

Get-AppxPackage *skypeapp* | Remove-AppxPackage
Uninstall Groove Music:

Get-AppxPackage *zunemusic* | Remove-AppxPackage
Uninstall Maps:

Get-AppxPackage *windowsmaps* | Remove-AppxPackage
Uninstall Microsoft Solitaire Collection:

Get-AppxPackage *solitairecollection* | Remove-AppxPackage
Uninstall Money:

Get-AppxPackage *bingfinance* | Remove-AppxPackage
Uninstall Movies & TV:

Get-AppxPackage *zunevideo* | Remove-AppxPackage
Uninstall News:

Get-AppxPackage *bingnews* | Remove-AppxPackage
Uninstall OneNote:

Get-AppxPackage *onenote* | Remove-AppxPackage
Uninstall People:

Get-AppxPackage *people* | Remove-AppxPackage
Uninstall Phone Companion:

Get-AppxPackage *windowsphone* | Remove-AppxPackage
Uninstall Photos:

Get-AppxPackage *photos* | Remove-AppxPackage
Uninstall Sports:

Get-AppxPackage *bingsports* | Remove-AppxPackage
Uninstall Store:

Get-AppxPackage *windowsstore* | Remove-AppxPackage
Uninstall Voice Recorder:

Get-AppxPackage *soundrecorder* | Remove-AppxPackage
Uninstall Weather:

Get-AppxPackage *bingweather* | Remove-AppxPackage
Uninstall Xbox:

Get-AppxPackage *xboxapp* | Remove-AppxPackage
@@ -0,0 +1 @@
This is a TechSnips internal identifier text file. It can be safely removed if you've downloaded this.
@@ -0,0 +1,8 @@
function Resize-AzureRMVM ($VM, $VMNewSize) {

$VirtualMachine = Get-AzureRmVM | Where-Object {$_.name -eq $VM}

$VirtualMachine.HardwareProfile.VmSize = $VMNewSize

$VirtualMachine | Update-AzureRmVM -AsJob
}

0 comments on commit 799363d

Please sign in to comment.