PowerShell CLI VMware View cmdlet创建具有权限的用户列表
我正在尝试从VMware View cmdlet获取用户和/或组及其权限的列表。到目前为止,我有这个,但我不知道如何正确使用Get-HVRightage cmdlet,我只找到了基于特定用户名的示例。我似乎根本无法显示VMware.VimAutomation.HorizonView cmdlet,即使模块正在加载,也只能显示VMware.Hv.Helper cmdletPowerShell 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.
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即将推出):您已经看到该函数的文档页面了吗?它可能包含一些关于如何更好地使用
获取权限
功能的示例: