none
You must provide a value expression on the right-hand side of the '-' operator. RRS feed

  • Question

  • Hello All,

    im new in script field, and i need to run this PS script "Dot Source". This script with use event viewr logs to retrive information for a specific user logon location. i tried to run it through PS as administrator: 

    PS C:\> . .\Get-UserLastLogon.ps1

    And

    PS C:\> .\Get-UserLastLogon.ps1

    But i got the same error:

    You must provide a value expression on the right-hand side of the '-' operator.

    i think there is issue in the following lines:

    end{
    $Table = $Table | Where-Object {($_.Location -notin $AllDomainControllers) -and ($_.Location -ne $ForestRoot) -and ($_.Location -notin $ExclusionList)} 
    $Table | Sort Time | FT Time,User,Location,Domain,DC -AutoSize 

    i did download from:

    https://gallery.technet.microsoft.com/Find-where-a-user-logged-00e13f27

    I hope someone help me on this script.

    Best Regards,

    • Moved by Bill_Stewart Wednesday, September 13, 2017 9:07 PM This is not support forum for gallery scripts
    Tuesday, July 25, 2017 6:42 AM

All replies

  • Please read the first pinned post on top of the list of posts here in this forum: This forum is for scripting questions rather than script requests

    You should contact the author of the script if you need support for it. There is a Q & A section you can use to ask questions.

    Besides this: If you post code here in the forum please format it as code with the according option on the edit bar. If you get errors it's usually helpful to post the full error message as well. Ideally formatted as code as well. ;-)


    Grüße - Best regards

    PS:> (79,108,97,102|%{[char]$_})-join''

    Tuesday, July 25, 2017 8:42 AM
  • Thank you 
    Tuesday, July 25, 2017 10:13 AM