Tag: remote

How to SSH into an Azure VM from Windows Terminal Menu

How to SSH into an Azure VM from Windows Terminal Menu

A couple of days ago, I released a blog post on how you can add a PowerShell remote session in the Windows Terminal menu. In my example, I created a menu item in Windows Terminal to use PowerShell remoting to connect to an Azure virtual machine (VM). In the meantime, I got a lot of questions on how you can add an SSH connection to an Azure VM in the Windows Terminal. That is why I am going to share here, how you can add an SSH connection to an Azure VM in the Windows Terminal menu.

Scott Hanselman wrote a great blog post on how you can add tabs to open an SSH connection, so I highly recommend that you read his blog for all the details.



How I Manage and Plan Tasks as a Remote Worker

How I Manage and Plan Tasks as a Remote Worker

I know being a remote worker and working from home can be a challenge, especially when it comes to managing and planning your tasks and to-dos. Since I started at Microsoft, I became a remote worker working from my home office, and I needed to figure out what the best way for me is to get things done. In this blog, I want to share my experience on how to manage and plan tasks as a remote worker working from home and be more productive. That said, this is specifically for my job and my personal preferences, this might not work in the exact same way for you. But I hope you get some tips and tricks out of it, which can help you to be more productive when you are working from home.

Getting an Overview of my Tasks and the Things I need to work on 🤓

To get your tasks and your work items planned, you first need to know what these are. Not just for you but also for your team and the people you are working with. So for me, there are two types of to-do items. First of all, the more significant things I am working on, alone but also together with my team. This helps you to collaborate in a team and also gives a good overview of who is doing what. The other things to-dos and tasks I want to track are all my personal ones (but still work-related), small tasks, ideas, emails I need to reply, and so on. For me separating this made a lot of sense since I also want to be very efficient and not spend time more time on a task writing it down than actually completing it (If it is not something the team should know about). With that, I quickly want to share how we collaborate and plan and track our work as a team, as well as how I work with my own personal work tasks.

Working and Collaborating in a Team 🙌

As a team, we are using Azure DevOps Boards to track and plan our work items. We can create new work items and then move them into the “in progress”-column. When the task is completed, we then move it in to closed. You can also see that we are tracking and planning our content we are publishing, offline and online events we are presenting at, and much more. You can see that we also use that board to plan and schedule posts on our ITOpsTalk.com blog. With that, we can easily plan and see who is releasing a blog on what topic on which specific day.

Work Items in Azure DevOps Boards

Work Items in Azure DevOps Boards

Azure DevOps also allows us to integrate into other systems and automate specific tasks and update databases. I know that Azure DevOps is might not be for everyone, but if you want to use a similar but simpler tool to collaborate and organize your teamwork, you should have a look at Microsoft Planner.

Managing my Personal Tasks ✔

For all the rest of my tasks, I use the Microsoft To Do app. The app helps me to organize different tasks in different lists. This is also how I write down ideas or to-dos I get out of a meeting or a conversation.

Microsoft To Do Management

Microsoft To Do Management

I don’t use the planning feature in the To Do app since I use my calendar for doing the planning. However, I still use it to give my tasks a time where they pop up, so I don’t forget to include them. Again using the Microsoft To Do app has a couple of advantages. First of all, you basically get this app on almost all devices I own, and it automatically syncs tasks, and there is also a web version. What I also highly appreciate is the fact that it connects to many other services and places and can show you tasks from different places like Outlook. For example, I can easily list all the emails I flagged and the Microsoft Planner tasks which are assigned to me.

One personal thing I can recommend is to create some quick notes lists. I, for example, created one for feedback, I often get feedback from customers during events or calls. To quickly write these items down, I use a list called Feedback in my Microsoft To Do app, and later on go through it and forward it to the right people and systems we have in place. The other quick lists I created are for recurring meetings. From time to time, something pops in my head, which I want to discuss during my next team meeting or my 1:1 with my manager. I quickly write that item down, and when the meeting starts, I can quickly open the list and make sure I don’t forget anything I wanted to discuss.

