Forum Discussion

Kevin_O_Connor's avatar
12 years ago

ArchivePoints.exe via Powershell

Hi all,

I’m in the process of creating a powershell script to check OU users against users already configured for file share archiving but I’ve hit a stumbling block. I can query AD to get a list of users per OU and their home directories, dumping all of the details out to text files for logs and basing subsequent queries on.

 

When I try to query the Archive Points using archivepoints.exe I keep getting an error.

 

The simple form of the script would be :

 

$app="D:\Enterprise Vault\ArchivePoints.exe"

$EVArg = "find"

$VolLine = "\\fopserver045v\ouone_users_r$"

Invoke-Item "$app $EVArg $VolLine"

 

But it errors with the following.

Invoke-Item : Cannot find path 'D:\Enterprise Vault\ArchivePoints.exe find \fopserver045v\ouone_users_r$' because it does not exist.

It looks like it’s cutting the first backslash off the UNC path, not sure if that’s the problem or just a side effect but either way I haven’t been able to successfully run it.

Has anyone tried to use Powershell to find archive points successfully ?

 

I can upload the script (it ain’t pretty but it does the job so far) if it might help.

 

Thanks Kevin

  • try this it worked in my lab

     

    $cmd="E:\Program Files\Enterprise Vault\ArchivePoints.exe"
     
    $cmdarg = @("find","\\evserv2\users")
    & $cmd $cmdarg
     
    saved as ap.ps1
     
    it took a while to run but the output looked like
     
    PS C:\Users\admin> .\ap.ps1
     
    Listing Archive Points ...
            Archive Point : \\evserv2\users\Andrew.Moore
            Archive Point : \\evserv2\users\Bonnie.Walker
            Archive Point : \\evserv2\users\Mike.Smith
            Archive Point : \\evserv2\users\Samantha.Cho
            Archive Point : \\evserv2\users\Tamara.Kramer
            Archive Point : \\evserv2\users\Vivian.Vance
    PS C:\Users\admin>
     
     

     

  • Hi Kevin,

    Could you try to use $app= UNC Path of EV Server and then run the script.

     

  • Hi Ajay,

     

    Sorry, I don't understand.

    $app currently has $app="D:\Enterprise Vault\Archivepoints.exe" so are you saying it should be $app="\\evserver01\D$\Enterprise Vault\Archivepoints.exe"

    Rgegards

    Kevin

  • Hi Ajay,

     

    Okay, it now references the UNC path with double backslashes but still fails with the following.

     

    Invoke-Item : Cannot find path '\\evserver01\D$\Enterprise Vault\Archivepoints.exe find \\fopserver045v\ouone_users_r$' because it does not exist.
    At D:\Scripts\testing\ev.ps1:5 char:12
    + Invoke-Item <<<<  "$app $EVArg $VolLine"
        + CategoryInfo          : ObjectNotFound: (\\evserver01\D...\ouone_users_r$:String) [Invoke-Item], ItemNotFoundException
        + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.InvokeItemCommand

     

    Regards

    Kevin

  • Hi,

    I would use the '&' operator as PJuster suggested to call the program. According with MS, the Invoke-Item cmdlet is recommended to force the default action for a file type:

    4. Invoke-Item (II)

    Why: Forces the default action to be run on the item.

    Details: Good when trying to open a file with an associated program. If for example you invoke-item with a PDF file, it opens it in whatever program is associated with PDF files. This can also be used to open multiple files at once. This is not good for executing a program.

    https://social.technet.microsoft.com/wiki/contents/articles/7703.powershell-running-executables.aspx

  • try this it worked in my lab

     

    $cmd="E:\Program Files\Enterprise Vault\ArchivePoints.exe"
     
    $cmdarg = @("find","\\evserv2\users")
    & $cmd $cmdarg
     
    saved as ap.ps1
     
    it took a while to run but the output looked like
     
    PS C:\Users\admin> .\ap.ps1
     
    Listing Archive Points ...
            Archive Point : \\evserv2\users\Andrew.Moore
            Archive Point : \\evserv2\users\Bonnie.Walker
            Archive Point : \\evserv2\users\Mike.Smith
            Archive Point : \\evserv2\users\Samantha.Cho
            Archive Point : \\evserv2\users\Tamara.Kramer
            Archive Point : \\evserv2\users\Vivian.Vance
    PS C:\Users\admin>
     
     

     

  • Hi Pjuster,

     

    Thanks for that.

     

    I've been able to get it working now and using out-file to dump the results out to a text file.