Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PowerShell CLI VMware View cmdlet创建具有权限的用户列表_Powershell_Vmware_Cmdlets - Fatal编程技术网

PowerShell CLI VMware View cmdlet创建具有权限的用户列表

PowerShell CLI VMware View cmdlet创建具有权限的用户列表,powershell,vmware,cmdlets,Powershell,Vmware,Cmdlets,我正在尝试从VMware View cmdlet获取用户和/或组及其权限的列表。到目前为止,我有这个,但我不知道如何正确使用Get-HVRightage cmdlet,我只找到了基于特定用户名的示例。我似乎根本无法显示VMware.VimAutomation.HorizonView cmdlet,即使模块正在加载,也只能显示VMware.Hv.Helper cmdlet Import-Module -Name VMware.PowerCLI Import-Module -Name VMware.

我正在尝试从VMware View cmdlet获取用户和/或组及其权限的列表。到目前为止,我有这个,但我不知道如何正确使用Get-HVRightage cmdlet,我只找到了基于特定用户名的示例。我似乎根本无法显示VMware.VimAutomation.HorizonView cmdlet,即使模块正在加载,也只能显示VMware.Hv.Helper cmdlet

Import-Module -Name VMware.PowerCLI
Import-Module -Name VMware.VimAutomation.HorizonView
Import-Module -Name VMware.VimAutomation.Core
Import-Module -Name VMware.Hv.Helper

Set-PowerCLIConfiguration -ProxyPolicy NoProxy -Confirm

Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP $false
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore
connect-hvserver servername
对于模块,请尝试:

Import-Module VMware.VimAutomation.HorizonView
Import-Module VMware.VimAutomation.Core
Import-Module -Name VMware.Hv.Helper
为了列出用户和池,您必须结合使用Get-HVPool和Get-HVAuthentication

大概是这样的:

$Connection = Connect-HVServer -Server $server -User $user -Password $Password -Domain $domain
                
                $capture = $Connection.ExtensionData
if ($capture)
{

    Get-HVPool | ForEach-Object -Process {
                $currentpool = $_
                
                $entitlements = Get-HVEntitlement -ResourceName $currentpool.Base.Name |
                
                ForEach-Object -Process {
                    
                    $_.Base.LoginName
                    
                }
                
                '' | Select @{ Name = 'Pool'; Expression = { $currentpool.Base.Name } },
                
                            @{ Name = 'Entitlement'; Expression = { $entitlements -join ',' } }
                
            }} 

PS,看看已经构建的VDIBot(exe即将推出):

您已经看到该函数的文档页面了吗?它可能包含一些关于如何更好地使用
获取权限
功能的示例: