CMDlets:
New-MsolUser -DisplayName 'Vivek Jain' -UserPrincipalName ******@XXX.onmicrosoft.com -UsageLocation IN
Set-MsolUserLicense -UserPrincipalName ******@XXX.onmicrosoft.com -AddLicenses XXX:ENTERPRISEPACK
Add-UnifiedGroupLinks –Identity ******@XXX.onmicrosoft.com –LinkType Members –Links ******@XXX.onmicrosoft.com
If i run all cmdlets in single run then it produces error:
Couldn't find object "*****@XXX.onmicrosoft.com". Please make sure that it was spelled correctly or specify a different object.*
+ CategoryInfo : NotSpecified: (*****@XXX.onmicrosoft.com:UnifiedGroupIdParameter) [Add-UnifiedGroupLinks], ADNoSuchObjectException*
+ FullyQualifiedErrorId : [Server=BMXPR01MB1000,RequestId=41af16db-ec3d-4824-97a7-2bea7d2ad832,TimeStamp=16-08-2018 09:23:36] [FailureCategory=Cmdlet-ADNoSuchObjectException] 1
CDFE0F2,Microsoft.Exchange.Management.RecipientTasks.AddUnifiedGroupLinks
+ PSComputerName : outlook.office365.com
some timeas error is:
WARNING: Unable to add members Vivek Jain to group object.
We failed to update the group mailbox. Please try again later.
+ CategoryInfo : NotSpecified: (:) [Add-UnifiedGroupLinks], AADException
+ FullyQualifiedErrorId : [Server=BMXPR01MB1000,RequestId=7f7ad989-d182-4532-b058-2fcc32d87bfc,TimeStamp=16-08-2018 09:01:46] [FailureCategory=Cmdlet-AADException] 8E755CFF,Mic
rosoft.Exchange.Management.RecipientTasks.AddUnifiedGroupLinks
+ PSComputerName : outlook.office365.com
If i run each cmdlets in some duration then it works fine.
i.e. Run below cmdletsNew-MsolUser -DisplayName 'Vivek Jain' -UserPrincipalName ******@XXX.onmicrosoft.com -UsageLocation IN
Set-MsolUserLicense -UserPrincipalName ******@XXX.onmicrosoft.com -AddLicenses XXX:ENTERPRISEPACK
take few minutes break then run below cmdlets
Add-UnifiedGroupLinks –Identity ******@XXX.onmicrosoft.com –LinkType Members –Links ******@XXX.onmicrosoft.com
I want to run all cmdlets in single run. Please help me.