Results 1 to 2 of 2

Thread: Zimbra + Powershell ??

  1. #1
    bradshannon is offline Beginner Member
    Join Date
    Apr 2013
    Posts
    1
    Rep Power
    1

    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
    pingwin is offline Intermediate Member
    Join Date
    Dec 2009
    Posts
    22
    Rep Power
    5

    Default

    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:
    Code:
    		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
    			}
    			
    			$xmlResponse
    		}
    I use Microsoft .NET Framework 4 and Windows Management Framework 3.0

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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
  •