I have the following script to verify a user has a home folder in their object. I also want to verify the user has the assigned rights to their home folder and thought I would use get-acl. #-------------------------------Begin Script-----------------------------------------------------------------# Setup output file with date format $OutPutFile = "GetUserHomeDrivePerOULog-{0} {1}.csv" -f ($_.name -replace ", ","-"),((Get-Date -f U) -replace ":","-") $Ou = 'ou=Users,dc=domain,dc=com' # Get all users in the $OU and read name, homedir, homedrive, profilepath, and DN # then write to file get-qaduser -SearchRoot $OU -SizeLimit 0 -DontUseDefaultIncludedProperties -IncludedProperties name, homedirectory, homedrive, profilepath, DN ` | select Name, Homedirectory, Homedrive,Profilepath,DN | Export-Csv $OutPutFile -NoTypeInformation
How would i incorporate get-acl into my loop so it prints the acl to the csv in another column? I would only select-object accesstostring value. For Example, get-acl c:\temp | select-object accesstostring. I basically need to store the homedirectory value into variable and then get-acl that variable and include it's output into my CSV. Thanks for the help. |