Get-logonhistory retrieve Display name from Active directory

Welcome Forums General PowerShell Q&A Get-logonhistory retrieve Display name from Active directory

Viewing 1 reply thread
  • Author
    Posts
    • #248449
      Participant
      Topics: 1
      Replies: 0
      Points: 12
      Rank: Member

      Hello, I’m using the script below to retrieve who has logged on and off to some servers.

      In the second part of the script, I read out the file and via get-aduser I retrieve the display name of the user.

      As you can see I do first a trim before, I look up the user. this part is going wrong when the hour format is longer then expected. Any idea how I can solve this?

      thx!

    • #248851
      Participant
      Topics: 8
      Replies: 568
      Points: 2,171
      Helping Hand
      Rank: Community Hero

      What is longer than expected? You show no example of what you get or what you expect. Is it consistently wrong? Meaning, is it always 4 digits? Help us help you…

Viewing 1 reply thread
  • You must be logged in to reply to this topic.