Planning my Tasks and my Week using Calendar Blocking 📅

Okay, now I have all of my tasks and to-dos listed, the next step is to plan them. One of the main challenges I found myself in was to figure out what I should work next. I have enough tasks, but it took me a lot of time to go through them and decided on which one I should work. Of course, you can prioritize your tasks, but since you also have meetings scheduled, one that is sometimes too big to start with. To make that process a little bit easier, I used the concept of calendar blocking.

There are many great articles and videos out there, which describe the concept of calendar blocking. For me it is straightforward, at the beginning of the week, I open up my Outlook calendar and a list of the tasks and items I need to do. I then start to put blocks in my calendar to plan when I am working on which item or task. So now, when I finish a task, I just have a look at my calendar, and I can see what I should work on next.

I also set myself some rules, and I had certain learnings over time. First, calendar items or blocks are not necessarily fixed, and they can be moved around as long as the deadline allows it. Sometimes you can’t finish something in time, so you might just want to keep working on it and move the other block or item for later. Secondly, I try to create as many recurring blocks as I can; this makes planning much more comfortable and faster and gives you some sort of consistency. Third, usually, my work items and blocks are larger then they need to be, I still want to have some time to interact with others on Microsoft Teams or just get a coffee, without stressing myself out.

All that said, I want to give you a quick example of how a week can look like. I want to highlight again, that this is based on my personal preferences and aligned with the teams I work with, it can be entirely different for you.

How I Manage and Plan Tasks as a Remote Worker

How I manage and plan tasks as a remote worker

Usually, I start planning my week on Sunday evening or Monday morning. A lot of blocks are already in my calendar because I created these recurring tasks and entries. Then I go into my Microsoft To Do App and my Azure Board, to check what the open tasks are I should be working at, and start blocking time for these items.

Outlook Calendar Blocking

Outlook Calendar Blocking

In this example, I want to quickly highlight a couple of things.

  1. As said before, you can see that many of my blocks are recurring tasks; this helps me to save time.
  2. I usually start the week with something easy I just can do, and I don’t need much brainpower, like reporting tasks. By just quickly getting these things done, I also get motivated to get more tasks done.
  3. I plan breaks to make sure that I don’t mess up my whole schedule. They are usually recurring tasks in my calendar.
  4. Even recurring tasks and blocks and easily moved around, depending on if I have meetings or different appointments going on.
  5. Since we are a remote team with people all over the globe, I can’t attend all of our meetings, and that is fine. We record our meetings, and I usually schedule some time to watch the recording.
  6. Working from home prevents you from having your usual chats with your colleagues while getting coffee or other breaks. That’s why our organization has some scheduled and recurring watercooler events for everyone to join.
  7. You can see here that I blocked some time to do some focus work on a specific topic. However, at the beginning of the week, I have no idea what and how many meetings I will have. Since a lot of people I usually collaborate are in another timezone and start working in my afternoon, I enter a blocker in my calendar but marked it as free. So people can still find some free time to schedule meetings with me using the Outlook availability feature.
  8. Here you can see I booked some focus time to work on a specific task. However, later in the week, I scheduled some meetings instead.
  9. I use the category feature in Outlook to color code my blocks depending on different tasks. Red, for example, means focus work, dark red means collaboration work and meetings, and orange are important meetings.
  10. One thing I like to do as a remote worker is to schedule some virtual coffee breaks with my co-workers over teams, outside of the regular meetings.
  11. I also highlight important tasks where I am presenting or speaking on a specific topic. Having that color-coding for these also reminds me to be prepared with the necessary content.

Note Taking

Another big part, to stay organized and get things done, is the way I am taking notes. I need a place to write down my meeting notes, or my planning for new projects and content, as well as my travel planning. For that I am using Microsoft OneNote, it is great because it syncs across all my devices, lets me do typing as well as handwritten notes, and has many more awesome features.

Taking Notes in OneNote

Taking Notes in OneNote

