Need some help with this script:
$users = import-csv "Usernames.csv"
foreach ($user in $users) {
Get-PublicFolder "PublicFolder"
add-publicfolderclientpermission -accessrights PublishingEditor -user $user
If you look at the error below it looks like it is trying to add the user in line 1 of the CSV file to each user in the csv file
Error:
Cannot process argument transformation on parameter 'User'. Cannot convert value "@{user_in_line1=User_in_line2}" to type "Microsoft.Exchange.Management.StoreTasks.MailboxFolderUserIdParameter". Error: "Cannot convert hashtable to an object of the
following type: Microsoft.Exchange.Management.StoreTasks.MailboxFolderUserIdParameter. Hashtable-to-Object conversion is not supported in restricted language mode or a Data section."