Hi guys, I am now working with FSRM quotas and we would like to send emails to all users that are exceeding their defined soft quotas. I know there is an option to do this automatically within FSRM, but the requirement to send an email to users on regular basis until they move data somewhere else.
I set up a CSV report to run daily and here is the output:
“Quota Usage Report”
Generated at: “24/06/2015 10:20:06 a.m.”
“Lists the quotas that exceed a certain disk space usage level. Use this report to quickly identify quotas that may soon be exceeded so that you can take the appropriate action.”
Report settings:
Machine: ,“server1”
Report Folders: ,“D:\users”,
Parameters: ,“Minimum Quota used percent: 0%”
Report Totals
Files shown in the report
Quotas,Quota Usage
“3”,“735 MB”
All files matching report criteria
Quotas,Quota Usage
“3”,“735 MB”
Report statistics
Folder,Owner,Quota,Usage,Percent Used(%),Peak Usage,Peak Usage Time
“D:\users\folder1”,“Contoso\user1”,“150 MB”,“406 MB”,“270.40” %,“406 MB”,“13/11/2014 1:29:37 p.m.”
“D:\users\folder2”,“Contoso\user2”,“150 MB”,“213 MB”,“142.19” %,“618 MB”,“13/11/2014 1:29:38 p.m.”
Etc.
Is there an easy way in powershell to return only the part after “Report statistics”?
I though about select-string with context parameter, but I don’t know how many additional lines can be in the report. There might be few more lines above it for other servers. I also thought about regex check, but I am not that familiar with regex yet and the data in the lines I am interested in are also shown earlier in the output (e.g. date, path), so I am not sure if this can be used anyhow.
I might be able to figure the issue out with using a loop through the content. But I believe there might be something way easier (most likely a one-liner?) to get the same result.
Thank you.