Try our new Certificate Revocation List Check Tool
CRLcheck.exe is a tool developed to verify digital signatures of executable files. It collects files from known paths on your client, checks their signature, and checks Certificate Revocation Lists (CRL) and OCSP download. This helps avoid delays in launching files.
Category published:  Exchange 2007 Exchange 2010 Server 2008 R2   Click on the Category button to get more articles regarding that product.

Exchange Running Powershell from Batch on Server 2008/R2, 32/64BIT

Posted by admin on 19.10.2011

Exchange Running Powershell from Batch on Server 2008/R2 32/64BIT, c:\windows\Sysnative Patch

If your recieve the error while running a Powershell from Batch:

WARNING: The following errors occurred when loading console D:\ProgramFiles\Microsoft\Exchange Server\bin\exshell.psc1:
Cannot load Windows PowerShell snap-in Microsoft.Exchange.Management.PowerShell.Admin because of the following error:
No snap-ins have been registered for Windows PowerShell version 2.
Command ‘c:\batch\butsch.ps1’ could not be executed because so me Windows PowerShell snap-ins did not load.

You may have to call the Powershell from within the Batch this way:

my_batch.cmd

:: 64BIT  C:\Windows\SysWOW64\WindowsPowerShell\v1.0\PowerShell.exe
:: 32BIT  C:\WINDOWS\system32\WindowsPowerShell\v1.0\PowerShell.exe
:: 32BIT  C:\Windows\Sysnative\WindowsPowerShell\v1.0\PowerShell.exe < Server 2008 and R2 64BIT if you call the Powershell from DOS Batch.
c:
cd “D:\Program Files\Microsoft\Exchange Server\bin”
C:\Windows\Sysnative\WindowsPowerShell\v1.0\PowerShell.exe -PSConsoleFile “D:\Program Files\Microsoft\Exchange Server\bin\exshell.psc1” -noexit -command “c:\batch\butsch.ps1”

The sysnative was the soltion and not registering Components new or compiling the batch with 64BIT (In some surounding code with .exe)

The Hotfix which is mentioned in almost 70% of the Blogs is for Server 2003 and not for 2008.

http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/41c9cd78-74ad-4903-8a77-be6c09724669

 


 Category published:  Exchange 2007 Exchange 2010 Server 2008 R2   Click on the Category button to get more articles regarding that product.