You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# The directory tenant identifier of Azure Stack Administrator.
13
+
# The directory tenant identifier of Azure Stack.
18
14
[Parameter(Mandatory=$true)]
19
15
[ValidateNotNullOrEmpty()]
20
-
[string] $AzsAdminDirectoryTenantId,
16
+
[string] $AzsDirectoryTenantId,
21
17
22
18
# The Azure Stack ARM endpoint URI.
23
19
[Parameter(Mandatory=$true)]
24
20
[ValidateNotNullOrEmpty()]
25
-
[Uri] $AzsAdminArmEndpoint,
21
+
[Uri] $AzsArmEndpoint,
26
22
27
-
# The user principal name of the account who's user data should be cleared.
28
-
[Parameter(Mandatory=$true)]
29
-
[ValidateNotNullOrEmpty()]
30
-
[string] $UserPrincipalName,
23
+
# Optional: A credential used to authenticate with Azure Stack. Must support a non-interactive authentication flow. If not provided, the script will prompt for user credentials.
24
+
[pscredential] $AutomationCredential=$null,
31
25
32
-
# Optional: The directory tenant identifier of account who's user data should be cleared.
33
-
# If it is not specified, it will delete all the
34
-
[Parameter(Mandatory=$false)]
35
26
[ValidateNotNullOrEmpty()]
36
-
[string] $DirectoryTenantId,
37
-
38
-
# Optional: A credential used to authenticate with Azure Stack. Must support a non-interactive authentication flow. If not provided, the script will prompt for user credentials.
# The directory tenant identifier of Azure Stack Administrator.
98
+
[Parameter(Mandatory=$true)]
99
+
[ValidateNotNullOrEmpty()]
100
+
[string] $AzsAdminDirectoryTenantId,
101
+
102
+
# The Azure Stack ARM endpoint URI.
103
+
[Parameter(Mandatory=$true)]
104
+
[ValidateNotNullOrEmpty()]
105
+
[Uri] $AzsAdminArmEndpoint,
106
+
107
+
# The user principal name of the account whoes user data should be cleared.
108
+
[Parameter(Mandatory=$true)]
109
+
[ValidateNotNullOrEmpty()]
110
+
[string] $UserPrincipalName,
111
+
112
+
# Optional: The directory tenant identifier of account whoes user data should be cleared.
113
+
# If it is not specified, it will delete user with principal name under all regitered directory tenants
114
+
[Parameter(Mandatory=$false)]
115
+
[ValidateNotNullOrEmpty()]
116
+
[string] $DirectoryTenantId,
117
+
118
+
# Optional: A credential used to authenticate with Azure Stack. Must support a non-interactive authentication flow. If not provided, the script will prompt for user credentials.
# The directory tenant identifier of Azure Stack Administrator.
149
+
[Parameter(Mandatory=$true)]
150
+
[ValidateNotNullOrEmpty()]
151
+
[string] $AzsAdminDirectoryTenantId,
152
+
153
+
# The Azure Stack ARM endpoint URI.
154
+
[Parameter(Mandatory=$true)]
155
+
[ValidateNotNullOrEmpty()]
156
+
[Uri] $AzsAdminArmEndpoint,
157
+
158
+
# The user principal name of the account whoes user data should be cleared.
159
+
[Parameter(Mandatory=$true)]
160
+
[ValidateNotNullOrEmpty()]
161
+
[string] $UserPrincipalName,
162
+
163
+
# Optional: The directory tenant identifier of account whoes user data should be cleared.
164
+
# If it is not specified, it will delete user with principal name under all regitered directory tenants
165
+
[Parameter(Mandatory=$false)]
166
+
[ValidateNotNullOrEmpty()]
167
+
[string] $DirectoryTenantId,
168
+
169
+
# Optional: A credential used to authenticate with Azure Stack. Must support a non-interactive authentication flow. If not provided, the script will prompt for user credentials.
Write-Verbose"Retrieved user object as $(ConvertTo-JSON$usersResponse.value)"-Verbose
127
208
128
209
$userObjectId=$usersResponse.value.objectId
@@ -150,10 +231,9 @@ function Clear-AzsUserData
150
231
else
151
232
{
152
233
$params=@{
153
-
AccessToken=$accessToken
234
+
AccessToken=$script:adminArmAccessToken
154
235
UserObjectId=$userObjectId
155
236
DirectoryTenantId=$dirId
156
-
AdminSubscriptionId=$adminSubscriptionId
157
237
AzsAdminArmEndpoint=$AzsAdminArmEndpoint
158
238
}
159
239
$curResult=Clear-SinglePortalUserData@params
@@ -164,6 +244,101 @@ function Clear-AzsUserData
164
244
return$clearUserDataResult
165
245
}
166
246
247
+
<#
248
+
.Synopsis
249
+
Clear the portal user data
250
+
#>
251
+
functionClear-AzsUserDataWithUserObjectId
252
+
{
253
+
param
254
+
(
255
+
# The directory tenant identifier of Azure Stack Administrator.
256
+
[Parameter(Mandatory=$true)]
257
+
[ValidateNotNullOrEmpty()]
258
+
[string] $AzsAdminDirectoryTenantId,
259
+
260
+
# The Azure Stack ARM endpoint URI.
261
+
[Parameter(Mandatory=$true)]
262
+
[ValidateNotNullOrEmpty()]
263
+
[Uri] $AzsAdminArmEndpoint,
264
+
265
+
# The user object Id of the account whoes user data should be cleared.
266
+
[Parameter(Mandatory=$true)]
267
+
[ValidateNotNullOrEmpty()]
268
+
[string] $UserObjectId,
269
+
270
+
# The directory tenant identifier of account whoes user data should be cleared.
271
+
[Parameter(Mandatory=$true)]
272
+
[ValidateNotNullOrEmpty()]
273
+
[string] $DirectoryTenantId,
274
+
275
+
# Optional: A credential used to authenticate with Azure Stack. Must support a non-interactive authentication flow. If not provided, the script will prompt for user credentials.
# The user principal name of the account whoes user data should be cleared.
314
+
[Parameter(Mandatory=$true)]
315
+
[ValidateNotNullOrEmpty()]
316
+
[string] $UserPrincipalName,
317
+
318
+
# Optional: A credential used to authenticate with Azure Stack. Must support a non-interactive authentication flow. If not provided, the script will prompt for user credentials.
0 commit comments