We need to connect 800 users to a Company and perhaps multiple Sites.
Do we really have to do this 800 times manually in 2023 ?
What about when projects have 20.000 users?
I’m sure it’s possible to do this with a database run, but considering those can be difficult in Managed Cloud (this question got directed from a ticket to Community, so there doesn’t seem to be any ready capability for this) .
Any pointers or good experiences you’ve had?
There are news that 23R1 would enable Permission Sets for SCIM users, so that takes care of that part - but Companies and Sites remain an issue.
Solved
mass-edits in Managed Cloud
Best answer by durette
You can do this kind of migration work by reverse-engineering the web service calls, whether from your web browser’s tools or from the Aurena developer console.
I wrote a working solution to your problem above here in PowerShell. It uses basic authentication against the IFSADMIN user. You can remove the Get-Projection function if you’d like.
$basic_username = 'IFSADMIN'
$basic_password = 'ifsadmin_password'
$hostname = 'ifs.example.com'
$credential_plaintext = "$($basic_username):$($basic_password)"
$credential_bytes = [System.Text.Encoding]::UTF8.GetBytes($credential_plaintext)
$credential_base64 = [Convert]::ToBase64String($credential_bytes)
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Content-Type", "application/json")
$headers.Add("Authorization", "Basic $($credential_base64)")
Function Post-Projection {
param($service_and_set, $body_hashtable)
$uri = 'https://' + $global:hostname +
'/main/ifsapplications/projection/v1/' + $service_and_set
$headers_local = $global:headers
$headers_local.Remove('If-Match') | Out-Null
$body = $body_hashtable | ConvertTo-Json -Compress
If (!$body) {
$body = '{}'
}
$method = 'POST'
$response =
Invoke-RestMethod `
-Uri $uri -Method $method -Headers $headers_local -Body $body
$response
}
Function Get-Projection {
param($service_and_set)
$uri = 'https://' + $global:hostname +
'/main/ifsapplications/projection/v1/' + $service_and_set
$headers_local = $global:headers
$headers_local.Remove('If-Match') | Out-Null
$method = 'GET'
$response =
Invoke-RestMethod `
-Uri $uri -Method $method -Headers $headers_local -Body $body
$response
}
Function Grant-UserCompany {
param($identity, $company)
$response = Post-Projection `
-service_and_set "UserHandling.svc/AddCompaniesAssistantVirtuals" `
-body_hashtable @{'Identity'=$identity}
$objkey = $response.objkey
$response = Post-Projection `
-service_and_set "UserHandling.svc/AddCompaniesAssistantVirtuals(Objkey='$($objkey)')/IfsApp.UserHandling.AddCompaniesAssistantVirtual_ApplyChanges" `
-body_hashtable @{
'Companies'="COMPANY=$($company)^IDENTITY=$($identity)^"}
$response
}
Grant-UserCompany -identity 'JDOE1' -company '123'
Grant-UserCompany -identity 'JDOE2' -company '123'
Grant-UserCompany -identity 'JDOE3' -company '123'
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.