About Me

My photo
Bergen, Norway
19th times Microsoft MVP (Security and Windows). IT-Dude @SpareBankenNorge

Monday, August 3, 2026

Cleaning Up Unknown IAM Assignments Across Azure Subscriptions

 If you manage more than a handful of Azure subscriptions, IAM hygiene quickly becomes one of those tasks everyone knows is important, but few have time to do manually. This script was created to automate one of the most common Azure RBAC cleanup activities: finding and removing Unknown identities from Azure IAM assignments.

Azure role assignments occasionally contain entries where the identity is displayed as Unknown or Identity not found. These typically appear when a user, group, or service principal has been deleted from Microsoft Entra ID while the corresponding RBAC assignment remains in Azure. [learn.microsoft.com]

While these stale assignments may no longer provide access, they clutter documentation, complicate audits, and can create uncertainty during security reviews. As a cloud architect, I prefer keeping IAM environments clean, documented, and easy to understand.

To help automate this process, I created the PowerShell script:

Azure-iam-document_and_remove_unknowns.ps1

Wednesday, July 22, 2026

Fix Windows Sandbox network issues by setting a custom DNS server

Windows Sandbox is one of the easiest ways to test files, scripts, applications, and troubleshooting steps in a clean, temporary Windows environment. But sometimes Sandbox starts without working internet access. In many cases, the problem is not the Sandbox feature itself—it is DNS resolution.
If Windows Sandbox can reach the network but cannot resolve website names, setting a known DNS server manually can bring connectivity back quickly. This guide shows three practical ways to do it: with Command Prompt, through Control Panel, and by using a reusable Windows Sandbox configuration file.

Why DNS can break Windows Sandbox networking
Windows Sandbox launches as an isolated, disposable Windows environment. Networking is normally enabled by default, but name resolution can still fail depending on the host network, VPN configuration, DNS forwarding, or local network policies. When DNS is the issue, the Sandbox may appear offline even though the underlying network connection is available.

The quick fix is to configure the Sandbox network adapter to use a DNS server directly. In the examples below, the DNS server is set to 8.8.8.8, but you can replace it with your preferred public DNS server or an internal corporate DNS server if that is required in your environment.

If you wan to take a look at my video recording instead of reading the you can find it here:

Monday, March 20, 2023

Removing all "Unknown" object from permission/access list in Azure (IAM)

I do not like to have permission in Azure that gives access to "Unknown". I consider this a "visual" disturbance, a documentation issue, and a potential security risk. So I usually delete them when I find them.

You can find them by browsing around the entire portal manually or you can find them by using a script to document all access like my script explained in "Documenting Azure resources access (AIM)" 

To ease the cleanup process I created a script based on my findings from this blog. I basically extended it to go through all my subscriptions and document what it does during the process

So it will go through all subscriptions (with some exceptions). Documents all findings in a CSV file, remove the unknowns and then documents what has been removed in a text file at the end. I Was not able to test the text file part, since I already had cleaned up everything when I figured out that documentation of what actually got removed was something that should be included.

You will find the script in my GitHub repo here:

Scripts-For-Sharing/iam-removeunknown.ps1 at master · OTvedt/Scripts-For-Sharing (github.com)

Wednesday, August 24, 2022

Documenting Azure resources access (AIM)

There are many situations when you want to know the access structure for all your Azure resources. Examples could be:
  • Documentation
  • Cleaning out permission given to individuals instead of groups
  • Safe screening (groups/individuals that should not have access)
  • Deleted identities still visible in the AIM list
  • Preparing for features like Privileged identity management (PIM)
  • Comparing changes in access since the last audit
  • Etc
 And the portal built in GUI works but is not particularly flexible or easy to use when you have multiple subscriptions

Friday, November 26, 2021

Change owner for App registration and Enterprise Apps in Azure

 I got a long list of Azure AD App Registration/Enterprise Apps that needed to get a new owner. This is a quite common task since the original owner might have quit or changed role. 

So knowing that this is a task that might appear every now and then I wrote two short and quick PowerShell script to fix this. One for App registration and one for Enterprise Apps, you can, of course, combine them and add lots of error checks and so on but I like KISS

Saturday, September 26, 2020

PowerShell script to get some AzureAD logins stats

 The information you get in the Azure portal about logins are decent, but some time you need some statistic or insight fast and don't want to use the graphic interface or down load csv/json files.

I have created som script and favourite lines and uploaded it to my Github repo

Monday, July 20, 2020

Unused Azure AD Connect accounts "On-Premises Directory Synchronization Service Account"

Playing with #Azure Privileged Identity Management‎ made me aware of two active accounts from old or failed AAD connector installations from way back.
And we don't want to leave something with that potential for misusage laying available in our AAD. 

