cancel
Showing results for 
Search instead for 
Did you mean: 

Add-Snapin Vault into an Exchange Powershell

mistervault
Level 4

Hello,

I need to make a script which combines both Exchange and Vault cmdlets.

I have got a Vault server (Windows 2003 x64) and an Exchange Server  (Windows 2003 x64).

I want to add the snap-in " Symantec.EnterpriseVault.PowerShell.Snapin" into the Exchange Powershell.

I don't know if it's possible to just copy "Symantec.EnterpriseVault.PowerShell.Snapin.dll" into the Exchange Server, load it and add the snap-in that way, is yes please explain me how.

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

AndrewB
Moderator
Moderator
Partner    VIP    Accredited

here's a SQL script to get you the backup mode of your vault stores:

use EnterpriseVaultDirectory
select VaultStoreName from VaultStoreEntry
where VaultStoreStatus = 2

View solution in original post

12 REPLIES 12

Rob_Wilcox1
Level 6
Partner

This is from a previous post of mine....

 

 

You have got to launch the x86 version of powershell from:

c:\windows\syswow64\WindoesPowerShell\v1.0

 

Navigate from that shell to the EV folder:

cd "\program files (x86)\enterprise vault"

 

Add the snapin

add-pssnapin Symantec.EnterpriseVault.PowerShell.Snapin

 

Run some stuff, eg

get-indexlocationbackupmode -evservername ev1a.ev.local

 

Maybe that'll help...

 

But maybe you'll need to look at remote powershell, rather than trying to add the DLL (which will no doubt rely on many of the other EV binaries) on to your Exchange server?

Working for cloudficient.com

mistervault
Level 4

I tried and I am able to add the Vault snapin into the Windows Powershell x86 (ran as admin) : 

However, I am not able to add the Exchange snapin into this same Windows Powershell x86 : 

 

PS C:\Program Files (x86)\Enterprise Vault> Add-PSSnapin Symantec.EnterpriseVault.PowerShell.Snapin
 
PS C:\Program Files (x86)\Enterprise Vault> cd "C:\Program Files\Microsoft\Exchange Server\bin"
 
PS C:\Program Files\Microsoft\Exchange Server\bin> Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin
 
Add-PSSnapin : The Windows PowerShell snap-in 'Microsoft.Exchange.Management.PowerShell.Admin' is not installed on this
 machine.
At line:1 char:13
+ Add-PSSnapin <<<<  Microsoft.Exchange.Management.PowerShell.Admin
    + CategoryInfo          : InvalidArgument: (Microsoft.Excha...owerShell.Admin:String) [Add-PSSnapin], PSArgumentEx
   ception
    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand
 
PS C:\Program Files\Microsoft\Exchange Server\bin>
 
Consequently, I am not able to add both snapins into the same Powershell.

AndrewB
Moderator
Moderator
Partner    VIP    Accredited

i think your problem with doing it that way is EV is 32bit and Exchange is 64bit

mistervault
Level 4

So, what should be the solution? 

AndrewB
Moderator
Moderator
Partner    VIP    Accredited

after you're done with the EV snapin, load the 64bit powershell again in your script and then call the Exchange snapin

mistervault
Level 4

Please, could you detail this part because I am not sure whatI have to do, thanks!

JesusWept3
Level 6
Partner Accredited Certified
Just as a matter of interest why do you want to do this given the limited functionality of the powershell? (Ie backup mode and partition roll over)
https://www.linkedin.com/in/alex-allen-turl-07370146

AndrewB
Moderator
Moderator
Partner    VIP    Accredited

the concept is that you have a script.cmd file and within that file you

1. call your x86 powershell from %SystemRoot%\syswow64\WindowsPowerShell\v1.0\powershell.exe

2. load your EV snapin

3. run your EV cmdlets

4. call your x64 powershell from %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe

5. add your Exchange snapin

6. run your Exchange cmdlets

mistervault
Level 4

@JesusWept3 : in fact, I just want to know if my vault stores are in backup mode.

Maybe it's more easy with a SQL query, does it exist a SQL query to check that?

AndrewB
Moderator
Moderator
Partner    VIP    Accredited

here's a SQL script to get you the backup mode of your vault stores:

use EnterpriseVaultDirectory
select VaultStoreName from VaultStoreEntry
where VaultStoreStatus = 2

mistervault
Level 4

Thanks AndrewB and Rob.Wilcox!

PeterWendell
Level 4

On my 32 bit Windows 7 workstation I have the Exchange cmdlets set to automatically load in my PS profile (via PS remoting). I have also have the EV Administration Console installed. If I open the 'Enterpsie Vault Management Shell' I have access to the all Exchange and EV cmdlets in the same PS session.