Showing posts with label Cloud Services. Show all posts
Showing posts with label Cloud Services. Show all posts

Friday, 19 August 2016

SCVMM 2012 R2 - Joining Hyper-V 2012 R2 Host to Host Group fails with "error 415 agent installation failed copying"

Trying to join a Hyper-V host to a VMM 2012 R2 Host Group fails with;

"Agent installation failed copying C:\Program Files\Microsoft System Center 2012\Virtual Machine Manager\agents\Amd64\3.1.6011.0\vmmAgent.msi to \\HyperVHost\ADMIN$\vmmAgent.msi.
The network path was not found."


This was because I forgot to add the VMM Run As account to the Local Administrators group on the target Hyper-V server.


Wednesday, 10 August 2016

Remove Office 365 Domain with Force

After working with Office 365 for almost 3 years I have finally decided to get (and pay for) my own tenancy. I am sick of rebuilding O365 tenancies for demo's and testing every time the 30 day trial runs out. With my new "legit" tenancy I can permanently have ADFS etc configured for my lab domain.
Over the last 18 months I have probably had 10 different O365 tenancies for different customer proof of concepts. For these to be successful you often need a unique domain name, of which I own plenty. I tried to configure my "ryanbetts.co.uk" domain to my new tenancy and received an error as it was currently associated with another tenancy.
The process of removing the old domain is straight forward, if you have access to the old tenancy.
1. Change the primary domain
Set-MsolDomain -Name "sysupdemouk.onmicrosoft.com" -IsDefault
You must set the .onmicrosoft.com domain to the default for your tenancy, otherwise you will get an error when you try to remove your unique domain name.
2. Review which users currently use the unique domain
Get-MsolUser -DomainName "ryanbetts.co.uk"
This command will show you all the users that are currently using the unique domain you are trying to "seize".
3. Remove any users currently using the domain
Remove-MsolUser -UserPrincipalName test1@ryanbetts.co.uk -Force
If any user accounts have your domain configured to be their primary UPN suffix, you must first either delete the user or change their UPN to the .onmicrosoft.com domain. If you have user accounts synced from Active Directory this command will not work for they accounts.
In my old tenancy the AD Sync was completely blown therefore I could not make the changes in AD. To get around this problem manually set the synced user accounts back to the .onmicrosoft.com domain.
4. Remove the unique domain from O365
Remove-MsolDomain -DomainName "ryanbetts.co.uk" -Force
This command will actually remove the unique domain from the O365 tenancy. If you are trying to bind the domain to another O365 there can be some latency in the O365 service realizing that you have removed it from an old tenancy.

Wednesday, 3 August 2016

Playing with Office 365 Groups

What are Office 365 Groups?
Microsoft "A distribution list is a set of email addresses. You can use the distribution list to send an email message or meeting invitation to all the addresses at once. An Office 365 group includes a distribution list but also includes a shared:
·        Inbox for group email communication
·        Calendar for scheduling group meetings and events
·        Library for storing and working on group files and folders
·        OneNote notebook for taking project and meeting notes
Planning tool for organizing and assigning tasks and getting updates on project progress."
Open the Exchange Online Admin Console, click Recipients and Groups.

Click the Add button and select Office 365 Group.

Input a Group Name, and Group Email Address, for some reason inside the GUI you cannot change the Group's primary SMTP address away from the onmicrosoft.com domain. This can be done using the following PowerShell command;
 Set-UnifiedGroup -Identity "Group Name" -PrimarySmtpAddress rbdemo@domain.com


The Privacy settings are not for external privacy, these are to control who from inside the organization can join the Office 365 Group without authorization. PowerShell command to configure this.
Set-UnifiedGroup -Identity "Group"  -AccessType Private
The Subscriber Newsletter option, if enabled ensures that users personal email accounts are kept up to date with the events happening at a group level. 


You configure who is automatically added to the group at creation. If you set the Privacy to Public, users can auto discover and enroll into the group.
Set-UnifiedGroup -Identity "Group"  -AccessType Public


The option to have users who are members of the Office 365 Group Send As the group is available. This means any mail sent from this user, will appear to have come from the group and not the individual.
$group = "RB Demo"
$user = "jblue"
$365Group = Get-Recipient -RecipientTypeDetails groupmailbox -Identity $group
Add-RecipientPermission -Identity $365Group.Name -Trustee $user -AccessRights SendAs 


This setting in Exchange is often confused with Send on Behalf, in which the users identity is displayed even if they are sending from another users mailbox.

By default an Office 365 Group does not access e-mails from external recipients, however you can configure this by using the following command;
 Set-UnifiedGroup -Identity "Group" -RequireSenderAuthenticationEnabled $false 


