Skip to content

Set-MgmtGraphOption

MgmtGraph: Updates Microsoft Graph SDK operational options

#Requires -Version 5.1
#Requires -Modules Microsoft.Graph.Authentication

[CmdletBinding()]
Param (
    [Parameter(Mandatory = $true)]
    [bool]$EnableLoginByWAM
)

Process {
    try {
        $options = Set-MgGraphOption -EnableLoginByWAM $EnableLoginByWAM -ErrorAction Stop
        
        $result = [PSCustomObject]@{
            EnableLoginByWAM = $EnableLoginByWAM
            Action           = "GraphOptionsUpdated"
            Status           = "Success"
            Timestamp        = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
        }

        Write-Output $result
    }
    catch {
        throw
    }
}

Specifies whether to enable login using Windows Account Manager (WAM).

An interactive directory of PowerShell scripts.