Skip to content

Errors with Variables and Module - Work around #6

@HoneyPotHive

Description

@HoneyPotHive

Variables kept erroring out saying there was no value assigned to them $Riskyusers and Module not loading/importing properly.
Tried:

  • Making it a environment variable
  • Import-Module
  • Tried adding it via directory.
  • I not big brained enough to correct others code.

I was needing something like this for filtering the data around here's what I had to do as a work around if anyone else need it, after trying to get the module to work.

Work around for getting high, medium, and low alerts.

Install-module Microsoft.Graph.Authentication,Microsoft.Graph.Identity.SignIns,Microsoft.Graph


#Connect to Graph and select the right profile for commands to work.
#-----------------------------------------------------------
$apiPermissionScopes = @("IdentityRiskyUser.Read.All", "IdentityRiskyUser.ReadWrite.All")
Connect-Graph -Scopes $apiPermissionScopes **# Login to your Admin account**
Select-MgProfile -name beta 

#Variables form low, medium, to high risky users.
#-----------------------------------------------------------
$low = Get-MgRiskyUser -Filter "RiskLevel eq 'low'" 
$medium = Get-MgRiskyUser -Filter "RiskLevel eq 'medium'"
$high = Get-MgRiskyUser -Filter "RiskLevel eq 'high'" 

#Invoke a dismiss based on UserId.
#-----------------------------------------------------------
Invoke-MgDismissRiskyUser -UserIds <string>

Doc and Resources

Microsoft Graph
Microsoft.Graph.Identity.SignIns
Get-MgRiskyUser
Invoke-MgDismissRiskyUser

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions