AD IIS Login $user variable access

Hey Guys,

right now I am fiddeling around with Login Pages. I used the code example from Adam which works fine.

Start-UDDashboard -Content {
   $Auth = New-UDAuthenticationMethod -Windows
$LoginPage = New-UDLoginPage -AuthenticationMethod @( $Auth) -PassThru

New-UDDashboard -Title "Line" -Content { 
    New-UDRow -Columns {
        New-UDColumn -Size 12 -Endpoint  {
            New-UDHeading -Text "Logged in as $user"
} -LoginPage $LoginPage 
} -Wait -AllowHttpForLogin

But my Dashboard is structured differently. More like this.

$Auth = New-UDAuthenticationMethod -Windows
$LoginPage = New-UDLoginPage -AuthenticationMethod @( $Auth) -PassThru

$UD = New-UDDashboard -Title "Line" -Content {New-UDRow -Columns {New-UDColumn -Size 12 -Endpoint  {New-UDHeading -Text "Logged in as $user $(get-Random)"}}} -LoginPage $LoginPage 
Start-UDDashboard -Name "Test" -Wait -Endpoint $Endpoint -AllowHttpForLogin -Dashboard $UD

But this is not working.
Has anony a clue why?


Hi @AkiraFFM thanks for posting this question…had the same sort of conversation here:-

So I can see from how you have your dashboard structured you are using the -windows parameter, please see the explanation Adam gives here for this. I also posted an example which the user in this post got working. Hopefully this will also help to answer your question, as I see it is the same sort of thing. Let me know if you need more guidence. Thanks