01-24-2019 09:00 AM
01-24-2019 10:11 PM
Hello,
Which EV Version. I know in 12 there is a powershell cmdlet which let you do that: Set-EVArchivePermission
01-25-2019 04:59 AM
Hi,
Thanks for your answer Gertjan. Our EV version is 12.3.2.
I read about the Set-EVArchivePermission cmdlet, however, I need to specify a particular archiveID name each time.
Set-EVArchivePermission [-ArchiveId] <String> [-Trustee] <String> [-Grant <AccessRight[]> {Read | Write | Delete | All}] [-Deny <AccessRight[]> {Read | Write | Delete | All}] [-WhatIf] [-Confirm] [<CommonParameters>]
Is there a way to select all archives at once?
Thanks.
Best regards.
01-25-2019 05:32 AM
Hello again,
You could perhaps use the pipe command:
get-evarchive | Set-EVArchivePermission -Trustee DOMAIN\ACCOUNT -Grant Read -Confirm:$false
HOWEVER!
that will do it for all archives, and you stated you need this for the SMTP archives only. There is an object called ArchiveType, which is ARCHIVE_TYPE_SMTP, but I am not sure how that would work. Maybe you can first get all archiveid's from the get-archive, then put the smtp id's in a list, the have set-evarchivepermission loop through that list. I am however not sure how to do that :)
01-25-2019 05:55 AM
Hi,
I would be OK with giving the rights on all archives (including non-SMTP ones), however, the cmdlet returns the error :
"Set-EVArchivepermission : The term 'Set-EVArchivepermission' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again."
Reading the documentation, it looks like the cmdlet Set-EVArchivepermission was only implemented in 12.4.
I guess I need to do it manually for each archive :(
Thanks.
Best regards,
01-25-2019 11:55 PM
Darn. I did check the get-evarchive, not the set-evarchivepermission (12.3).
I have not tried using EVPM to set permission on SMTP archives, but below pwershell script can create the .ini file for evpm from a csv. (not my script, a colleague figured this out)
Create CSV file with Archivename, Account to create ini file for evpm. You need to add the default lines for evpm (directory/site), but the ini file will work. I used this for adding new domain accounts to existing archives. You might be able to replace ($item.ADACount) by the actual account (Domain\Account), but that requires testing. When the inifile is created, use 3 easily checked archives for your testrun.
Import-Module ImportExcel
$items = Import-CSV "d:\input_Permission.CSV"
$ini = ""
ForEach ($item in $items) {
$ini += "[ArchivePermissions]`r`n"
$ini += "ArchiveName = $($item.Aname)`r`n"
$ini += "GrantAcess = read write delete, $($item.ADACount)`r`n"
$ini += "`r`n"}
$ini | Out-File "H:\output_Permission.ini" -Encoding unicode