Hi,
I am using below script to pullout the publicfolders from CSV file and then setting the Access rights for all users on public folder as None. But I want enable logging for this script so that I can have a CSV file which will have User Identity, Public folder name\path, Last time Access (Access rights for user before running this script), New Access (Access rights for user after running this script). So please do let me know parameter I can add in this script?
# Add Exchange Shell...
If ((Get-PSSnapin | where {$_.Name -match "Microsoft.Exchange.Management.PowerShell.E2010"}) -eq $null)
{Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010}
########## Script Start #####################
$AllPublicFolders = Get-Content E:\publicfolderlists.csv
foreach($Pf in $AllPublicFolders )
{
$a = Get-PublicFolderClientPermission -Identity "$pf"
Get-PublicFolderClientPermission -Identity "$pf" | Remove-PublicFolderClientPermission -Confirm:$false
Foreach ($b in $a)
{
Get-PublicFolderClientPermission -Identity "$pf" | Add-PublicFolderClientPermission -user $b.user -AccessRights None -Confirm:$false
}
}
########### Script End #####################
I want a CSV in out which will have all the parameter what I mentioned in above, so please do let me know what need to add in above script in details?