Thursday, July 9, 2020

Requesting access with Azure AD Privileged Identity Management from PowerShell

Using Azure AD Privileged Identity Management (PIM for short) as a method to control access to Azure resource are nice security feature. It makes it more trackable and gives the granted roles for a defined time period. 

You can add approval as a necessary add-on security feature, use MFA or other adjustments. Read more about PIM here.

BUT! it can also feel like a pain in the... if you use it a lot. So I created a small and simple PowerShell script to request the access for me.

Tuesday, April 21, 2020

Finding empty resource groups in Azure

Not easy to have control over your Azure resource groups, but maybe find all those whiteout any content could help?
I have created a PowerShell script helping me in my environment. Should be easy to adjust it to different needs.

Got valuable help from VidarW

Friday, April 17, 2020

Cheat for PowerShell connecting to remote machine

Yes I know, it's quite easy to connect against a remote machine to run PowerShell. But I am not doing it on a regular basis so I always forget:

Enter-PSSession -ComputerName COMPUTER -Credential USER

Creating Azure Resource Groups with PowerShell

I am working in a intense DevOps environment so I am creating new Resource Groups in Azure quite often. Doing this the manual way are of course are quite boring and might open up for different types of mistakes. 


So way not make sure that the mistakes are consistent and do it with a script?

Monday, December 30, 2019

End off year and first set off conferences and speaking engagements for 2020

2019

2019 was a busy year (as most off them usually are). Lots of conferences and speaking engagements, Nordic Infrastructure Conference and MVP Dagen in Oslo, SharePoint Conference in Las Vegas, Ignite in Orlando and Paris just to mention some.

Friday, November 29, 2019

My Microsoft Ignite 2019 Activity Summary

Microsoft Ignite 2019

You always get overwhelmed and impressive by Microsoft Ignite, no matter how many times you have been on it. The energy from the attendees and organizers are always a boost that makes the jetlag and sore feet from all the walking feel quite unimportant.

Monday, November 18, 2019

Change search provider for Edge Chromium edition

Love the new chromium based edge but it's currently a bit annoying to change the search provider.
found help in this article, but its quite old and not accurate any longer (but still gave me the solution on what to look for)  :https://windowsloop.com/change-chromium-edge-search-engine/

Quick fix is to type in: edge://settings/search
If your preferred search provider is missing you might need to go into their site first

Wednesday, November 13, 2019

Ignite The Tour Paris - BRK30010 session

Just finished my session "BRK30010 - With so many different ways to secure data across the Office 365 platform, it’s hard to know what to use when"

Don't know what happen with the name, took about 2 slides and 3 minutes just to read it. Event tried to use a acronym "WsmdwtsdatO365pihtkwtuw" still long and took even longer to pronounce it.

But the session worked, awesome audience here in Paris.

Friday, September 20, 2019

Create a group for all Autopilot devices

Working with Autopilot and need a group covering all AutoPilotet enrolled devices?
Michael Niehaus has this covered in his blogpost: Autopilot profile assignment using Intune

The quick guide will be to create a Dynamic group in Azure AD with the following rule syntax:

Wednesday, August 28, 2019

The next episode!


I have been a consultant since 96/97, working within all different kind and sizes of companies, both as a hired gun for customer and employee in different consultant houses. Enjoying the differences in environments and demands have made the work hard at times, but most rewarding and educational.

Friday, August 23, 2019

Change Windows 10 from volume license (VLK Pro/Enterprise key) to use the key machines built-in key

Felt a bit stupid today (again). Have been struggling with some Microsoft Surface Go devices. Love the device but, when they are shipped with Windows 10 1803 version you will use some time updating them. So my brilliant idea was to reinstall them clean with the latest updated ISO from a stick. Smart right?, jupp except that I download the business VLK version.

Friday, August 16, 2019

MVP Dagen 2019 and Innofactor webinar

I have 2 events coming up now right after the summer. First one is a webinar on the 28. of August and the next one is Microsoft Dagen in Oslo, Norway. Main foucs on both are related to OneDrive/SharePoint and security.
More info and links:

Friday, June 21, 2019

Summer holiday and nice resources to help you stay out of the sun

Here in Norway, the summer holiday is about to start for a bunch of people. We know from experience that many IT Pros have the danger of self-combustion if they get hit by direct sunlight. So to make sure that doesn't happen I have collected some nice resources for you to spend time on your IT ninja skills instead of self-combustion.


Cleaning Up Unknown IAM Assignments Across Azure Subscriptions

  If you manage more than a handful of Azure subscriptions, IAM hygiene quickly becomes one of those tasks everyone knows is important, but ...