• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/88

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

88 Cards in this Set

  • Front
  • Back
Get details about the Windows Server 2012 R2 Datacenter gallery Image

$imagefamily = "Windows Server 2012 R2Datacenter"


Get-AzureVMImage | where { $_.ImageFamily -eq$imagefamily }

Deploy a new, basic Windows VM

New-AzureQuickVM –Windows–ServiceName "MySvc1" –name "MyWinVM1" –ImageName $image–Password $adminPasswd

Deploy a new, basic Linux VM

New-AzureQuickVM –Linux–ServiceName "MySvc2" –name "MyLxVM1" –ImageName $image–LinuxUser $user –Password $adminPasswd –Location $dclocation

Deploy a new, large VM

New-AzureQuickVM –Windows –InstanceSize"Large" –ServiceName "MySvc3" –name "MyWinVM1"–ImageName $images[4].imagename –Password $adminPasswd –location $dclocations[0].name



Cmdlets used (together) for complex VM deployments

New-AzureVMConfig




Add-AzureProvisioningConfig




Add-AzureDataDisk




Add-AzureEndpoint



New-AzureVM



Create a Storage account
New-AzureStorageAccount -StorageAccountName"myexamtest" -Location $location
CmdLet for showing Blob endpoint URL (https) and Container names
Get-AzureStorageContainer
Deploy a new Windows VM, Extra small size with an additional 50GB data disk on LUN 0. Set the local Windows admin username and password
New-AzureVMConfig -Name "MyVM1"-InstanceSize ExtraSmall -ImageName $image | Add-AzureProvisioningConfig-Windows -Password $adminPassword | Add-AzureDataDisk -CreateNew-DiskSizeInGB 50 -DiskLabel 'datadisk1' -LUN 0 | New-AzureVM –ServiceName"MySvc1"
Display all Azure VM Instance sizes

Get-AzureRoleSize

Display information on the Azure Subscriptions

Get-AzureSubscription

Change Azure Subscription

Set-AzureSubscription-SubscriptionName "Development"

Set default Azure subscription

Set-AzureSubscription–DefaultSubscription "MySub"

Display Azure Datacenter regions

Get-AzureLocation

Find out if an Azure Cloud Service name already exists
Test-AzureName -Service -Nametest
Show Cloud Services in Subscription



Get-AzureService



Set Azure Subscription storage account

Set-AzureSubscription -SubscriptionName$subscriptioname '


-CurrentStorageAccountName $storageAccount

Switch used to override VHD locations

New-AzureVMConfig .... -MediaLocation

Uploads a service certificate for the specified cloud service
Add-AzureCertificate
Generate a new SSH Key for a Linux VM
New-AzureSSHKey
Disable Windows Updates

Add-AzureProvisioningConfig -DisableAutomaticUpdates…

Set time zone to London
dd-AzureProvisioningConfig -TimeZone"London" …
Deploy a Certificate
Add-AzureProvisioningConfig -X509Certificates $cert
Change VM local password on first logon
Add-AzureProvisioningConfig -ResetPasswordOnFirstLogon
Shutdown a VM

Stop-AzureVM -ServiceName $serviceName -Name $vmName

Shutdown all VMs in a Cloud Service and deallocate Public VIP
Get-AzureVM -ServiceName $serviceName | Stop-AzureVM -Force
PowerShell switch to keep Cloud Service VIP when last VM shutdown
-StayProvisioned
Power on a Virtual Machine
Start-AzureVM -ServiceName $serviceName -Name $vmName
Reboot an Azure Virtual Machine

Restart-AzureVM -ServiceName "myservice1" –Name"MyVM"

Delete an Azure Virtual Machine AND the virtual disks
Remove-AzureVM -ServiceName $serviceName -Name$vmName -DeleteVHD
Modify an existing Azure Virtual Machine
Update-AzureVM
Delete a Cloud Service and all Virtual Machines

Remove-AzureService -ServiceName $serviceName -Name $vmName -Force -DeleteAll

Display Virtual Machine Endpoints

Get-AzureVM -ServiceName $service -Name $VMName | Get-AzureEndpoint

Retrievethe URI of the Windows Remote Management (WinRM) https listener

Get-AzureWinRMUri

Save RDP file to C:\temp

Get-AzureRemoteDesktopFile -ServiceName $servicename -Name $VMName -LocalPath"c:\temp\test.rdp"

Open RDP connection from PowerShell

Get-AzureRemoteDesktopFile -ServiceName $serviceName -Name $VMName -Launch