The Office 365 Group pane is pretty nice, you can view Conversations, Calendars, Files (hosted on OneDrive), Notebook (OneNote) and Connectors to services such as Trello for resource management. 

Office 365 Group files are hosted by your SharePoint Online tenancy, therefore you might want to set storage quota's on each group to ensure they do not consume too much data storage from your SharePoint Online.
The Office 365 Group is provisioned with it's own SharePoint Online site using the following convention;
Most SharePoint Online tenancies are configured to use Automatic storage pooling. If you want to configure an Office 365 Group with a quota, this must be set to manual. 

The following commands can be used to set a quota on the OneDrive file storage for an Office 365 Group, if the SPO is set to Automatic Storage Management, this command will fail.
 $365Group = Get-SPOSite –Identity https://domain.sharepoint.com/sites/groupname
Set-SPOSite –Identity $365Group -StorageQuota 3000 -StorageQuotaWarningLevel 2000 

Tuesday, 2 August 2016

Office 365 Exchange Online - Delegate Mailbox Permissions

Mental note for me, as I am studying for MCSA 70-347. 

# Send As Permissions for jblue, allowing jgreen to Send As. No indication the message was send by the delegate.

Add-RecipientPermission "jblue" -AccessRights SendAs -Trustee "jgreen" 

# Full Access for jblue, allowing jgreen to have Full Access to the jblue mailbox. Please note messages cannot be send by the delegate.

Add-MailboxPermission -Identity "jblue" -User "jgreen" -AccessRights FullAccess -InheritanceType All

# Send Behalf, allows the delegate to send on behalf of the orignal user but does not hide their identity.

Set-Mailbox -Identity "jblue" -GrantSendOnBehalfTo 
"jgreen"

https://www.dropbox.com/s/9c8b3nckid299h3/Exchange%20Online%20Permissions.ps1?dl=0

Wednesday, 30 September 2015

Azure Cloud Service Connecitivity "Remote Desktop can't find the computer "name.cloudapp.net". This might mean that "name.cloudapp.net" does not belong to the specified network.

Azure Cloud Service Connecitivity "Remote Desktop can't find the computer "name.cloudapp.net". This might mean that "name.cloudapp.net" does not belong to the specified network.

When you try to connect to a VM in a Cloud Service (name.cloudapp.net) it was working until I provisioned an additional 6 VM's into the same Cloud Service. I then tried to RDP to any of the other instances to see if it was a particular VM, or the Cloud Service itself.


The fix was easy login to Azure using the Preview Portal, expand the VM in question and click on the Reset Remote Desktop Settings, and click Yes to confirm. Then reboot the instance, and you should be able to RDP.


Thursday, 19 March 2015

Azure Networks Configuring Address Spaces, Subnets and Configuring Azure VM's with Azure Networks

Azure Networks are Network Services that can be designed and configured to support complex network infrastructure, supporting both on-premise and cloud based workloads. I have found certain Azure Virtual Network configurations easier to do from the Azure Portal, which is still in Beta/Preview mode. You can use it to configure your subscription http://portal.azure.com
Designing Azure Networks is must like designing and provisioning traditional networks, at a high level the following steps are required to define Azure Networks;
·       Create Virtual Network (which is a Network Service)
·       Assign Address Space and Subnets to Virtual Network
·       Configure Additional Subnets for the Virtual Network
All the traditional principals of TCP/IP address design are the same when designing Azure Virtual Networks. An Address Space, is usually defined as an RFC 1918 CIDR block which are
·       10.0.0.0/8
·       172.16.0.0/12
·       192.168.0.0/16
You can then define Subnets within that Address Space to separate network traffics, like you would in a traditional network. An example of how I have configured this Azure Virtual Network is
·       192.168.1.0/24 (Servers)
·       192.168.2.0/24 (DMZ)
·       192.168.3.0/24 (On-Prem)
The Subnet Mask (written in CIDR notation above) can be altered to make your Subnets bigger, or smaller. You should design out your networks on paper if you are going to change the Subnet Masks, and move to a class-less network design. This is to ensure your logical network stay contiguous.
From the Azure Portal, click New, then Networking, then Virtual Network. You must populate the Name field with something unique. Click Address Space, and then input your Address Space from the Address Space column. At this point in the Azure Virtual Network creation you only create a single subnet, in my example below I have called the Subnet "Servers" and it uses the subnet 192.168.1.0/24. Click OK to create the Virtual Network.


Return to the Azure Portal Home screen, and the newly created Azure Virtual Network will appears as a tile object, click on the tile mine is called "vNetwork-Test".

To add additional subnets to the Azure Virtual Network click Subnets.

Click Add Subnet button.

