Bits, Bytes, & Radio Waves

A quiet journey through discovery and understanding.

Tag: PowerShell

  • Using PowerCLI in Smart Card Based Environment

    ref: https://kb.vmware.com/s/article/67789 Problem You work in a hardened environment and you don’t have an administrative username and password because you only have smart cards or tokens. Resolution According to VMware, this is expected behavior. Uh, what? Workaround According to VMware, “Use Windows SSPI to pass through the Windows logged session Smart Card credentials to PowerCLI…

  • PowerCLI Script to add vCenter Privileges for VMware Horizon 7

    ref: https://docs.vmware.com/en/VMware-Horizon-7/7.12/horizon-installation/GUID-A878F876-B359-42FC-9124-A1E34BFB3319.html ref: https://code.vmware.com/docs/11794/cmdlet-reference/doc/Get-VIPrivilege.html ref: https://code.vmware.com/docs/11794/cmdlet-reference/doc/New-VIRole.html ref: https://code.vmware.com/docs/11794/cmdlet-reference/doc/Set-VIRole.html $VIRoleName = “View Manager Role” $VIRolePrivileges = @(`     # Folder       ‘Create Folder’, ‘Delete Folder’,`     # Datastore     ‘Allocate space’,`     # Virtual Machine – Configuration     ‘Add or remove device’, ‘Advanced configuration’, ‘Modify device settings’,`     # Virtual Machine – Interaction     ‘Power off’, ‘Power on’, ‘Reset’, ‘Suspend’, ‘Perform wipe or shrink operations’,`     # Virtual Machine – Inventory     ‘Create new’, ‘Create from existing’, ‘Remove’,`     # Virtual Machine – Provisioning     ‘Customize guest’, ‘Deploy template’, ‘Read customization specifications’, ‘Clone template’, ‘Clone Virtual Machine’,`     # Resource     ‘Assign virtual machine to resource pool’,`     # Global     ‘Act as vCenter Server’,`     # Host     ‘Advanced settings’,`     # Profile-driven Storage     ‘Profile-driven storage view’, ‘Profile-driven storage update’     ) try {     # Get list of current Roles     $VIRoles = Get-VIRole     # Check if Role exists     foreach($VIRole in $VIRoles) {         if ($VIRole.Name -like $VIRoleName) {             # Role exists             exit         }      }     # Assume the Role does not exist # Create the new Role     New-VIRole -Name $VIRoleName          # Add the Privileges to the Role     foreach($VIRolePrivilege in $VIRolePrivileges) {          Set-VIRole -Role $VIRoleName -AddPrivilege $VIRolePrivilege      } } catch {     …

  • Deploy VMware Unified Access Gateway with PowerShell

    Each version of the Unified Access Gateway will also have PowerShell scripts available in a .zip file. For this post, I am using Unified Access Gateway 20.09. The components can be downloaded from https://my.vmware.com/web/vmware/downloads/info/slug/desktop_end_user_computing/vmware_unified_access_gateway/20_09. You will want to the appliance itself as well as the PowerShell scripts. For this post, I am going to use…