Prevent the WinRM, SSH and RDP endpoints from being added when deploying a Virtual Machine

Add-AzureProvisioningConfig



-NoWinRMEndpoint


-NoSSHEndpoint


-NoRDPEndpoint

Disable the Windows Remote Management (WinRM) service on https, instead of enabling it by default.
New-AzureQuickVM -DisableWinRMHttps

Upload a virtual hard disk (in .vhdfile format) from an on-premises virtual machine to a blob in a cloud storageaccount in Azure


Add-AzureVhd -Destinationhttp://mytestaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd -LocalFilePathC:\vhd\MyWin7Image.vhd -NumberOfUploaderThreads 32

Download a VHD from a BLOB to a local path and overwrite

Save-AzureVhd-Source http://mytestaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd -LocalFilePathC:\vhd\MyWin7Image.vhd -Overwrite

Add a disk to a VM
Add-AzureDataDisk

Adds new disk to the Azure disk repository.


Add-AzureDisk
Capturesand saves the image of a stoppedAzure virtual machine

Save-AzureVMImage

Capture a Specialized image

Save-AzureVMImage -ServiceName $serviceName -Name $vmName -ImageName$ImageName -ImageLabel $imageLabel -OSState Specialized

Capture a sysprepped image

Save-AzureVMImage -ServiceName $serviceName -Name $vmName -ImageName$ImageName -ImageLabel $imageLabel -OSState Generalized

Updatethe Data Disk properties on the VM Image

Set-AzureVMImageDataDiskConfig -DiskConfig


..


Update-AzureVMImage

How to check if disk attached, corrupted, size in GB, label, location, disk name and OS type
Get-AzureDisk
Find an Azure Image with a specific label

Get-AzureVMImage | where { $_.Label -match"myimage-label2"}

Associate a VHD as a Windows boot disk

Add-AzureDisk -DiskName "MyWinDisk" -MediaLocation "http://yourstorageaccount.blob.core.azure.com/vhds/winserver-system.vhd" -Label "BootDisk" -OS "Windows"




(note -DiskName)

Add OS image to a repository
Add-AzureVMImage -ImageName imageName -MediaLocation http://yourstorageaccount.blob.core.azure.com/container/sampleImage.vhd -LabelimageLabel -OS Windows
Create new data disk and add to existing VM

Get-AzureVM "myservice" -Name"MyVM" |
Add-AzureDataDisk -CreateNew -DiskSizeInGB 128 -DiskLabel "main" -LUN0 |
Update-AzureVM

Add existing disk from repository to a VM (i.e. My Disks)

Get-AzureVM "myservice" -Name"MyVM" |
Add-AzureDataDisk -Import -DiskName "MyExistingDisk" -LUN 0 |
Update-AzureVM

Updates a virtual machine by attaching an existing data disk from a storage location

Get-AzureVM "myservice" -Name"Database" `|
Add-AzureDataDisk -ImportFrom -MediaLocation ` "https://mystorage.blob.core.windows.net/mycontainer/MyExistingDisk.vhd" -DiskLabel "main" -LUN 0 |
Update-AzureVM

Copy Blobs between Storage accounts

$blob = Start-AzureStorageBlobCopy -SrcContainer vhds -SrcBlob "xxxx.vhd" -DestContainer vhds-DestBlob "xxxx.vhd" -DestContext $destContext

Remove an Image from the repository
Remove-AzureVMImage -ImageName MyOSImage –DeleteVHD
Remove a disk from the repository
Remove-AzureDisk -DiskName "MyDataDisk" –DeleteVHD
List VM extensions
Get-AzureVMExtension
How to check if VM Agent installed

$x = Get-AzureVM -ServiceName $vmName


$x.vm.ProvisionGuestAgent


True

Reset VM password
Get-AzureVM –ServiceName$service –Name $VMName | Set-AzureVMAccessExtension –UserName–Password | Update-AzureVM
Fix VM RDP settings
Get-AzureVM –ServiceName$service –Name $VMName | Set-AzureVMAccessExtension | Update-AzureVM
Enable BGInfo

Get-AzureVM –ServiceName –Name | Set-AzureVMBGInfoExtension | Update-AzureVM

Deploy a custom script

Set-AzureVMCustomScriptExtension -FileUri $script -Run myscriptname.ps1




-FileUri = https Blob path

Upload a Desired State Configuration script to Azure blob storage
Publish-AzureVMDscConfiguration .\MyConfiguration.ps1 -ConfigurationArchivePath .\MyConfiguration.ps1.zip
Configure Puppet server

