I am using below PowerShell script to update manager attribute of guest users as their inviter.
Import-CSV C:\Users\Admin\AuditLog\AuditLogs_2022-10-14.csv | % { Set-AzureADUserManager -ObjectId $.Target1ObjectId -RefObjectId $.ActorObjectId }
Script is working and manager field is also getting updated but still its giving below error message.
Set-AzureADUserManager : Cannot bind argument to parameter 'ObjectId' because it is an empty string.
At line:1 char:101
- ... csv | % { Set-AzureADUserManager -ObjectId $_.Target1ObjectId -RefObj ...
- ~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidData: (:) [Set-AzureADUserManager], ParameterBindingValidationException
- FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.Open.AzureAD16.PowerShell.SetUserManager
Set-AzureADUserManager : Cannot bind argument to parameter 'ObjectId' because it is an empty string.
At line:1 char:101
- ... csv | % { Set-AzureADUserManager -ObjectId $_.Target1ObjectId -RefObj ...
- ~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidData: (:) [Set-AzureADUserManager], ParameterBindingValidationException
- FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.Open.AzureAD16.PowerShell.SetUserManager
Set-AzureADUserManager : Cannot bind argument to parameter 'ObjectId' because it is an empty string.
At line:1 char:101
- ... csv | % { Set-AzureADUserManager -ObjectId $_.Target1ObjectId -RefObj ...
- ~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidData: (:) [Set-AzureADUserManager], ParameterBindingValidationException
- FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.Open.AzureAD16.PowerShell.SetUserManager
Set-AzureADUserManager : Cannot bind argument to parameter 'ObjectId' because it is an empty string.
At line:1 char:101
- ... csv | % { Set-AzureADUserManager -ObjectId $_.Target1ObjectId -RefObj ...
- ~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidData: (:) [Set-AzureADUserManager], ParameterBindingValidationException
- FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.Open.AzureAD16.PowerShell.SetUserManager
Set-AzureADUserManager : Cannot bind argument to parameter 'ObjectId' because it is an empty string.
At line:1 char:101
- ... csv | % { Set-AzureADUserManager -ObjectId $_.Target1ObjectId -RefObj ...
- ~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidData: (:) [Set-AzureADUserManager], ParameterBindingValidationException
- FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.Open.AzureAD16.PowerShell.SetUserManager