Results 1 to 2 of 2

Thread: Zimbra + Powershell ??

Hybrid View

  1. #1
    Join Date
    Apr 2013
    Rep Power

    Question Zimbra + Powershell ??

    I'm trying to use Powershell to connect to Zimbra and list all mailboxes by domain. Does anyone have a script that does this or can lend some guidance? We tried using Zimbra Powershell from the Gallery, but haven't had any luck

  2. #2
    Join Date
    Dec 2009
    Rep Power


    I managed to run it with some edition, it seems that xml2.xmlhttp used in function Send-Request does not work with https with self signed certificate.
    I just replaced that code to use Invoke-WebRequest
    It works if the function looks like this:
    		function Send-Request( [xml] $request ) {
    			$server = $global:zimbraSession.server
    			$r = Build-Request $request
    			$global:zimbraSession.Request = [xml]$r
    			$global:zimbraSession.Response = $null
    			[xml]$xmlResponse= Invoke-WebRequest -Uri $server -Body $r -Method Post -ContentType application/xml
    			if( $xmlResponse.Envelope.Body.Fault.Reason.Text -ne $null ) {
    				throw $xmlResponse.get_innerxml()
    			$global:zimbraSession.Response = $xmlResponse
    			$authToken = $xmlResponse.Envelope.body.AuthResponse.AuthToken
    			if( $authToken -ne $null -and $authToken -ne "" ) {
    				$global:zimbraSession.AuthToken = $authToken
    I use Microsoft .NET Framework 4 and Windows Management Framework 3.0

Similar Threads

  1. Unable to get PowerShell Zimlet to work ....
    By perimere in forum Zimlets
    Replies: 2
    Last Post: 10-25-2007, 09:18 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts