Invoking commands on remote machines – FAST

för 1 år sedan | Vikingur Saemundsson

Invoking commands remotely on machines is something we must do from time to time, in many scenarios speed is a critical factor as the remote command could be in response to anything from a incident to security breach. Speed combined with large environments in the cloud with many clients/servers deallocated… Read More

Securing Onedrive – Cleaning up unwanted sharing permissions

för 1 år sedan | Vikingur Saemundsson

OneDrive for Business is great! The administration tools provided is not! If you’re still reading you might agree with me when I say that Sharepoint Online admin center is far from the best experience when administrating anything related to OneDrive. Luckily we have access to everything we might need… Read More

Powershell in the Cloud – Part 2 – Azure Function App – Creating HTTP APIs with Powershell

för 2 år sedan | Vikingur Saemundsson

This is the second post of the Powershell in the Cloud series, and will focus on executing Powershell code from Azure Function App. If you haven’t read part 1, I highly recommend it as we will be referencing to it PART 1 – Azure Automation – Managing your Infrastructure… Read More

Powershell in the Cloud – Part 1 – Azure Automation – Managing your Infrastructure from the Cloud

för 2 år sedan | Vikingur Saemundsson

I recently held a talk about Powershell in the Cloud in Powershell User Group Sweden, this 3 part series is an attempt to refine and expand on that talk. The series will focus on the functionality rather than the code behind it as I want the content to be accessible… Read More

Querying Microsoft Graph with Powershell, the easy way

för 2 år sedan | Vikingur Saemundsson

Edit: There is now a Github page for this project Microsoft Graph is a very powerful tool to query organization data, and it’s also really easy to do using Graph explorer but it’s not built for automation. While the concept I’m presenting in this blogpost… Read More

Automating delimiter selection when working with Csv cmdlets

för 2 år sedan | Vikingur Saemundsson

Recently I walked passed a collegue with an error on his Powershell console which peaked my interest. He quickly noted that he had chosen the wrong delimiter for the Csv he imported which resulted in errors in the code, I then jokingly said ”Why don’t you just use the ’Get-CsvDelimiter’… Read More

Sending CSS formatted tables in Outlook

för 3 år sedan | Vikingur Saemundsson

If you’ve ever used Powershell to send HTML tables in Outlook containing CSS you’ve probably been disappointed of the outcome. There is some archived documentation for Outlook 2007 that is still viable for Outlook 365 ( Basically the function accepts a csv and css file, hardcodes the… Read More

Azure Automation – Running scripts locally on VM through runbooks

för 3 år sedan | Vikingur Saemundsson

I was tasked to create a powershell script to run on a schedule on a Azure VM. Normally this would be running as a scheduled task on the VM but seeing as we're working with AzureVM and schedule tasks are legacy I wanted to explore the possibilities of running the schedule and script in Azure to keep the VM clean and the configuration scalable. After some research the best option would be running the powershell script as a CustomScriptExtension on the VM, and the schedule would be handled by a Process Automation Runbook (using Automation Accounts). What I ended up with is the script below. It's fairly easy to configure and contains almost all the required configuration in the parameters. Read More

Just enough Administration & RDS

för 3 år sedan | Vikingur Saemundsson

The Problem? Microsoft RDS has limitations when delegating access, in fact there is no built-in access delegation whatsoever! The solution? Powershell! A Just enough Administration (JEA) endpoint, also known as a Constrained Powershell Endpoint. I’ve created a powershell app to list and logoff users I also created a simple… Read More

Convert SCCM schedule to readable format

för 4 år sedan | Vikingur Saemundsson

Reading SCCM Maintenance Windows is not an easy thing to do from WMI as they are stored as 16 char hex values To get the schedule hex values simply run the below line, but the result might not be easy to understand Get-WmiObject -Namespace 'ROOT\ccm\Policy\Machine\RequestedConfig' -Class CCM_ServiceWindow | Select -ExpandProperty… Read More