locked
when we run Powershell Get-ChildItem its changing last access on folders. RRS feed

  • Question

  • Hi,

    When we run Get-ChildItem to see last access on list of folders its showing script run time as last access, i think gci change last access time on folder? can someone help me if this is expected behavior ?

    i am running below one liner code

    get-childitem "\\servers\folder\" -recurse -directory | foreach-object { $_.Fullname ; $_LastAccessTime }

    Thursday, June 8, 2017 7:55 AM

Answers

  • If the NAS is not a Windows system then you will have to talk to the vendor of the NAS. Get-Acl will not work on many third party NAS servers.


    \_(ツ)_/

    • Proposed as answer by Hello_2018 Friday, June 9, 2017 9:22 AM
    • Marked as answer by tecsrtecsr Saturday, June 24, 2017 11:21 AM
    Thursday, June 8, 2017 9:04 AM

All replies

  • I cannot reproduce your issue.

    \_(ツ)_/

    Thursday, June 8, 2017 8:12 AM
  • Can't reproduce it, too. Also, I have never observed something like that.

    By the way (has nothing to do with your problem): Use Select-Object for this purpose instead of Foreach-Object. That's what it was made for.

    Thursday, June 8, 2017 8:38 AM
  • I missed to add, I am getting this only when i run this on NAS share , the reason i am using Foreach-object is i am getting ACL also.

    I run with select-object still same , this is only on NAS no idea why.

    • Edited by tecsrtecsr Thursday, June 8, 2017 8:54 AM
    Thursday, June 8, 2017 8:51 AM
  • If the NAS is not a Windows system then you will have to talk to the vendor of the NAS. Get-Acl will not work on many third party NAS servers.


    \_(ツ)_/

    • Proposed as answer by Hello_2018 Friday, June 9, 2017 9:22 AM
    • Marked as answer by tecsrtecsr Saturday, June 24, 2017 11:21 AM
    Thursday, June 8, 2017 9:04 AM
  • OK, thank you
    • Marked as answer by tecsrtecsr Saturday, June 24, 2017 11:21 AM
    • Unmarked as answer by tecsrtecsr Saturday, June 24, 2017 11:21 AM
    Thursday, June 8, 2017 9:07 AM
  • Hi ,

    did this issue was resolved?

    if not please share the current situation for further assistance.

    if yes, please help to mark the appropriate reply as answer.

    Best regards,

    Andy


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Tuesday, June 13, 2017 2:59 AM