Populate the Name field, this a unique and descriptive name for the Subnet. Also set the Address Space to the Address Space you want this subnet to reside in, this example Azure Virtual Network only has one. Also enter a CIDR Block, I used 192.168.1.0/24 for my Servers subnet so 192.168.2.0/24 is the next available logical piece of network space. It would be my recommendation to design these so that overlaps and class-less networking is avoided if possible.

You can then add any of the subnets you require for your Azure subscription.

The next part is creating a new Azure Virtual Machine, and adding it to the correct Virtual Network and Subnet. This is something I believe you cannot do from the current Management Portal (please correct if you can). From the Azure Portal, click New, Compute and then select the Operating System, name the VM, and give it a username and password. Click on Optional Configuration.

From Optional Configuration click Network, then select your Azure Virtual Network, the Subnet you want the VM to be in and click OK. It's worth mentioning that once a VM has been configured inside a Virtual Network it cannot be move to another network, the only way to do it is to delete the Azure VM and retain the disks. You can then create a new VM from the old disks and connect it to a different network, I would imagine this will change at some point as Azure matures.

From the same Network pane you can also configure the VM with a static TCP/IP address within the same logical subnet that you are connecting the VM to.

An Azure Network also has a DNS Server, if you do not configure it to use a DNS Server it will  automatically point to one of the Azure hosted DNS servers. You can of course configure this to be your own DNS server(s) or even a global DNS provider.

Microsoft Azure Uploading and Configuring a Linux VHD, Configure VHD as Azure Disk and Attach to Virtual Machine

If you have existing VM’s you are running on-site, it’s possible to upload them to Azure and configure them as disks or images. Disks can be attached to VM’s which then allow you to effectively migrate your on premise VM’s to the Azure cloud. With Azure Images, you can customize operating systems with your preferred configurations, SysPrep them and then upload to Azure to provision multiple VM’s from.
You should bare the following things in mind when you are uploading existing virtual hard disks to Azure
·       Azure only supported VHD files and not VHDX files (which is likely to change)
·       Azure only supported fixed size VHD files
·       Azure Operating System disks can be a maximum of 127GB’s
·       Azure Data disks can be a maximum of 1TB
To upload VM’s to Azure you must have an Azure Storage account in place to act as a target for the VHD files. You can provision a new Storage Account by clicking New, Data Services, Storage and Quick Create. The URL you choose must be globally unique, also choose a region which is closest to your physical location. There are four options for Replication, I have chosen Geo-Redundant. With Geo-Redundant there is 6 copies of the data maintained, 3 replica’s in your current region and 3 replica’s in another region. Further information on Storage Account options can be found here

Once the Storage Account has been created, now you must make an Azure PowerShell connection from your device, use the following commands with your variables to upload an already existing VHD file from the computer you have made the PowerShell connection from. The first three statements are setting variables that are then called by the Add-AzureVHD statement.
$storage = “rbetts92”
$sourcePath = “C:\Users\R Betts\Desktop\AzureExample.vhd”
Add-AzureVHD –Destination $storagePath –LocalFilePath $sourcePath

You get a graphical representation of the VHD being uploaded to Azure, an MD5 hash is generate as a checksum to confirm the VHD is not corrupt when it reaches Azure.

When it completes you will be presented by confirmation screen with a summary of the file upload.

If you return to the Azure Management Portal, and browse to your Storage Account you should see the VHD that has just been uploaded to the Storage Account.

The next step is to change the disk type to an Azure Disk, this is different from an Azure Image, which would have to be SysPrep’d. Use the following PowerShell command to tag/label the uploaded disk as an Azure disk. The first two statements are setting variables.
$diskName = “AzureDisk”
$label = “MyAzureDisk”
Add-AzureDisk –DiskName $diskName –Label $label –MediaLocation $storagePath –OS Linux


Now you can create a new Azure Virtual Machine from your uploaded image, use the Create New VM wizard, but instead of clicking on a pre-define click My Disks from the list on the left hand side.

Select the new VHD and run through the wizard to provision a machine from an existing hard disk.


As this VM I uploaded is Linux and has the Azure Linux Tools installed, I click on The VM Agent that Supports the Extensions is Already Installed.

Now that the disk is attached to an Azure VM, the next step that is required is to create endpoints to allow remote connections to the machine, for example SSH etc.

Wednesday, 18 March 2015

Configuring Azure Traffic Manager to Load Balance Azure Websites

An Azure Traffic Manager is a Network Service that can be used to distribute incoming traffic between two "endpoints" within the Azure cloud. This is done to increase performance, improve availability or load balance Azure Websites. It can also be used by Azure VM's....
In the context of Azure Websites (or endpoints) the website instances should be provisioned in two separate regions or locations. If you are trying to load balance between two Azure websites running in the same region you will be stopped when you add the endpoints to the Traffic Manager.

Azure Website instances are only supported if they are on the Standard Web Hosting Plan Mode. This can be done using the Scale tab from the Website pane in the Management Portal.

