Migration to Office 365 from GroupWise - Perficient Blogs
Blog
  • Topics
  • Industries
  • Partners

Explore

Topics

Industries

Partners

Migration to Office 365 from GroupWise

Many users are migrating to the Office 365 platform and a good portion of those are migrating from GroupWise.  I  recently had the opportunity to migrate a client from GroupWise to Office 365 and wanted to leverage PowerShell.  There are several good reasons for this:

  • There are limited reports available from GroupWise and they never seemed to give me exactly what I wanted.
  • I wanted to get mailbox sizes and address book sizes in an excel format I could use for quick comparisons to see if a migration was successful.
  • We spread the migrations across 10 servers and wanted to organize users based upon mailbox size or number of messages so they would finish in the time frame allowed.
  • I needed to get the email aliases of the user in GroupWise so we could ensure the new mailbox in the cloud carried those same aliases.
  • I wanted to exercise my PowerShell chops – could it even be done?

Firstly, and most importantly, I believe you need GroupWise 8 SP1 for most of this to work properly.  I haven’t tried it on earlier versions, so your mileage may vary.

To make this script work, you will need a few things:

  • Create a Novell GroupWise Trusted Application
  • SOAP needs to be enabled on the GroupWise Servers
  • Novell SOAP API document – I am only showing the hard part which is getting the SOAP connection started, you will need to adjust so you can create your own SOAP queries