I can also easily collaborate and share notes with others as well as super easy automate processes using Power Automate. We are also using it a lot in our team to brainstorm ideas and work together.

There is also some stuff I always need ready, or I just quickly want to write down, or maybe quickly want to copy past later or something I need all the time. For that, I am using the Windows 10 Stick Notes app.

Stick Notes

Stick Notes

These also sync across my devices and really help me to get these quick notes done.

Automate processes between these tools

As you can see there are many tools which can help you to stay organized. However, too many tools can also have the opposite effect and can use a lot of time. I start using Power Automate (formerly known as Microsoft Flow) which is part of the Microsoft Power Apps. Power Automate helps me to easily connect different tools and services together. For example, I can automatically create a new Outlook task or Microsoft To Do task when an Azure DevOps workitem is assigned. Power Automate can also do things like sending emails or notifications, send an article to OneNote, integration with Microsoft Teams. and integrates in many other third-party services.

Automate tasks using Power Automate

Automate tasks using Power Automate

Conclusion

I hope this gives you a little bit of an overview of how I manage and plan my tasks as a remote worker. I know that this might not work for you in the same way as it does for me; however, I hope you get the one or other idea out of it. It is also important to mention that I highlighted a couple of different tools like Azure Boards, Microsoft Planner, Microsoft To Do and Outlook, I know that there are much more out there and maybe work better for your specific scenario. Again, I would never say I am an expert on that. I just wanted to share how I handle and manage my tasks when working from home, and I am super interested in learning from you, and how you organize yourself to become more productive. If you have any tips and tricks to share, feel free to leave a comment.



Microsoft Teams Video Call

How to host Tech Workshops and Trainings online

I just got asked by one of my blog readers, who is a consultant and trainer, about what tools I use to give online tech workshops and trainings. I thought this would make a good blog post; that’s why I want to share with you how you can provide tech workshops and trainings online. This can obviously also be used in day to day collaboration and meetings.

How to give Workshops and Trainings online

In my previous job, I worked with a lot of customers and provided workshops and trainings. Here are some of the tools I used, and I am still using. I know that there are a lot more applications out there which can give you a great experience. Some of them are optimized for public streaming, others for collaboration. The same is true for my list; depending on the use-case, meeting, workshop, or content you have, maybe one tool is better than the other. So have a look at these tools and decided which one works best for your workshop or training. I also need to point out that you can use them not just as a standalone app, but also in combination with each other.

Microsoft Teams

The first tool which pops in mind and is the one I use the most is Microsoft Teams. Microsoft Teams is a fantastic collaboration tool. It lets you do a couple of things like meetings and video calls with screen sharing and PowerPoint presentations as well as included whiteboard experience. In addition to meetings and chats, you also get a rich collaboration space with teams and channels, which you can also use to share workshops and training material over time. You can provide an excellent experience for your customers and team members even after the workshop or training is done. There are many features in Microsoft Teams. The best thing is to check out the product page to see all the capabilities of Microsoft Teams. You can invite people outside of your organization as guest accounts to have a collaboration space.

Microsoft Teams Video Call

Microsoft Teams Video Call

I want to share two of the live chat and video experiences that you can use in Microsoft Teams for online meetings, trainings, and workshops.

Microsoft Teams Online Meetings – This is the experience most users probably are familiar with. With Microsoft Teams online meetings, you can host audio, video, and web conferences with anyone, and you get features such as scheduling assistance, meeting note-taking, screen sharing, meeting recording, and instant messaging.

Microsoft Teams Live Events – With Microsoft Teams live events you can broadcast video and meeting content to large online audiences. This can be inside and outside of your company. Live Events are meant for one-to-many communications where you are leading the interactions, and audience participation is primarily to view the content shared by you. Live events feature is excellent if you want to organize things like webinars. While the online meetings functionality has a chat, the live events comes with a Q&A feature, which makes it easy to keep track and answer questions.

If you want to learn more about how to present PowerPoint in Microsoft Teams, check out Sarah Lean’s blog post.

