VMware Cloud Community
rossisuchtdasgl
Contributor
Contributor
Jump to solution

vCenter PowerCLI language

Hi!

When I query the network settings of a VM I get a non-english output (Netzwerkadapter) :smileyshocked::

[vSphere PowerCLI] C:\sdk> Get-NetworkAdapter -vm vm_name

Name                 Type       NetworkName  MacAddress         WakeOnLan
                                                                  Enabled
----                 ----       -----------  ----------         ---------
Netzwerkadapter 1    e1000      Virtual M... 00:50:56:33:00:fd       True

The OS of the powerCLI is English including regional settings. Is the vCenter language responsible for the non-english output? How can I change it to english.

I do need an english output (network adapter) because a script is parsing the output.

Thank you!

Dirk

Smiley Happy

Tags (2)
Reply
0 Kudos
1 Solution

Accepted Solutions
admin
Immortal
Immortal
Jump to solution

Hi, rossisuchtdasglueck,

It seems to be the locale of the vSphere that you're seeing. Your admins will have to change that on the server if you need a different locale set.

There is a workaround you might be able to use. When the connection is initiated, you can change the server's default locale to EN-US to receive English results until your admins change the VC locale. (there was a similar problem a couple of days ago, see this thread http://communities.vmware.com/message/1995155). From that thread:

To check what your default locale when talking to the server is:

Connect-VIServer xx.xx.xx.xx

$si = get-view ServiceInstance

$sm = Get-View $si.Content.SessionManager

$sm.DefaultLocale

You can set it to en-US only immidiately after connecting (It appears that setlLocale works only when executed immediately after connect-viserver):

Connect-VIServer xx.xx.xx.xx

#don’t run any other cmdlets between the Connect-VIServer and the SetLocale below

$si = get-view ServiceInstance

$sm = Get-View $si.Content.SessionManager

$sm.SetLocale("en_US")

Hope this helps,

orainova

View solution in original post

Reply
0 Kudos
5 Replies
Troy_Clavell
Immortal
Immortal
Jump to solution

thread moved to VMware vSphere™ PowerCLI Community

LucD
Leadership
Leadership
Jump to solution

What language settings do you have on the Vcenter to which you connect ?


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

Reply
0 Kudos
RvdNieuwendijk
Leadership
Leadership
Jump to solution

Take a look at this discussion some objects properties are in current language instead of English. It will probably solve you problem.

Regards, Robert

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
admin
Immortal
Immortal
Jump to solution

Hi, rossisuchtdasglueck,

It seems to be the locale of the vSphere that you're seeing. Your admins will have to change that on the server if you need a different locale set.

There is a workaround you might be able to use. When the connection is initiated, you can change the server's default locale to EN-US to receive English results until your admins change the VC locale. (there was a similar problem a couple of days ago, see this thread http://communities.vmware.com/message/1995155). From that thread:

To check what your default locale when talking to the server is:

Connect-VIServer xx.xx.xx.xx

$si = get-view ServiceInstance

$sm = Get-View $si.Content.SessionManager

$sm.DefaultLocale

You can set it to en-US only immidiately after connecting (It appears that setlLocale works only when executed immediately after connect-viserver):

Connect-VIServer xx.xx.xx.xx

#don’t run any other cmdlets between the Connect-VIServer and the SetLocale below

$si = get-view ServiceInstance

$sm = Get-View $si.Content.SessionManager

$sm.SetLocale("en_US")

Hope this helps,

orainova

Reply
0 Kudos
rossisuchtdasgl
Contributor
Contributor
Jump to solution

Thank you very much for the quick help. Issue resolved!

Dirk

Reply
0 Kudos