Error when completing the service principle steps for WVD in section

%3CLINGO-SUB%20id%3D%22lingo-sub-1332580%22%20slang%3D%22en-US%22%3EError%20when%20completing%20the%20service%20principle%20steps%20for%20WVD%20in%20section%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1332580%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20I%20get%20the%20following%20error%20message%20when%20trying%20to%20%22Create%20a%20role%20assignment%20in%20Windows%20Virtual%20Desktop%22%20it%20states%20my%20tenant%20name%20is%20incorrect.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPS%20C%3A%5CWINDOWS%5Csystem32%26gt%3B%20Get-RdsTenant%3C%2FP%3E%3CP%3E%3CBR%20%2F%3ETenantGroupName%20%3A%20Default%20Tenant%20Group%3CBR%20%2F%3EAadTenantId%20%3A%20f346aa47-8272-4126-b200-92d230699ec3%3CBR%20%2F%3ETenantName%20%3A%20CloudscapetestingWVDtenant%3CBR%20%2F%3EDescription%20%3A%3CBR%20%2F%3EFriendlyName%20%3A%3CBR%20%2F%3ESsoAdfsAuthority%20%3A%3CBR%20%2F%3ESsoClientId%20%3A%3CBR%20%2F%3ESsoClientSecret%20%3A%3CBR%20%2F%3ESsoClientSecretType%20%3A%20SharedKey%3CBR%20%2F%3EAzureSubscriptionId%20%3A%20a9720ae9-8b8c-4f50-b4de-11cecb2bb5ff%3CBR%20%2F%3ELogAnalyticsWorkspaceId%20%3A%3CBR%20%2F%3ELogAnalyticsPrimaryKey%20%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EPS%20C%3A%5CWINDOWS%5Csystem32%26gt%3B%20%24myTenantName%20%3D%20CloudscapetestingWVDtenant%3CBR%20%2F%3ENew-RdsRoleAssignment%20-RoleDefinitionName%20%22RDS%20Owner%22%20-ApplicationId%20%24svcPrincipal.AppId%20-TenantName%20%24myTenantName%3CBR%20%2F%3ECloudscapetestingWVDtenant%20%3A%20The%20term%20'CloudscapetestingWVDtenant'%20is%20not%20recognized%20as%20the%20name%20of%20a%20cmdlet%2C%20function%2C%20script%20file%2C%20or%20operable%20program.%20Check%20the%20spelling%20of%20the%20name%2C%20or%20if%20a%20path%20was%20included%2C%20verify%20that%20the%20path%20is%20correct%20and%20try%3CBR%20%2F%3Eagain.%3CBR%20%2F%3EAt%20line%3A1%20char%3A17%3CBR%20%2F%3E%2B%20%24myTenantName%20%3D%20CloudscapetestingWVDtenant%3CBR%20%2F%3E%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~%3CBR%20%2F%3E%2B%20CategoryInfo%20%3A%20ObjectNotFound%3A%20(CloudscapetestingWVDtenant%3AString)%20%5B%5D%2C%20CommandNotFoundException%3CBR%20%2F%3E%2B%20FullyQualifiedErrorId%20%3A%20CommandNotFoundException%3CBR%20%2F%3E%3CBR%20%2F%3ENew-RdsRoleAssignment%20%3A%20Cannot%20bind%20argument%20to%20parameter%20'TenantName'%20because%20it%20is%20null.%3CBR%20%2F%3EAt%20line%3A2%20char%3A102%3CBR%20%2F%3E%2B%20...%20S%20Owner%22%20-ApplicationId%20%24svcPrincipal.AppId%20-TenantName%20%24myTenantName%3CBR%20%2F%3E%2B%20~~~~~~~~~~~~~%3CBR%20%2F%3E%2B%20CategoryInfo%20%3A%20InvalidData%3A%20(%3A)%20%5BNew-RdsRoleAssignment%5D%2C%20ParameterBindingValidationException%3CBR%20%2F%3E%2B%20FullyQualifiedErrorId%20%3A%20ParameterArgumentValidationErrorNullNotAllowed%2CMicrosoft.RDInfra.RDPowershell.Authorization.NewRdsRoleAssignment%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1333061%22%20slang%3D%22en-US%22%3ERe%3A%20Error%20when%20completing%20the%20service%20principle%20steps%20for%20WVD%20in%20section%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1333061%22%20slang%3D%22en-US%22%3EPut%20the%20name%20in%20quotes.%3CBR%20%2F%3E%3CBR%20%2F%3E%24myTenantName%20%3D%20'CloudscapetestingWVDtenant'%3CBR%20%2F%3E%3CBR%20%2F%3EThat%20should%20work.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1335061%22%20slang%3D%22en-US%22%3ERe%3A%20Error%20when%20completing%20the%20service%20principle%20steps%20for%20WVD%20in%20section%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1335061%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F317842%22%20target%3D%22_blank%22%3E%40FortyMegabytes%3C%2FA%3E-%20Thankyou%20that%20worked%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi I get the following error message when trying to "Create a role assignment in Windows Virtual Desktop" it states my tenant name is incorrect.

 

PS C:\WINDOWS\system32> Get-RdsTenant


TenantGroupName : Default Tenant Group
AadTenantId : f346aa47-8272-4126-b200-92d230699ec3
TenantName : CloudscapetestingWVDtenant
Description :
FriendlyName :
SsoAdfsAuthority :
SsoClientId :
SsoClientSecret :
SsoClientSecretType : SharedKey
AzureSubscriptionId : a9720ae9-8b8c-4f50-b4de-11cecb2bb5ff
LogAnalyticsWorkspaceId :
LogAnalyticsPrimaryKey :

 


PS C:\WINDOWS\system32> $myTenantName = CloudscapetestingWVDtenant
New-RdsRoleAssignment -RoleDefinitionName "RDS Owner" -ApplicationId $svcPrincipal.AppId -TenantName $myTenantName
CloudscapetestingWVDtenant : The term 'CloudscapetestingWVDtenant' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:17
+ $myTenantName = CloudscapetestingWVDtenant
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (CloudscapetestingWVDtenant:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

New-RdsRoleAssignment : Cannot bind argument to parameter 'TenantName' because it is null.
At line:2 char:102
+ ... S Owner" -ApplicationId $svcPrincipal.AppId -TenantName $myTenantName
+ ~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [New-RdsRoleAssignment], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.RDInfra.RDPowershell.Authorization.NewRdsRoleAssignment

 

Could you please help with a fix for this?

2 Replies
Put the name in quotes.

$myTenantName = 'CloudscapetestingWVDtenant'

That should work.