none
GET AD HOME Drive info RRS feed

  • Question

  • Hello everyone, 

    I am using the below script to get a list of AD user of a domain, to get which one have a home directory mapped. Until now it is working, but i will like to add another property but I don't know if it is possible. Is there any way to get when was last modified a file inside each Homedrive? I need to know who is using it and when it was the last time that a file was edited on it.

    $csvfile = "C:\HomeDirectory.csv"
    $root = "OU=Accounts,DC=mydomain,DC=local"
    get-qaduser -SearchRoot $root `
    -ObjectAttributes @{homeDirectory=’*'} -IncludeAllProperties | `
    Select-Object LogonName,HomeDirectory| `
    Export-Csv $csvfile

    Thanks for your time, best regards.

    Friday, July 15, 2016 2:59 PM

Answers

All replies

  • Is there any way to get when was last modified a file inside each Homedrive?
    You can't get a last modification date for a file in a path by querying AD. You'd have to get that from the server where the file sits.

    -- Bill Stewart [Bill_Stewart]

    Friday, July 15, 2016 4:31 PM
    Moderator
  • mmm and what if i only export the homedirectory info to a csv and then user it to get that info, that will help? 
    Friday, July 15, 2016 4:43 PM
  • Will what help?

    We can help answer specific scripting questions, but this isn't the place to ask others to write a script for you.

    Please read the following post (it's right at the top of this forum):

    This forum is for scripting questions rather than script requests


    -- Bill Stewart [Bill_Stewart]

    • Marked as answer by D.M.L Friday, July 15, 2016 6:50 PM
    Friday, July 15, 2016 5:29 PM
    Moderator