It's encoded. Here's a blog article on how to decrypt it with a PS helper script.
Get-ADUser -filter * -properties logonhours to output with days and times?
Paul H
6
Reputation points
Good Morning,
I am trying to get a powershell script to output usernames and allowed logon times that is useable. I can get an output but the time/date is in system.byte. This is what I am using:
Get-ADUser -filter * -properties LogonHours | export-csv -path (file path)
It spits out a CSV no problem but the logon data is in system.byte. That is my question...What do I need to do to convert it to days and times?
2 answers
Sort by: Most helpful
-
-
Limitless Technology 39,511 Reputation points
2021-09-17T16:08:29.547+00:00 Hello @Paul H
This is an example on how to convert the bytes array to String:
Hope this is useful,
Best regards,