CmdID / PowerShell / Cmdlets / Grant
Grant-VMConnectAccess
Grants a user or users access to connect to a virtual machine or machines. Windows Server PowerShell reference
From the Windows Server PowerShell reference 9 parameters Its page in the reference
Parameters
-CimSessionRuns the cmdlet in a remote session or on a remote computer.-ComputerNameSpecifies one or more Hyper-v hosts which run this cmdlet.-Confirm, -cfPrompts you for confirmation before running the cmdlet.-CredentialSpecifies one or more user accounts that have permission to perform this action.-PassthruIndicates that this cmdlet returns a Microsoft.HyperV.PowerShell.VMConnectAce object.-UserName, -UserId, -SidSpecifies a user or users to whom access to connect to a virtual machine or machines is to be granted.-VMIdSpecifies the unique identifier of a virtual machine to which connect access is to be granted.-VMNameSpecifies the name of a virtual machine to which connect access is to be granted.-WhatIf, -wiShows what would happen if the cmdlet runs.