Feb 242016
 

Have you ever looked at director and saw a user had a very long login, and wondered how the hell you could find out who that was?  I wrote a script to help you out a bit!

Here is the script

Read it!  There are places you will have to edit to allow it to run in your environment.  Search for ##### to find the spots to pay attention to.

In the end it will output a .htm file to your my documents\logon_logs and open after it finishes.

 

Note: I have no idea if this works for XA, but I know it works for XD 7.6

  6 Responses to “Director Logon Duration Script”

  1. when i run your script i get the follow error
    Get-Date : Cannot bind parameter ‘Date’ to the target. Exception setting “Date”: “Object reference not set to an instance of an object.”
    At C:\scripts\create_loginreport.ps1:160 char:110
    + … | ?{((get-date ($_.startdate.”#text”)) -ge $start) -and (([int]$_.logonduration. …
    + ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : WriteError: (:) [Get-Date], ParameterBindingException
    + FullyQualifiedErrorId : ParameterBindingFailed,Microsoft.PowerShell.Commands.GetDateCommand

  2. currently using 7.8

  3. from some of the debuging i have done it looks like true is being passed at the get-date statement on line
    $sessions = (invoke-restmethod -uri ($base+”Sessions”) -Credential $creds).content.properties | ?{((get-date ($_.startdate.”#text”)) -ge $start) -and (([int]$_.logonduration.”#text”) -ge $max)}

  4. i am not able to run this script can you help me for that I am using 7.8.

Leave a Reply to David Ott Cancel reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

(required)

(required)

This site uses Akismet to reduce spam. Learn how your comment data is processed.