Here is the script, please do not run it in your environment w/o careful review… (there are limited comments here – I may add some when I have  more time)
#region functions
function Execute-SOAPRequest (

$SOAPRequest,</pre>
<span style="color: #0000ff; font-family: Courier New; font-size: small;">[String]$URL, </span><span style="color: #0000ff; font-family: Courier New; font-size: small;">[String]$actionUrl,</span><span style="color: #0000ff; font-family: Courier New; font-size: small;">[String]$session,</span><span style="color: #0000ff; font-family: Courier New; font-size: small;"> [String]$gwapicall</span><span style="color: #0000ff; font-family: Courier New; font-size: small;">) </span>
<span style="color: #0000ff; font-family: Courier New; font-size: small;">{ </span>
<span style="color: #0000ff; font-family: Courier New; font-size: small;">        write-host "Sending SOAP Request To Server: $URL" </span>
<span style="color: #0000ff; font-family: Courier New; font-size: small;">        $soapWebRequest = [System.Net.WebRequest]::Create($URL) </span>
<span style="color: #0000ff; font-family: Courier New; font-size: small;">        $soapWebRequest.Headers.Add("SOAPAction","`"loginRequest`"") </span>
<span style="color: #0000ff; font-family: Courier New; font-size: small;">        $soapWebRequest.ContentType = "text/xml;charset=`"utf-8`"" </span>
<span style="color: #0000ff; font-family: Courier New; font-size: small;">        $soapWebRequest.Accept      = "text/xml" </span>
<span style="color: #0000ff; font-family: Courier New; font-size: small;">        $soapWebRequest.Method      = "POST" </span>
<span style="color: #0000ff; font-family: Courier New; font-size: small;"><span style="color: #0000ff; font-family: Courier New; font-size: small;">        [xml]


$soapPartII = $null
        if (-not $SOAPRequest) {
            write-host “Creating SOAP packet.”
            $soapPartI = ‘
<s:Envelope xmlns:s=”http://schemas.xmlsoap.org/soap/envelope/”>
<s:Header>
<h:gwTrace xmlns:h=”http://schemas.novell.com/2005/01/GroupWise/types” xmlns=”http://schemas.novell.com/2005/01/GroupWise/types”>false</h:gwTrace>
<h:session xmlns:h=”http://schemas.novell.com/2005/01/GroupWise/types” xmlns=”http://schemas.novell.com/2005/01/GroupWise/types”>’
             $soapPartI += $session
            $soapPartI += ‘</h:session></s:Header>
<s:Body xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema”>’
             $soapPartI += $gwapicall
            $soapPartI += ‘
<getAddressBookListRequest />
</s:Body></s:Envelope>

            $soapPartII =

$soapPartI
        } else { $soapPartII = $SOAPRequest }
        write-host “Initiating Send.”
        $requestStream = $soapWebRequest.GetRequestStream()
        $soapPartII.Save($requestStream)
        $requestStream.Close()
        write-host “Send Complete, Waiting For Response.”
        $resp = $soapWebRequest.GetResponse()
        $responseStream = $resp.GetResponseStream()
        $soapReader = [System.IO.StreamReader]($responseStream)
        $ReturnXml =
 $soapReader.ReadToEnd()</pre>
<span style="color: #0000ff; font-family: Courier New; font-size: small;">        $responseStream.Close() </span>
<span style="color: #0000ff; font-family: Courier New; font-size: small;">        write-host "Response Received." </span>
<span style="color: #0000ff; font-family: Courier New; font-size: small;">        return $ReturnXml </span>
<span style="color: #0000ff; font-family: Courier New; font-size: small;">} </span>
<span style="color: #0000ff; font-family: Courier New; font-size: small;">#endregion</span>
<span style="color: #0000ff; font-family: Courier New; font-size: small;">$myAdmin = "DOMAIN\GWADMIN"</span>
<span style="color: #0000ff; font-family: Courier New; font-size: small;">$myPwd = "passwordhere"</span>
<span style="color: #0000ff; font-family: Courier New; font-size: small;">$domainName="PODOMAIN"</span>
<span style="color: #0000ff; font-family: Courier New; font-size: small;">$postOfficeName="PONAME"</span>
<span style="color: #0000ff; font-family: Courier New; font-size: small;">$myUri = </span><a href="http://XXXX:XXX/soap"><span style="color: #0000ff; font-family: Courier New; font-size: small;">http://XXXX:XXX/soap</span></a>
<span style="color: #0000ff; font-family: Courier New; font-size: small;">#************** Send the request - get session key ************************************************</span>
<span style="color: #0000ff; font-family: Courier New; font-size: small;"><span style="color: #0000ff; font-family: Courier New; font-size: small;">$soap = [xml]


@’
<s:Envelope xmlns:s=”http://schemas.xmlsoap.org/soap/envelope/”>
<s:Header>
<h:gwTrace xmlns:h=”http://schemas.novell.com/2005/01/GroupWise/types” xmlns=”http://schemas.novell.com/2005/01/GroupWise/types”>false</h:gwTrace>
</s:Header>
<s:Body xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema”>
<loginRequest xmlns=”http://schemas.novell.com/2005/01/GroupWise/methods”><auth xsi:type=”q1:TrustedApplication” xmlns:q1=”http://schemas.novell.com/2005/01/GroupWise/types”>
<q1:username>JETTONK</q1:username><q1:name>PowershellTrustedApp</q1:name>
<q1:key>INSERTKEYHERE</q1:key>
</auth><version>1.04</version></loginRequest>
</s:Body></s:Envelope>
‘@

$ret = Execute-SOAPRequest $soap $myUri
Write-Host -ForegroundColor Cyan $ret.InnerXml

$parseXml = $ret.InnerXml
$sessionid = $parseXml.GetElementsByTagName(“session”).’#text’
Write-Host -ForegroundColor DarkGreen session $sessionid
#************** Send the request – getdiskspace ************************************************
# get disk space
$GwAPIstring = ‘<getDiskSpaceUsageRequest xmlns=”http://schemas.novell.com/2005/01/GroupWise/methods”/>’

$ret = Execute-SOAPRequest $null $myUri $null $sessionid $GwAPIstring
write-host $ret.InnerXml
 
Comments or suggestions welcomed on this script, it was designed and created during a project in a few hours.  Let me know if you found it useful.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Subscribe to the Weekly Blog Digest:

Sign Up