I’ve been working on a script which gets Enterprise vault environment from SQL and merges it with Exchange data and finally generate a neat csv using both data sources. In near future, will add some more features to it but for now, that’s what it does in nutshell.
However, I am unable to use “foreach” loop on data collected from SQL servers and pass it for processing and merge with exchange data, I am not sure where I went wrong.
In attached txt file, you can find the two functions I am using. First function is working as expected (Function GetEnterpriseVaultData), if I export csv files directly from there, no issues. It returns SQL tables in form of string array.
However in second function (Function GetMailboxData), where I use foreach ($Archive in $EnterpriseVaultData), the $Archive takes complete $EnterpriseVaultData and basically remaining function doesn’t works since it is expecting singular value.
If you guys can take a look please and point me in right direction, will appreciate a lot.
Thanks in Advance.