Microsoft Whiteboard

Another tool I use a lot is the Microsoft Whiteboard app, and I already wrote a blog post about why IT Pros should use the Microsoft Whiteboard app.

Microsoft Whiteboard

Microsoft Whiteboard

The Whiteboard app is a digital whiteboard that allows you to invite people online to collaborate in real-time. It also integrates into Microsoft Teams as well.

PowerPoint – Present Online and record Presentations

PowerPoint Present Online

PowerPoint Present Online

As mentioned before, you can use Microsoft Teams to share and present your PowerPoints. However, what a lot of people don’t know is that PowerPoint already has an integrated sharing feature. You can share and broadcast your PowerPoint presentation online directly within PowerPoint, without the need for an additional tool.

Present Online in PowerPoint

Present Online in PowerPoint

You can also record PowerPoint presentations and share them online later on.

Record Slide Show

Record Slide Show

 

Visual Studio Code Remote Share

When it comes to code, Visual Studio and Visual Studio Code (VS Code) offer you a feature called Visual Studio Live Share. Live Share allows you to share your code in real-time. You can collaborate and work with multiple people on the same code. New is that you can not only join using VS Code or Visual Studio, but you can now also join by just using a browser.

Invite people with Visual Studio Live Share:

Visual Studio Code Live Share

Visual Studio Code Live Share

Collaborate on the same file:

Sharing code online with VS Code Live Share

Sharing code online with VS Code Live Share

I hope this blog was helpful and gives you a couple of ideas on how you can provide workshops and trainings online as well as collaborating in real-time with people. Let me know if you have any questions in the comments. Thanks to Martin Dimovski, who gave me the idea of this blog post.



Add a PowerShell Remoting Session in the Windows Terminal Menu

Add a PowerShell Remote Session in Windows Terminal

I am sure you have heard about the new Windows Terminal, which is in preview, and you can get it from the Windows Store. In this blog post, I want to share how you can add a PowerShell remote session to the drop-down menu in the Windows Terminal when you open a new tab. The new Windows Terminal is highly customizable and it allows you to run different shells like the classic command prompt, Windows PowerShell, PowerShell 7, and also Windows Subsystem for Linux shells (I am using, for example, Ubuntu with the Windows Subsystem for Linux 2 (WSL 2)).

Scott Hanselman wrote a great blog post on how you can add tabs to open an SSH connection directly, so why not do the same thing with PowerShell? In my example, I will add a tab in Windows Terminal, which opens up a PowerShell remoting session (using WS-Management WSMan) to an Azure virtual machine (VM). However, this would work with every other machine which you can access using PowerShell Remoting.

Add a PowerShell Remote Session in Windows Terminal Tab

To get started, we need to open up the settings of the Windows Terminal. This will open up a settings.json file, which you can edit in your favorite editor, for example, Visual Studio Code. To add new “menu items,” you will need to add a profile to the profiles array in the JSON file. In my case, I will add two to different menu items, once I am going to do a PowerShell remoting session to an Azure VM using Windows PowerShell and in the other, I am going to use PowerShell 7.

Windows Terminal Settings profiles

Windows Terminal Settings profiles

You can see here the following to profile entries:

Remote Session using Windows PowerShell 5.1

{
"name":  "PS Thomas AzureVM",
"tabTitle": "PS Thomas Maurer AzureVM",
"commandline": "powershell.exe -NoProfile -NoExit -Command Enter-PSSession -ComputerName azurevmps.westeurope.cloudapp.azure.com -Credential thomas",
"icon": "C:/Users/thoma/Downloads/AzureVMIcon32.png"
},

Remote Session using PowerShell 7

{
"name":  "PS Thomas AzureVM",
"tabTitle": "PS Thomas Maurer AzureVM",
"commandline": "pwsh.exe -NoProfile -NoExit -Command Enter-PSSession -ComputerName azurevmps.westeurope.cloudapp.azure.com -Credential thomas",
"icon": "C:/Users/thoma/Downloads/AzureVMIcon32.png"
},

