Hello @Sascha Reichhardt , glad you found a workaround. From research, likely cause of this issue is in the code in the module.
Here 's a suggested workaround which uses the FileStream Param.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
I try to create a Azure Automation Runbook which updates the Profile Pictures of Guest Users.
As I can not define a File in Azure Automation (or Can I?) I want to use the -ImageByteArray Argument . But I dont find any examples of that. I dont know what the Argument expects here in which format.
# Get Azure Run As Connection Name
$connectionName = "AzureRunAsConnection"
# Get the Service Principal connection details for the Connection name
$servicePrincipalConnection = Get-AutomationConnection –Name $connectionName
# Logging in to Azure AD with Service Principal
"Logging in to Azure AD…"
Connect-AzureAD –TenantId $servicePrincipalConnection.TenantId `
–ApplicationId $servicePrincipalConnection.ApplicationId `
–CertificateThumbprint $servicePrincipalConnection.CertificateThumbprint
$Guests = Get-AzureADUser -Filter "Usertype eq 'Guest'" -All $True
ForEach ($Guest in $Guests) {
# Does a profilepic exist?
$PhotoExists = $Null
Try {$PhotoExists = Get-AzureADUserThumbnailPhoto -ObjectId $Guest.ObjectId }
Catch { # No - Update Pic with default Photo
Write-Host "Photo does not exist for" $Guest.DisplayName "- updating with default guest logo"
Set-AzureADUserThumbnailPhoto -ObjectId $Guest.ObjectId -ImageByteArray
}
}
Hello @Sascha Reichhardt , glad you found a workaround. From research, likely cause of this issue is in the code in the module.
Here 's a suggested workaround which uses the FileStream Param.
I solved with FilePath and a temp file in the Runbook.
But want to know anyway what a ImageFileArray Sample looks like