Avatar of Erwin Pombett
Erwin Pombett
Flag for Switzerland

asked on 

how can i pass a powershell command result to a variable ? with Get-ADUser it doesnt work.

Hello,

I'm loosing patience trying to get the lastlogontimestamp to a variable that i need to use later in my script.
If i pass my command in the powershell prompt i receive an answer but not in my script.

here's the line that i need help with :
$lastLogonTimestamp = Get-ADUser -Filter {EmailAddress -eq $person.Email} -Properties lastLogonTimeStamp -Server serverdomain.tutu.fr | select lastLogonTimeStamp

i need the integer into my $lastLogonTimestamp variable...


thank you in advance for your help.
Powershell

Avatar of undefined
Last Comment
oBdA

8/22/2022 - Mon