10-16-2013 02:00 AM
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
Solved! Go to Solution.
10-17-2013 07:54 AM
try this it worked in my lab
10-16-2013 02:42 AM
Hi Kevin,
Could you try to use $app= UNC Path of EV Server and then run the script.
10-16-2013 03:12 AM
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
10-16-2013 03:17 AM
Hi Kevin ,
That's right.
10-16-2013 03:24 AM
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
10-17-2013 07:14 AM
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
10-17-2013 07:54 AM
try this it worked in my lab
10-21-2013 04:50 AM
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.