As you can see, we define the profile name and the tab title in for the Windows Terminal entry. We have the command line command here, which starts the PowerShell remoting session. The command opens a PowerShell session to a specific computer or server using the ComputerName parameter and the Credential parameter for the credentials. In my case, I am connecting to an Azure VM with the name azurevmps.westeurope.cloudapp.azure.com (could also be an IP address) and the username Thomas. The last thing I add is a small icon (32×32 pixel) since I am connecting to an Azure VM, I took the Azure VM icon.

In this scenario, I am using PowerShell Remoting over HTTP, you can use the same thing for your connections using PowerShell Remoting over HTTPS or even PowerShell Remoting over SSH which are way more secure, and should be used for your connections. If you are looking to create the same Windows Terminal menu entry using a simple SSH connection, check out my blog post here.

Now your Windows Terminal drop-down menu will look like this:

Add a PowerShell Remote Session in Windows Terminal Tab

Add a PowerShell Remote Session in Windows Terminal Tab

By selecting one of these profiles, you will automatically open a PowerShell remoting session to a specific computer or server in Windows Terminal.

Windows Terminal - Azure virtual machine VM PS Remote Session

Windows Terminal – Azure virtual machine VM PS Remote Session

I hope this gives you an idea of how you can add a PowerShell remote session in Windows Terminal menu. If you want to know more about the Windows Terminal, check out the following blog, and if you have any questions, please feel free to leave a comment.

If you want to know more about what’s new in PowerShell 7, or if you want to learn more about how to customize the Windows Terminal, check out my blog.



SSH Remote Edit File with Visual Studio Code

Remote Edit Files on Azure Linux VMs using VS Code

There are a lot of different ways to remote manage your Azure virtual machines using various tools and technics. In this blog post, I am going to show you how you can remotely edit files on Azure Linux virtual machines using Visual Studio Code. Visual Studio Code has a new Remote Development Extention which allows you to open any folder in a container, on a remote computer, or in the Windows Subsystem for Linux (WSL) and take advantage of the VS Code feature set. With the Remote – SSH extensions, you can easily browse and edit files on an Azure VM or any other system where you can connect using SSH.

Installation

As mentioned to edit the files on the Azure Linux virtual machine remotely, we are using the light-weight, cross-platform, opensource editor Visual Studio Code. You can download and install VS Code from the official website.

Visual Studio Code Remote Development Extension

In addition to Visual Studio code, we need to install the Remote – SSH extension, which comes with Remote Development Extension Pack. This also includes remote extensions for containers or the Windows Subsystem for Linux (WSL).

If you are running on a Windows 10 machine, you will also need to install the OpenSSH client on your machine. You can do that going through this blog post, or by running this command.

# Install the OpenSSH Client
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0

Azure VM connection using SSH

The Remote – SSH extensions currently only supports connecting to x86_64 Linux-based SSH servers using key-based authentication.

Optional: Create Azure Linux VM with key-based SSH authentication using the Azure CLI

Create Azure Linux VM Azure CLI SSH Keys DNS Name

If you want to try it out, and you haven’t set up a Linux VM SSH and key-based authentication. This Azure CLI command here helps you to create a new Azure virtual machine and sets up ssh keys as well as an optional unique Azure DNS name.

az vm create --resource-group demosshvm --name tomsVM --image UbuntuLTS --admin-username thomas --generate-ssh-keys --public-ip-address-dns-name tomsazurelinuxvm

In this example, you can use the public IP address or the Azure FQDN to connect to the Azure VM. If you have a VPN or Express Route set up, you can also use private IP addresses and DNS names. If you are using public IP addresses in production, make sure you are using a service like Azure Just in Time VM access.

Connect Visual Studio Code to Azure VM using SSH

After you have installed Visual Studio Code, the Remote – SSH extension, the SSH client and have a VM with key-based authentication, you can now easily connect. Open Visual Studio Code, on the bottom left, you see the Remote connection button. If you press it, you will find the remoting options. Select “Remote-SSH: Connect to Host…

