Beiträge von
Marcel Meurer

Expertenwissen von Marcel Meurer

| |

OneDrive PowerShell Module – Added support for OneDrive for Business

More than two years ago, I created my PowerShell module to access OneDrive. This module can be installed with a one-liner from https://www.powershellgallery.com/packages/OneDrive

Again, I was asked to support OneDrive for Business and finally I’m ready: From version 2.0.0 OneDrive for Business is supported.

 

I provide the complete documentation on GitHub, where I will maintain it: https://github.com/MarcelMeurer/PowerShellGallery-OneDrive

 

Here is the summary of version 2.0.0:

———————————————-

The OneDrive PowerShell module is available via PowerShellGallery.com.

| |

Working with the OneDrive PowerShell Module

Recently I got some questions on how to work with my PowerShell module for OneDrive. Therefor, I put together some examples.

Remember: The OneDrive module is for OneDrive personal and doesn’t work with OneDrive business / Sharepoint.

First: Register an app (authentication) for OneDrive: https://www.sepago.de/blog/onedrive-powershell-module-new-version-with-improved-authentication/

Authenticate to OneDrive

Show files and folders

Create new folder in OneDrive

Copy files from local to OneDrive

Copy file from OneDrive to local disk

Delete file in OneDrive

| |

Logging Azure AD audit and sign-ins to Azure OMS Log Analytics

Azure OMS Log Analytics is often used by Azure services. Unfortunately, Azure AD audits and sign-ins are not configurable for log analytics now (I bet this will change soon). But for now, we must work around to archive this.

My favorite way is:

Sending audit logs and sign-ins to event-hubs -> collecting event-hub data from Logic Apps -> transferring data to Log Analytics

Step-by-step
Creating an Event Hub namespace

Create a new event hub namespace in Azure with the Azure Portal.

| |

Adding Guest Users to Azure AD from Excel with PowerShell

Sharing access across different tenants in one of the key benefits of Azure AD. My customers appreciate that they can provide azure-based solution to their cooperated users and to guest users as well. Cooperated users include users from the group and subsidiaries. They all can access resources with one identity – on-premises and in the cloud (Same-sign-on, single-sign on).

Guest users can be deployed manually via the Azure portal, via PowerShell or with a connector to another system (like SAP HR).

| |

Enumerating Azure AD administrative accounts with PowerShell

Users can have different administrative roles in Azure Ad. Azure Portal can show these roles and members. Sometimes it can be favorable to get roles and members in a PowerShell object list.

To logon into your Azure AD tenant use:

Where xxx is your tenant id. The -TenantId is optional. But if your account member of different Azure ADs you can select the right one.

After login in with your credential you can show the different roles with:

Output:

Using PSCustomObject helps to build a list/array of custom objects to save all roles and users.

| |

Deploying a custom OMS Log Analytics Workspace via GitHub – Avoid problems with ARM templates

Azure is “my” cloud with a lot of platform services allowing user, programmers and DevOps building powerful and scalable solutions. One of my favorite ones is Azure OMS Log Analytics – a big data platform with a great query language and professional dashboards.

In the past I build a custom agent to collect data from Microsoft RDS and Citrix environment to provide a deep insight into the user experiences and resource usage http://loganalytics.sepago.com/.

| |

Monitoring End-User Computing Environments with Azure OMS LogAnalytics with „Deploy to Azure“

Several months ago, I built a solution focused on monitoring the user experiences on remote desktop environments based on Citrix XenApp, XenDesktop and Microsoft RDS. Particularly RDS/RDP was imported because there is no solution from Microsoft.

End user computing environments are complex and not easy to monitor. The most common monitoring solutions are focused on typical server parameters like CPU and memory consumption, free disk space and so on. But administrators need more insight into the parameters responsible for the user experience like bandwidth,

| |

Deallocate an Azure VM from itself

In these days I’m dealing with the automation of starting and stopping Azure virtual machines. I do this to avoid unnecessary costs for customers running Citrix or RDS workers on Azure. I translated a piece of my work into a PowerShell script to de-allocate the VM on which it is running.

Azure Instance Metadata Service

To get information about the running VM I use Azure Instance Metadata Service (https://docs.microsoft.com/en-us/azure/virtual-machines/windows/instance-metadata-service). This information contains the public ip address,

| |

How to use http delete, put, head, connections, connect with an Azure Web App

I often use Azure Web Apps to deploy tools and programs running serverlessly. A few weeks ago, I deployed an MVC web site with a controller to handle file uploads to an Azure Storage Account. For the client site I used jquery-FileUpload, which also allows to trigger a controller to delete a file. If a user tries to delete a file, jquery-FileUpload triggers the controller with the http-request method “DELETE”.

In my local environment this worked as expected but nothing happened in my Azure Web App deployment.

| |

OneDrive PowerShell Module – New Version with Improved Authentication

A few months ago, I wrote a PowerShell module to access OneDrive. I got a lot of feedback from the community – thanks for that.

This week I published a newer version to PowerShellGallery.com including new features and bugfixes. These are the main improvements:

Bug fixes:

  • Filename and paths containing special characters like ‘=’, ‘$’, etc. are now handled correctly
  • Enumeration of folders with a file count >200 is now working

Improvements:

  • Get-ODAuthentication now supports a “code” based-authentication including refresh of the authentication with a refresh token.