VMware Cloud Community
jvm2016
Hot Shot
Hot Shot
Jump to solution

vcenter configuration _powercli

Hi Luc,

is there powercli way to find vcenter  configurations.

1:whether vcenter is in linked mode

2:whether psc is embedded or external

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

For the PSC you can do this

$global:DefaultVIServer |

Select Name,

    @{N='PSC';E={

        $pscUri = Get-AdvancedSetting -Entity $_ -Name config.vpxd.sso.admin.uri | select -ExpandProperty Value

        if(([System.Uri]$_.ServiceUri).Host -eq ([System.Uri]$pscUri).Host){'Embedded'}else{'External'}

    }}

For linked mode I'm not too sure.
Have to investigate


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
5 Replies
LucD
Leadership
Leadership
Jump to solution

For the PSC you can do this

$global:DefaultVIServer |

Select Name,

    @{N='PSC';E={

        $pscUri = Get-AdvancedSetting -Entity $_ -Name config.vpxd.sso.admin.uri | select -ExpandProperty Value

        if(([System.Uri]$_.ServiceUri).Host -eq ([System.Uri]$pscUri).Host){'Embedded'}else{'External'}

    }}

For linked mode I'm not too sure.
Have to investigate


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

Thanks  Luc.

0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

hi Luc ,

i thought of adding psc value in a table along with other inventory objects using following way.

     $psc-=get-AdvancedSetting -Entity $vc -Name config.vpxd.sso.admin.uri|select -ExpandProperty value

  

   $psc_host=[system.uri]$psc

$output|Add-Member -MemberType NoteProperty -Name 'PSC type ' -Value $psc_host.host

but got following error

Cannot convert value

"https://hostname/sso-adminserver/sdk/vsphere-tch.local" to

type "System.Int32". Error: "Input string was not in a correct format."

At C:\Users\in0079d6\Desktop\Technicolor\basicinfr.ps1:52 char:6

+      $psc-=get-AdvancedSetting -Entity $vc -Name config.vpxd.sso.admi ...

+      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : InvalidArgument: (:) [], RuntimeException

    + FullyQualifiedErrorId : InvalidCastFromStringToInteger

0 Kudos
LucD
Leadership
Leadership
Jump to solution

This seems to work for me

foreach ($vc in $global:DefaultVIServers) {

  $psc = Get-AdvancedSetting -Entity $vc -Name config.vpxd.sso.admin.uri | select -ExpandProperty value

  $psc_host = ([system.uri]$psc).Host

}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

Thanks.I am checking it again .

0 Kudos