VMware Cloud Community
mayank2007
Contributor
Contributor

how can i see vmware virtual machine Vlan id through Invoke-VMScript command.

Team,

anyone can help me here

how can i see vmware virtual machine Vlan id through Invoke-VMScript command.

Reply
0 Kudos
5 Replies
LucD
Leadership
Leadership

Which guest OS do you have running inside the VM?


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

Reply
0 Kudos
mayank2007
Contributor
Contributor

both windows and linux

Reply
0 Kudos
mayank2007
Contributor
Contributor

both windows and linux

Reply
0 Kudos
mayank2007
Contributor
Contributor

Thanks a lot LucD,

one more help is required from you.

I have multiple commands with me and now I want to combine on one script. so how its possible .. please help me

Invoke-VMScript -VM ashok-2012 -ScriptText "systeminfo" -GuestUser administrator -GuestPassword M@cr5sofT


for Date format

Invoke-VMScript -VM ashok-2012 -ScriptText "date" -GuestUser administrator -GuestPassword M@cr5sofT

for Drives

Invoke-VMScript -VM ashok-2012 -ScriptText "get-psdrive -psprovider filesystem" -GuestUser administrator -GuestPassword M@cr5sofT

for local administrator members

Invoke-VMScript -VM ashok-2012 -ScriptText "net localgroup administrators" -GuestUser administrator -GuestPassword M@cr5sofT

for vmware tool status

for VMWare tool check (this is good)
$vm = get-vm ashok-2012
$vm | select -expandproperty ExtensionData | select -expandproperty guest
$vm.ExtensionData.Guest | Select Hostname,Tools* (shortcut way to get the same information.)

Get-VM | select ashok-2012,@{N="Tools Status";E={$_.Guest.Extensiondata.ToolsVersionStatus}}

$text = Invoke-VMScript -VM ashok-2012 -ScriptText 'dir c:\' -GuestUser administrator -GuestPassword M@cr5sofT -ScriptType Bat

select -ExpandProperty ScriptOutput

$text -split "`r`n" | where{$_ -match "<DIR>"}

Reply
0 Kudos
LucD
Leadership
Leadership

Not sure what you are asking here?

You can just place all the Invoke-VMScript lines in sequence in one script.

On the VLANid, you can obtain those through tcpdump/windump.

How do you get the VLAN id now?


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

Reply
0 Kudos