Set-AzureVMPuppetExtension -PuppetMasterServer$puppetServer

Configure Chef server

No PowerShellcommands for Chef

Add an Endpoint to a VM

Get-AzureVM -ServiceName $serviceName -Name $vmName|


Add-AzureEndpoint -Name "SQL" -Protocol tcp -LocalPort 1433-PublicPort 1433 |


Update-AzureVM


Remove an Endpoint from a VM

Get-AzureVM -ServiceName $serviceName -Name $vmName| Remove-AzureEndpoint -Name "SQL" | Update-AzureVM

Display Endpoints for a VM

Get-AzureVM -ServiceName $serviceName -Name $vmName| Get-AzureEndpoint

Add a VM to an existing Load Balancer

Get-AzureVM -ServiceName "CanITProCamp"-Name "WEBFE02" |


Add-AzureEndpoint -Name "HTTP" -Protocol"TCP" -PublicPort 80 -LocalPort 80


-LBSetName "Web-Farm" -DefaultProbe | Update-AzureVM




(-LBSetName)

Update all of the endpoints in a load-balanced set to use a different port number

Set-AzureLoadBalancedEndpoint -ServiceName "MyService" -LBSetName"LBSet1" -Protocol tcp -LocalPort 80 -ProbeProtocolTCP -ProbePort8080

Updatean existing endpoint assigned to a virtual machine

Get-AzureVM -ServiceName "MyService" -Name"MyVM" |


Set-AzureEndpoint -Name "Web" -PublicPort 443 -LocalPort443 -Protocol "tcp" |


Update-AzureVM

Create annew, empty configuration object for an access control list (ACL)


$acl = New-AzureAclConfig
Add rule to an ACL

Set-AzureAclConfig -AddRule -ACL $acl -Order 0-Action Permit -RemoteSubnet "1.2.3.4/32" -Description "AllowApp01"




(Permit / Deny)

Apply ACL to HTTP Endpoint

Get-AzureVM -ServiceName Web01 |


Set-AzureEndpoint -ACL $acl -Name "HTTP" -Protocol TCP-PublicPort 80 -LocalPort 80 |


Update-AzureVM

Createa new Cloud Service 'Reserved IP' in the Azure Subscription

New-AzureReservedIP -ReservedIPName examtest -Label examtestIP-Location 'North Europe'

Show the Reserved VIP of a Cloud Service

Get-AzureReservedIP -ReservedIPName examtest

Delete a Static VIP on a Cloud Service

Remove-AzureReservedIP

Configure a VM to use a PIP

Get-AzureVM -ServiceName $serviceName -Name $vmName|


Set-AzurePublicIP -PublicIPName "PassiveFTP" |


Update-AzureVM

Display PIP
Get-AzurePublicIP
Get all VMs in AV set
(Get-AzureService).servicename| foreach {Get-AzureVM -ServiceName $_ } | select name,AvailabilitySetName
Scale up or down a VM

$newSize = "Basic_A0"


Get-AzureVM -ServiceName "examtest" -Name"exam-test-vm1" |


Set-AzureVMSize $newSize |


Update-AzureVM

Change OS disk to ReadOnly caching mode

Get-AzureVM -ServiceName "examtest" -Name"exam-test-vm1" |


Set-AzureOSDisk -HostCaching ReadOnly |


Update-AzureVM




(doesn't need a reboot)

Change Data disk for LUN 0 to ReadOnly caching mode

Get-AzureVM -ServiceName "examtest" -Name"exam-test-vm1" |


Set-AzureDataDisk -LUN 0 -HostCaching ReadOnly |


Update-AzureVM




(doesn't need a reboot)

Change Cloud Service to LRS replication type
Set-AzureStorageAccount -StorageAccountNameportalvhds48lx0yczcrqn8 -Type Standard_LRS
Display info about Storage account

Get-AzureStorageAccount

Get Storage account primary key

Get-AzureStorageKey-StorageAccountName portalvhds48lx0yczcrqn8

Azure Files - createSMB File Share called 'share'

$ctx = New-AzureStorageContext $storage $accountKey


$s = New-AzureStorageShare$shareName -Context $ctx

Add BitLocker to data disk (OS disk not supported)

Add-WindowsFeature BitLocker -IncludeManagementTools

Configure Azure Diagnostics on initial deployment of a VM

Set-AzureVMDiagnosticsExtension -DiagnosticsConfigurationPath $configPath-StorageContext $storageContext -Version '1.*'