The first step is to create a Traffic Manager, click on the New button. Then click Network Services, then Traffic Manager, then Quick Create. From here you must give your Traffic Manager a globally unique name and choose a Load Balancing Method. I have chosen Round Robin in this example, the other options are Performance and Failover. Click Create.

Scroll down from the list of Azure services and click on Traffic Manager, you will be presented by the following screen that lets you add endpoints to the Traffic Manager. Click Add Endpoints.

Choose Website from the Service Type, and tick the option to enable the Service Endpoints for the Azure Website instances. You will notice the warning that states you cannot have two website endpoints from the same region configured within the same Traffic Manager. 

By default a Traffic Manager is created with your unique name with the FQDN of trafficmanager.net so for example mine in this example is rbetts-lm.trafficmanager.net.
To have your clients connect to a DNS name from your own domain you can recreate a CNAME record to point to the Traffic Manager, for example;
CNAME weblb > rbetts-lm.trafficmanager.net.

Configuring Secure Socket Layer (SSL) for an Azure Website

When you provision a new Azure Website, you can connect to it via HTTP or HTTP/S, if you choose to connect via HTTP/S from your own domain name you will receive an SSL warning as the Common Name for your website is not in the SSL certificate. This is because the default SSL certificate is a wildcard certificate for the azurewebsites.net domain.

You can of course bind your own globally trusted SSL certificate to an Azure Website, click on you Websites, and then on the website you want to bind a certificate to. Click on the Configure option and scroll down to Certificates. Click Upload a Certificate.
The Certfificate you tryv to upload must be in the PFX format that has the associated Private Key, if you have generated a CSR your computer and then requested the SSL certificate from GoDaddy for example the CSR will hold the Private Key required. If you need guidance on how to convert a GoDaddy (or any other vendor) certificate into a PFX file, you can review this post


When you upload the certificate you will need the corresponding password.

Scroll down to SSL Bindings, and from the drop down select your domain, please note the domain must match the Common Name configured on the certificate or the domain must be set as a Subject Alternative Name (SAN) within the certificate.

Custom SSL bindings are subject to a price increase. Click Yes.


From a new browser window you should be able to browse to the website and see that it's configured with your SSL certificate. 


Creating and Configuring a Microsoft Azure Website with a Custom Domain

Microsoft Azure offers a full PaaS (Platform as a Service) for web sites and applications. This should not be confused with Virtual Machines hosted in Azure, running the Internet Information Services (IIS) role to host websites. Microsoft Azure Websites are fully managed instances.
To create a new Azure Website instance you can use the Management Portal or PowerShell from the Azure SDK.
When you create an Azure Website you must specify a region where the instance should be provisioned, you must also give it a globally unique name.
This command outputs all the available regions to the subscription.
Get-AzureWebsiteLocation


This command checks the proposed name of your website is globally unique across Azure.

Test-AzureName –Website “Website”


The following Azure PowerShell command will create a web instance, the first two commands are to set variables that are called by the command itself.
$wsLocation = “West Europe”
$wsName = “MyNewWebsite01316698339”
New-AzureWebsite –Location $wsLocation –Name $wsName



When you return to the Management Portal, and click on Websites you should see the newly created website instance. To configure a Custom Domain you would normally click on Manage Domains, but it maybe greyed out for you like below.

This is because Custom Domains are not supported on the Free Trial website instances, therefore you must change the Web Hosting Plan Mode to either Basic or Standard. You can do this by click on the website, and then clicking on Scale. From here you click on the options under Web Hosting Plan Mode. Remember to Save the configuration using the Save icon.


When you return to the Websites pane, and you highlight the website the Manage Domains button should not be highlighted.


Click Manage Domains, this is where you find out what IPv4 address your new website instance is using in this example its 104.40.210.25, this is required when reconfiguring your public DNS.

You must create a couple of DNS records on your public DNS, the first can be an (A) record which is used to redirect clients connecting to your site to the Azure website, this is like a traditional website DNS name mapped to corresponding hosting IP.
The second is a CNAM record which is used by Azure to verify that you are the rightful owner of the domain you are configuring.
Your external DNS should have records configured like below;
Domain Name (ryanbetts.co.uk fort example) (A) Record > 104.40.210.25 (your Azure public IP)
awverify.domain.co.uk (CNAME) Record > awverify.websiteinstancename.azurewebsites.net
Once the external DNS configurations are in place return to the Manage Custom Domains and enter your domain under Domain Names, this will lookup DNS and verify the CNAME is in place to authenticate you. It will also associate the external domain with the Azure website.

Now if you browse to the website, using the external FQDN and the alias you should see an Azure Web Sites page, as nothing has been uploaded it will show an Error 404 on screen.