Skip to content
Snippets Groups Projects

AdmAPI 3.0.3

Merged Thomas Pätzold requested to merge dev into master
2 files
+ 83
10
Compare changes
  • Side-by-side
  • Inline
Files
2
# These are the Pester Tests in order to demonstrate how the API works
# These are the Pester Tests in order to demonstrate how the API works and
# reflects the following versions API04 MailADM 3.0.3
# If you need further documentation please check our doku-portal [0]
# or contact our IT-ServiceDesk (servicedesk@itc.rwth-aachen.de)
# [0] https://doc.itc.rwth-aachen.de/dosearchsite.action?queryString=MailAdm
# initializing
# connection settings
$user = "<MailAdm Serviceaccount>"
$password = "<password>"
$user = "<Service Account>" # e.g. srv123456@rwth-ad.de
$password = "<Password>"
$uri = "https://ws.rwth-ad.de/ex-cache-ws/APIv04.asmx?wsDL"
# import functions
. .\connect.ps1
. .\listquota.ps1
. .\mailaccounts.ps1
. .\distributionlist.ps1
# set variables
# please change the following variables
$existingUPN = "<existing user logon name>" # e.g. ab123456@mustereinrichtung.rwth-aachen.de
# these variables should work
$Primarydomain = "mustereinrichtung.rwth-aachen.de"
$SecondaryDomain = ""
$existingPersonalMailaccount = "paetzold@mustereinrichtung.rwth-aachen.de"
@@ -23,6 +25,15 @@ $distributionlist = "zoo@mustereinrichtung.rwth-aachen.de"
$newdistributionmailaddress = "alletiere2@mustereinrichtung.rwth-aachen.de"
$newmailaddress = "zebra@mustereinrichtung.rwth-aachen.de"
# import functions
. .\connect.ps1
. .\listquota.ps1
. .\mailaccounts.ps1
. .\distributionlist.ps1
Describe "MailAdm-Doku" {
It "Connection: Establish a connection with Webservice" {
$global:ws = new-mailadmconnection -user $user -password $password -uri $uri
@@ -48,6 +59,11 @@ Describe "MailAdm-Doku" {
$mailaccounts.count | should -BeGreaterOrEqual 0
}
It "get-mailbox: check for existing Logon Credentials and returns the corresponding Mailboxinformation" {
$mailaccount = get-mailbox -webserviceConnection $global:ws -upn $existingUPN
$mailaccount.count | should -Be 1
}
It "Remove-Mailboxinvitation: dummy test in order to remove all invitations to get a defined infrastructure" {
$result = remove-allmailboxinvitation -webserviceconnection $global:ws
# check if alll invitations could be deleted
@@ -240,6 +256,48 @@ Describe "MailAdm-Doku" {
$result | should -Be $true
}
It "change: Mailboxtype functional mailbox -> room mailbox" {
# 0 UserMailbox
# 1 Funktionsaccount (in Exchange: UserMailbox)
# 2 RoomMailbox
# 3 EquipmentMailbox
$upn = "fkt_$existingfunctionalmailbox"
$result = change-mailboxtype -webserviceConnection $global:ws -upn $upn -newmailboxtype 2
$result | should -Be $true
}
It "change: Mailboxtype room mailbox -> equipment mailbox" {
# 0 UserMailbox
# 1 Funktionsaccount (in Exchange: UserMailbox)
# 2 RoomMailbox
# 3 EquipmentMailbox
$upn = "fkt_$existingfunctionalmailbox"
$result = change-mailboxtype -webserviceConnection $global:ws -upn $upn -newmailboxtype 3
$result | should -Be $true
}
It "change: Mailboxtype equipment mailbox -> functional Mailbox" {
# 0 UserMailbox
# 1 Funktionsaccount (in Exchange: UserMailbox)
# 2 RoomMailbox
# 3 EquipmentMailbox
$upn = "fkt_$existingfunctionalmailbox"
$result = change-mailboxtype -webserviceConnection $global:ws -upn $upn -newmailboxtype 1
$result | should -Be $true
}
It "change: Mailboxtype functional mailbox -> personal Mailbox -->> Error" {
# 0 UserMailbox
# 1 Funktionsaccount (in Exchange: UserMailbox)
# 2 RoomMailbox
# 3 EquipmentMailbox
$upn = "fkt_$existingfunctionalmailbox"
$result = change-mailboxtype -webserviceConnection $global:ws -upn $upn -newmailboxtype 0
$result | should -Be $false
}
It "create: distribution list" {
$displayname = "Zoo"
$distributionlist = create-distributionlist -WebserviceConnection $global:ws -displayname $displayname -mailaddress $distributionlist
Loading