Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MailADM API
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WBA
MailADM API
Commits
13411136
Commit
13411136
authored
5 years ago
by
Pätzold
Browse files
Options
Downloads
Patches
Plain Diff
AdmAPI 3.0.3
parent
bf7a2961
No related branches found
No related tags found
1 merge request
!4
AdmAPI 3.0.3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Demo/MailAdm-Doku.Tests.ps1
+67
-9
67 additions, 9 deletions
Demo/MailAdm-Doku.Tests.ps1
Demo/mailaccounts.ps1
+16
-1
16 additions, 1 deletion
Demo/mailaccounts.ps1
with
83 additions
and
10 deletions
Demo/MailAdm-Doku.Tests.ps1
+
67
−
9
View file @
13411136
# 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
Service
a
ccount>"
$password
=
"<
p
assword>"
$user
=
"<Service
A
ccount>"
# e.g. srv123456@rwth-ad.de
$password
=
"<
P
assword>"
$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
...
...
This diff is collapsed.
Click to expand it.
Demo/mailaccounts.ps1
+
16
−
1
View file @
13411136
...
...
@@ -8,6 +8,14 @@ function get-mailaccounts {
$mailaccounts
}
function
get-mailbox
{
[
CmdletBinding
()]
param
(
$webserviceconnection
,
$upn
)
$mailbox
=
$webserviceconnection
.
getMailbox
(
$upn
)
$mailbox
}
function
add-mailboxinvitation
{
[
CmdletBinding
()]
param
(
$webserviceconnection
,
$quotaPoolID
,
$primaryEMailAddress
,
$givenname
,
$Surname
,
$QuotaInMB
,
$Aliasaddresses
,
$Mailboxtype
,
$DeliverToMailBoxAndforward
,
$ForwardingEmailaddress
,
$Owner
)
...
...
@@ -66,7 +74,6 @@ function change-mailboxforwardingaddress {
$result
}
function
chaange-emailaddresses
{
}
function
change-mailboxquota
{
[
CmdletBinding
()]
...
...
@@ -146,4 +153,12 @@ function change-removesendaspermission {
$result
=
$webserviceconnection
.
RemoveSendAsPermission
(
$mailboxtochange
.
upn
,
$user
)
$result
}
function
change-mailboxtype
{
[
cmdletBinding
()]
param
(
$webserviceconnection
,
$upn
,
$newmailboxtype
)
$result
=
$webserviceconnection
.
changemailboxtype
(
$upn
,
$newmailboxtype
)
$result
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment