It is no new tool, but don’t forget the old Resource Monitor when you are on the search for the “hugger”.
Windows + R : Resmon

SigninLogs | mv-expand AuthenticationDetails = parse_json(AuthenticationDetails) | where TimeGenerated > ago(120d) | where AuthenticationDetails.authenticationMethod == "Text message" | project UserPrincipalName, AuthenticationDetails.authenticationMethod, AuthenticationDetails.authenticationMethodDetail | summarize count()by UserPrincipalName

First we create a bat file that will do 2 things
:loop
call c:\path\set_reg.bat
timeout /t 10 /nobreak
GOTO :loop
The we create the c:\path\set_reg.bat file that actually do the registry stuff
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization" /v "Server1.dk was here" /t REG_DWORD /d 1 /f
Now we create the exe file











You can decide if you want to save the project

Now you have a nice EXE file that will go undetected by most security systems

Create the windows service that will run the exe file.
Start a CMD as administrator
sc create SetReg binPath= "C:\path\set_reg.EXE" DisplayName= SetRegDisplayname start= Auto obj= "NT AUTHORITY\System"
We now have a EXE file that runs as a service as Local System
$guestusers = Get-MgUser -Filter "UserType eq 'Guest'" -All -property signinactivity
$output = @()
ForEach ($guestuser in $guestusers) {
$output += New-Object -TypeName PSObject -Prop ([ordered]@{'Mail'=$guestuser.Mail;'LastSignInDateTime'=($guestuser | Select -ExpandProperty SignInActivity).LastSignInDateTime})
}
$output
I assume that you have a HUB/Spoke design where there is a route table, that has a default route that points all traffic to the Firewall in the hub.
On the Function App you deploy in a spoke, you need to configure outbound network integration.

It is important to enable: “Outbound internet traffic”

The configuration on the Function App needs the setting: “vnetRouteAllEnabled” = 1