Visual Studio Open Remote SSH Connection

This will ask you for the username and IP address or DNS name of the virtual machine. In my case, I am going to use the DNS name.

Visual Studio Code SSH Remoting Connection

 

After pressing enter, this will connect your Visual Studio Code environment to the Azure virtual machine.

Visual Studio Code SSH Connection

 

Remote edit files on Azure Linux VMs using VS Code

You can start opening folders and files on the remote Azure Linux VM and begin browsing the file system. On the bottom left, you see the name or IP address of the machine you are connected with.

SSH Remote File System Visual Studio Code

You can also open files and start remote edit files on your Azure Linux VM. If you save the changes you made to the file, this is directly saved on the remote Azure virtual machine.

SSH Remote Edit File with Visual Studio Code

You get all the advanced VS Code features you know from your local Visual Studio Code like syntax-highlighting and more.

I hope this shows you an easy way to remotely edit files on your Azure Linux virtual machines using Visual Studio Code and SSH. If you have any questions, please let me know in the comments.



PowerShell Direct Enter-PSSession

Hyper-V PowerShell Direct

One of the new features of Hyper-V in Windows Server 2016 and Windows 10 is called PowerShell Direct. PowerShell Direct lets you remotely connect to a Virtual Machine running on a Hyper-V host, without any network connection inside the Virtual Machine. PowerShell Direct uses the Hyper-V VMBus to connect inside the Virtual Machine. This feature is convenient if you need it for automation and configuration for Virtual Machines or if you for example messed up network configuration inside the virtual machine and you don’t have console access.

Right now, there are two ways to use PowerShell Direct:

  • Create and exit a PowerShell Direct session using PSSession cmdlets
  • Run script or command with the Invoke-Command cmdlet
  • Use the PowerShell Direct session to copy files using the copy-item cmdlet

Requirements:

  • The virtual machine must be running locally on the Hyper-V host and must be started.
  • You must be logged into the host computer as a Hyper-V administrator.
  • You must supply valid user credentials for the virtual machine.
  • The host operating system must run Windows 10, Windows Server 2016, or a higher version.
  • The virtual machine must run Windows 10, Windows Server 2016, or a higher version.

PowerShell Direct examples

You can open a new interactive PowerShell Direct Session:

PowerShell Direct Enter-PSSession

Enter-PSSession -VMName "VM01" -Credential (Get-Credential)

PowerShell Direct Invoke-Command

You can use Invoke-Command to send script blocks to your Hyper-V Virtual Machines.

Invoke-Command -VMName "VM01" -Credential (Get-Credential) -ScriptBlock { Get-Process }

You can also create a PowerShell Direct session and use the Copy-Item -ToSession cmdlet to copy files to or from the VM.

$s = New-PSSession -VMName "VM01" -Credential (Get-Credential)
Copy-Item C:\Files C:\Targetfiles -ToSession $s

Remember it, this is not the same as PowerShell Remoting, even if it uses the same cmdlets. With that, not everything is working using PowerShell Direct, for some scenarios, PowerShell Remoting works differently. If you want to do this with Linux virtual machines, there is a tool called hvc.exe, which allows you to do the same.

If you want to know more about PowerShell Direct, check out the Microsoft Docs pages.



Microsoft Remote Desktop Preview App

Microsoft Remote Desktop Preview App for Windows 10

Yesterday Microsoft announced a new Remote Desktop Preview app for Windows 10 Universal Windows Platform (UWP) on the Remote Desktop Services Blog. You can get and download from the Windows Store. The new Remote Desktop Preview app has a connection center to manage your connections to Windows Clients and Windows Server. The connection center is your starting point. It allows you to easily manage your desktops. You can add new desktop connections and edit or delete existing connections. Selecting one of the desktop tiles launches the connection. It’s great to see Microsoft finally creating some great Apps for their own Universal Windows Platform.

Microsoft Remote Desktop Preview App Connection Center