11-12-2013 04:23 AM
We are trying to automate user deletion. So far I've set up a process which creates an ini file for evpm to reset permission and change the billing user to the service user. This works fine except for one case. When the user's archive has an umlaut in it's description the script fails with:
Creating privileged MAPI session ...Parsing input file: c:\batch\eva-auto.txtError parsing command file: c:\batch\eva-auto.txt, error follows:Line number in error: 7Section in error: VaultPermissionsAttribute in error: vaultnameValue in error: Müller, HugoError parsing the config (.ini) file
Creating privileged MAPI session ...Parsing input file: c:\batch\eva-auto.txtError parsing command file: c:\batch\eva-auto.txt, error follows:Line number in error: 0Section in error: Input file must be saved as UnicodeAttribute in error: <none>Value in error: <none>Error parsing the config (.ini) file
UTF-8 with BOM gives:
Error - the directory computer name is not specified or value is invalid in the [DIRECTORY] section of the .ini file
The contents of the ini File is:
[Directory]DirectoryComputerName=evserverSiteName=evarchiv[VaultPermissions]vaultname=Müller, HugoZAP=True[ArchivePermissions]ArchiveName=Müller, HugoGrantAccess = read write delete, DOMAIN\EVSA[Archive]ArchiveName=Müller, HugoVaultStoreName=privateBillingOwner=DOMAIN\EVSAdescription=Extended for EVSA
Solved! Go to Solution.
11-12-2013 09:41 AM
If you really want to use the archiveID, you can update your PS script to access the Enterprise Vault Directory DB. This forum can give you more info on how to add SQL to your PS script:
http://irisclasson.com/2013/10/16/how-do-i-query-a-sql-server-db-using-powershell-and-how-do-i-filter-format-and-output-to-a-file-stupid-question-251-255/
I hope this helps.
11-12-2013 04:34 AM
If it helps, you can use ArchiveID instead.
Include this section if you want to modify the properties of one or more archives.
Mandatory. Identifies the archive to process.
Possible values:
Archive name
Archive ID
If the archive does not exist, Policy Manager creates a shared archive. (If you want to create mailbox archives, enable the mailboxes.)
11-12-2013 05:58 AM
Hello,
Is this a batch file you are modifying manually or do you have some sort of app that creates this file? Using the Archive ID will defnitely fix this issue as Rob mentioned, but if this file is being generated automatically, then you might need to pull this info from SQL.
11-12-2013 08:09 AM
Hello,
this is a powershell script which creates the ini file. In short it fetches expired users from active directory and moves them to a "archive all" group. After x days the user is deleted. The missing part is the EV cleanup.
Thanks
11-12-2013 08:59 AM
11-12-2013 09:41 AM
If you really want to use the archiveID, you can update your PS script to access the Enterprise Vault Directory DB. This forum can give you more info on how to add SQL to your PS script:
http://irisclasson.com/2013/10/16/how-do-i-query-a-sql-server-db-using-powershell-and-how-do-i-filter-format-and-output-to-a-file-stupid-question-251-255/
I hope this helps.
11-13-2013 04:06 AM
Is it the dbo.Archive.VaultStoreEntryId column I'm looking for?
We zap the mailbox, so the permissions are clean i.e. no sid which wouldn't resolve later on and the permissions are in a defined state.
11-13-2013 06:02 AM
I am not sure what version of Enterprise Vault you are running but take a look at the ArchiveView view in the directory database and look for the VaultEntryId field. That would be the ArchiveID.
11-18-2013 05:07 AM
$dataSource = "sqlserver"$database = "EnterpriseVaultDirectory"#$user = "user"#$pwd = "1234"#$connectionString = "Server=$dataSource;uid=$user; pwd=$pwd;Database=$database;Integrated Security=False;"$connectionString = "Server=$dataSource;Database=$database;Integrated Security=True;"$query = "SELECT [VaultEntryId], [ArchiveName] FROM [EnterpriseVaultDirectory].[dbo].[ArchiveView] WHERE [ArchiveName] = '{0}'" -f $displayName$connection = New-Object System.Data.SqlClient.SqlConnection$connection.ConnectionString = $connectionString#$connection.ConnectionString = "Server=$dataSource;Database=$database;Integrated Security=True;"$connection.Open()$command = $connection.CreateCommand()$command.CommandText = $query$result = $command.ExecuteReader()$table = new-object “System.Data.DataTable”$table.Load($result)$connection.Close()
11-18-2013 06:00 AM
Glad to help !!