-
Notifications
You must be signed in to change notification settings - Fork 222
Expand file tree
/
Copy pathGet-SFBOnlineLisLocation.ps1
More file actions
129 lines (107 loc) · 4.21 KB
/
Copy pathGet-SFBOnlineLisLocation.ps1
File metadata and controls
129 lines (107 loc) · 4.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#Requires -Version 5.0
#Requires -Modules SkypeOnlineConnector
<#
.SYNOPSIS
Retrieve information on previously defined locations in the Location Information Service (LIS.)
.DESCRIPTION
.NOTES
This PowerShell script was developed and optimized for ScriptRunner. The use of the scripts requires ScriptRunner.
The customer or user is authorized to copy the script from the repository and use them in ScriptRunner.
The terms of use for ScriptRunner do not apply to this script. In particular, ScriptRunner Software GmbH assumes no liability for the function,
the use and the consequences of the use of this freely available script.
PowerShell is a product of Microsoft Corporation. ScriptRunner is a product of ScriptRunner Software GmbH.
© ScriptRunner Software GmbH
.COMPONENT
Requires Module SkypeOnlineConnector
Requires Library script SFBLibrary.ps1
.LINK
https://github.com/scriptrunner/ActionPacks/tree/master/O365/Skype4Business/Online
.Parameter SFBCredential
[sr-en] Credential object containing the Skype for Business user/password
.Parameter AssignmentStatus
[sr-en] Retrieved locations have been assigned to users or not
.Parameter City
[sr-en] City of the target location
.Parameter CivicAddressId
[sr-en] Identification number of the civic address that is associated with the target locations
.Parameter CountryOrRegion
[sr-en] Country or region of the target location
.Parameter Description
[sr-en] Administrator defined description of the civic address that is associated with the target locations
.Parameter Location
[sr-en] Administrator defined description of the location to retrieve
.Parameter LocationId
[sr-en] Unique identifier of the target location
.Parameter NumberOfResultsToSkip
[sr-en] Number of results to skip
.Parameter ResultSize
[sr-en] Maximum number of results to return
.Parameter ValidationStatus
[sr-en] Validation status of the addresses to be returned
#>
param(
[Parameter(Mandatory = $true)]
[PSCredential]$SFBCredential,
[ValidateSet('Assigned', 'Unassigned')]
[string]$AssignmentStatus,
[string]$City,
[string]$CivicAddressId,
[string]$CountryOrRegion,
[string]$Description,
[string]$Location,
[string]$LocationId,
[int]$NumberOfResultsToSkip,
[int]$ResultSize,
[ValidateSet('Valid', 'Invalid','Notvalidated')]
[string]$ValidationStatus
)
Import-Module SkypeOnlineConnector
try{
ConnectS4B -S4BCredential $SFBCredential
[hashtable]$cmdArgs = @{'ErrorAction' = 'Stop'
'Force' = $true
}
if([System.String]::IsNullOrWhiteSpace($AssignmentStatus) -eq $false){
$cmdArgs.Add('AssignmentStatus',$AssignmentStatus)
}
if([System.String]::IsNullOrWhiteSpace($City) -eq $false){
$cmdArgs.Add('City',$City)
}
if([System.String]::IsNullOrWhiteSpace($CivicAddressId) -eq $false){
$cmdArgs.Add('CivicAddressId',$CivicAddressId)
}
if([System.String]::IsNullOrWhiteSpace($CountryOrRegion) -eq $false){
$cmdArgs.Add('CountryOrRegion',$CountryOrRegion)
}
if([System.String]::IsNullOrWhiteSpace($Description) -eq $false){
$cmdArgs.Add('Description',$Description)
}
if([System.String]::IsNullOrWhiteSpace($Location) -eq $false){
$cmdArgs.Add('Location',$Location)
}
if([System.String]::IsNullOrWhiteSpace($LocationId) -eq $false){
$cmdArgs.Add('LocationId',$LocationId)
}
if([System.String]::IsNullOrWhiteSpace($ValidationStatus) -eq $false){
$cmdArgs.Add('ValidationStatus',$ValidationStatus)
}
if($NumberOfResultsToSkip -gt 0){
$cmdArgs.Add('NumberOfResultsToSkip',$NumberOfResultsToSkip)
}
if($ResultSize -gt 0){
$cmdArgs.Add('ResultSize',$ResultSize)
}
$result = Get-CsOnlineLisLocation @cmdArgs | Select-Object *
if($SRXEnv) {
$SRXEnv.ResultMessage = $result
}
else {
Write-Output $result
}
}
catch{
throw
}
finally{
DisconnectS4B
}