Hi there …
Im struggling with ClaimsPrincipal …
Im tring to do a really simple thing, I supposed …
I need to get the Samaccountname logged in (Im using Windows authentication, and its all functionnal)
//This Is OK ==> username is displayed like “DOMAIN\samaccountname”
new-udcard -endpoint {
“You are $($ClaimsPrincipal.identity.name)”
}
//This IS Not OK ==> No user name is displayed userLoggedIn = ($ClaimsPrincipal.identity.name)
new-udcard -endpoint {
“You are $userLoggedIn”
}
Also trying to get the samaccountname like this but i get nothing. (($ClaimsPrincipal.identity.name).tostring()).replace(“DOMAIN”,"")