PowerCLI for VM hardening 5.5

Can someone please confirm below can be used for VM hardening: - (I got it from a pole)

"Thanks for the tip, I was working on PowerCLI script filled with disa stig, hardening guide and this gave me the missing piece." Here is a summary:

"I created the following entry from DISA stig d:\vmware stig\stig_vm.txt file:
insulation. BIOS. BBS. Disable, true
insulation. Device.connectable.Disable, true
insulation. Monitor.Control.Disable, true
isolation.tools.diskShrink.disable, TRUE
isolation.tools.diskWiper.disable, TRUE
log.keepOld, 10
log.rotateSize, 100000
RemoteDisplay.maxConnections, 1
tools.guestlib.enableHostInfo, FALSE
tools.setInfo.sizeLimit, 1048576
vmci0. Unrestricted, FALSE
isolation.tools.hgfsServerSet.disable, TRUE
insulation. Device.Edit.Disable, true
isolation.tools.autoInstall.disable, TRUE
insulation. Tools.Copy.Disable, true
insulation. Tools.dnd.Disable, false
isolation.tools.setGUIOptions.enable, FALSE
insulation. Tools.Paste.Disable, true
insulation. Tools.ghi.AutoLogon.Disable, true
insulation. BIOS. BBS. Disable, true
isolation.tools.getCreds.disable, TRUE
insulation. Tools.GHI.launchMenu.change, true
isolation.tools.memSchedFakeSampleStats.disable, TRUE
isolation.Tools.ghi.protocolhandler.info.Disable, true
isolation.ghi.host.shellAction.disable, TRUE
isolation.tools.dispTopoRequest.disable, TRUE
isolation.tools.trashFolderState.disable, TRUE
insulation. Tools.ghi.trayicon.Disable, true
insulation. Tools.Unity.Disable, true
isolation.tools.unityInterlockOperation.disable, TRUE
insulation. Tools.Unity.push.Update.Disable, true
insulation. Tools.Unity.Taskbar.Disable, true
isolation.tools.unityActive.disable, TRUE
isolation.tools.unity.windowContents.disable, TRUE
isolation.tools.vmxDnDVersionGet.disable, TRUE
isolation.tools.guestDnDVersionSet.disable, TRUE
isolation.tools.vixMessage.disable, TRUE
tools.setinfo.sizeLimit, 1048576

$stig_vm = 'D:\VMWARE STIG\stig_vm.txt' import-Csv-to-head Name, Value

: APPLY TO ALL MY_VM1
{foreach ($line in $stig_vm)
New-AdvancedSetting - MY_VM1 of the entity name ($line. (Name): value ($line.value) - Force - confirm: $false | Select the entity, Name, Value
}

: APPLY TO ALL VM
{foreach ($line in $stig_vm)
Get - VM | New-AdvancedSetting - name ($line. (Name): value ($line.value) - Force - confirm: $false | Select the entity, Name, Value. Export-Csv $output
}

I tried to follow the xls published by vmware, but I don't get in for example,.

# List the virtual machines and their current settings

Get - VM | "Get-AdvancedSetting - name" isolation.tools.autoInstall.disable "|" Select the entity, Name, Value

It gives me no o/p... What does that mean?

Help, please

Thank you

I meant the VirtualMachineConfigSpec to explain what is happening behind the scenes of the cmdlet.

You can check this with Onyx.

When a specific parameter is not present, the default value will be used.

This does not mean that the default value will be displayed when you list the advanced settings.

So, the script should work.

Tags: VMware

Similar Questions

  • Cannot download - VMware vSphere PowerCLI for tenants

    Hi people,

    I'm not able to download VMware vSphere PowerCLI for the R2 version of tenants i.e. 5.1. Go to the page cannot be displayed.

    Please check.

    Kind regards

    Rajesh

    VMware vSphere PowerCLI for tenants

    Seems to work for me from this link.

    Perhaps a local cache in your browser problem, or a problem of Akamai in your area?

  • Need a powercli for bulk VM build

    I'm looking for powercli script who build virtual machines and with the configuration below.

    name, model, oscust, cluster, file, data, ip, mask, gw, dns1, dns2 store

    something similar to this link, but in my environment didn't cluster data store.

    PowerCLi simple script for batch - VMwaremine - Artur Krzywdzinski VM deployment. Nutanix

    My email is on my blog, at the top right

  • Using PowerCLI for virtual disk latencies

    Hi all

    I'm trying to get the disk reading and latencies on some virtual machines

    I'm quite a beginner on PowerCLi apart from some ships a writing utility

    I checked this thread

    http://communities.VMware.com/thread/304827

    But these counters do not work for me

    Can someone please help?

    [vSphere PowerCLI] D:\Program Files\VMware\Infrastructure\vSphere PowerCLI > $stats += Get-Stat - entity "USB-SSAPP" - Stat virtualDisk.totalWriteLatency.average
    Start $today1am. AddDays ($intStartDay) - finish $today4am. AddDays ($intEndDay)
    [vSphere PowerCLI] D:\Program Files\VMware\Infrastructure\vSphere PowerCLI > $stats

    Returns nothing,

    I created all the variables that I'm providing in the command.

    Kind regards

    P

    You might start by checking what statistical level, the period you specified is defined in vCenter.

    "Latency" needs to at least level 2 metrics.

    I guess that "USB-SSAPP" is the name of a host ESX (i)?

  • PowerCLI for all Macs on a Resource Pool

    Hey guys,.

    How do get you a list of all MAC addresses for all the virtual machines on a Pool of resources?

    I would like to get a list with the name of vm, mac and hostname address where the machine virtual running / registered.

    Thanks in advance!

    The next command PowerCLI gives a list of names, addresses MAC and all the VM host names in a resourcepool called TestPool:

    Get-ResourcePool TestPool. `

    Get - VM | `

    Select-Object - property Name,@{N="MacAdresses; E = {$_.NetworkAdapters |} ForEach-Object {$_.} MacAddress}}}, VMHost

    Best regards, Robert

  • Using PowerCLI for VM disk Stats

    First of all - it's really a message to LucD (I know from previous aid tends to prowl this forum ), just thought I'd share, as is all the useful info and any idea LucD at will without doubt be useful for all.

    Hi LucD,
    First of all - thanks for a great selection of posts on Reporting for Powershell vSphere - well worth the time and a have read for anyone.
    I'm certainly not a good PowerShell - but I was able to understand and make changes to my profit - so I thought I would share my findings and ask a few questions.
    With your script as a basis - I was able to reach the following which SHOULD let me look at all VMs in VC one statistics collect virtual disk in time for VMS different discs, (IOPS / s, Throuput and latency) I use VC 4.1 and and NFS storage attached, I believe that these statistics are OK but would have your insight on this.
    I am very pleased with the script - but he needs more tests on a valid site, rather than my region little test, but I'm sure that from a point of view 'PS' there is more efficiency to win.
    First of all - is it possible to get all the statistics at a time-, rather than to make 6 calls per VM? (I'm also sure that the ' += ' a stat the following may not be ideal)
    Also - is there a way can control the output to the CSV file, it seems to put the columns in order any, he loves and layout does not appear to be linked to the order of a group object? Can it be controlled so I can have the entries 'value' and 'unit' next to each other
    ?
    Any insight and assistance would be appreciated, and I hope that others will give it a try and let me know if it works for them too.
    Thanks again for the inspiration and the vision that made me this far
    Tony.
    ESX 4.1, VC 4.1, 2.0 options, PowerCLI 4.1.1
    # Main Variables
    $sVCentre = "IP VC.
    $sVCUser = "administrator@domain".
    $sVCPwd = "password"
    $strVMWildCard = «*»
    $strCSVName = "Stats-AvgVMDiskWriteStatsWorkingday.
    $strCSVLocation = "c:\". »
    # define the start and end times for a day's work.
    $today9am = (get-Date-time Minute 9 - 0 - 0 second)
    $today5pm = (get-Date-time Minute 17 - 0 - 0 second)
    $intStartDay = - 1
    $intEndDay = - 1
    # Begin script
    #Connect to the CR
    Connect-VIServer $sVCentre - $sVCUser of the username-password $sVCPwd - ea silentlycontinue
    $arrVMs = get - VM | WHERE-object {$_.} Name - like $strVMWildCard}
    foreach ($strVM to $arrVMs)
    {
    Write-Host "get stats for:" $strVM.Name
    Write-Host "'-Assembly of latency of writing Stats" "
    $stats += get-Stat - $strVM - Stat virtualDisk.totalWriteLatency.average entity - start $today9am. AddDays ($intStartDay) - finish $today5pm. AddDays ($intEndDay)
    Write-Host "'-bringing together reading latency statistics '"
    $stats += get-Stat - $strVM - Stat virtualDisk.totalReadLatency.average entity - start $today9am. AddDays ($intStartDay) - finish $today5pm. AddDays ($intEndDay)
    Write-Host "'-Assembly Stats ARE Ops / s reading" "
    $stats += get-Stat - $strVM - Stat virtualDisk.numberReadAveraged.average entity - start $today9am. AddDays ($intStartDay) - finish $today5pm. AddDays ($intEndDay)
    Write-Host "'-writing ARE Ops / s Collator Stats" "
    $stats += get-Stat - $strVM - Stat virtualDisk.numberWriteAveraged.average entity - start $today9am. AddDays ($intStartDay) - finish $today5pm. AddDays ($intEndDay)
    Write-Host "'-Assembly Read Throughput Stats" "
    $stats += get-Stat - $strVM - Stat virtualDisk.read.average entity - start $today9am. AddDays ($intStartDay) - finish $today5pm. AddDays ($intEndDay)
    Write-Host "'-writing flow Stats of collation" "
    $stats += get-Stat - $strVM - Stat virtualDisk.write.average entity - start $today9am. AddDays ($intStartDay) - finish $today5pm. AddDays ($intEndDay)
    Write-Host $stats.length
    # include data and gather stats on average for the day.
    } $groups = $stats | Group-object - property {$_.} Entity, $_. MetricId, $_. Instance}
    $report = $groups | % {
    New-object PSObject-property @ {}
    Description = $_. Group [0]. Description
    Entity = $_. Group [0]. Entity
    EntityId = $_. Group [0]. EntityId
    Instance = $_. Group [0]. Instance
    MetricId = $_. Group [0]. MetricId
    Timestamp = $_. Group [0]. Timestamp.Date.AddHours ($_.) Group [0]. Timestamp.Hour)
    Unit = $_. Group [0]. Unit
    Value = [math]: Round (($_.)) Group | Measure-object-propriete value - average). On average, 2)
    }
    }
    #Exporting the report to a CSV file.
    $strCSVSuffix = (get-date) m:System.NET.SocketAddress.ToString ('yyyyMMddhhmm')
    $strCSVFile = $strCSVLocation + $strCSVName + $strCSVSuffix + "_", ".csv".
    $report | Export-Csv $strCSVfile - NoTypeInformation - UseCulture

    Thank you, Tony.

    (1) Yes, you can call Get-Stat with several characteristics, the downside is that the results will be mixed and you'll need to extract the correct metric/value objects. What's even better, you can also move all the virtual machines in a single call to Get-Stat.

    (2) the Export-Csv does not specify the order of the columns in the .csv file, I'm afraid.

    The alternative is to write or build the .csv file yourself.

    Capture each line as you like it in a string, and then write that string to a file.

    This is the update script

    # Main Variables $sVCentre = "VC IP" $sVCUser = "administrator@domain" $sVCPwd = "password" $strVMWildCard = "*" $strCSVName = "Stats-AvgVMDiskWriteStatsWorkingday" $strCSVLocation = "c:\"
    $metrics = "virtualDisk.totalWriteLatency.average","virtualDisk.totalReadLatency.average",
        "virtualDisk.numberReadAveraged.average","virtualDisk.numberWriteAveraged.average",
        "virtualDisk.read.average","virtualDisk.write.average" # define the start and finish times for a working day. $today9am = (Get-Date -Hour 9 -Minute 0 -Second 0)
    $today5pm = (Get-Date -Hour 17 -Minute 0 -Second 0)
    $intStartDay = -1$intEndDay = -1## Begin Script
    
    #Connect to VCConnect-VIServer $sVCentre -User $sVCUser -Password $sVCPwd -ea silentlycontinue$arrVMs = Get-VM | where-object {$_.Name -like $strVMWildCard}
    $stats = Get-Stat -Entity $arrVMs -Stat $metrics -Start $today9am.AddDays($intStartDay) -Finish $today5pm.AddDays($intEndDay)
    # group the data and collate the stats into averages for the day.$groups = $stats | Group-Object -Property {$_.Entity, $_.MetricId, $_.Instance}
    $report = $groups | % {
        New-Object PSObject -Property @{
            Description = $_.Group[0].Description
            Entity = $_.Group[0].Entity
            EntityId = $_.Group[0].EntityId
            Instance = $_.Group[0].Instance
            MetricId = $_.Group[0].MetricId
            Timestamp = $_.Group[0].Timestamp.Date.AddHours($_.Group[0].Timestamp.Hour)
            Unit = $_.Group[0].Unit
            Value = [math]::Round(($_.Group | Measure-Object -Property Value -Average).Average, 2)
        }
    }
    #Exporting the report to a CSV file.$strCSVSuffix = (get-date).toString('yyyyMMddhhmm')
    $strCSVFile = $strCSVLocation + $strCSVName + "_" + $strCSVSuffix + ".csv"$report | Export-Csv $strCSVfile -NoTypeInformation -UseCulture
    
  • PowerCli for information of HBA Firmware

    Dear Sir

    Kindly share a PowerCLI script to find a Version of Firmware HBA Fibre Channel, Version of the driver, BIOS version and version FCODE.

    Concerning

    Rajesh

    Based on this output, it seems that you need to replace the enic and the fnic with elxnet and qlnativefc.

  • PowerCli for VEM version

    Hello

    Can you please provide me with a Cli Script of power to get the VEM version for all the ESXI host in a vCenter

    Thank you

    Hello

    Discover this - https://communities.vmware.com/thread/420231

    ~ GaneshNetworks ~.

  • PowerCLI for iometer results

    To test several SSDS and HDDs, I use Iometer in windows 2008,2012.

    As a result, iometer, you get a file, result.csv, import horrible to read and not easy to Excel, because much remains to do manual.

    Found this perl script.  Can it be rewritten in powershell?

    http://www.vmdude.fr/how-to/interpretation-des-resultats-diometer/

    Clinton has a PowerShell script to convert IOMeter results to a regular CSV file.

    See The Powershell Scripts for control and visualization data performance part 2

    In archive ps_monitor_csv_101111.zip, you will find an extract_csv_iometer.ps1 file.

  • No PowerCLI for vCenter 5.1 tags?

    I can't find a cmdlets to work with vCenter tags 5.1. I found a field on the virtual computer object:

    VMware.VimAutomation.ViCore.Impl.V1.Inventory.VirtualMachineImpl.ExtensionData.Tag

    But it is empty, even if the virtual machine has some tags on it.

    Any guidance will be appreciated!

    / ChZ

    Tags don't are currently not supported by a cmdlet.

    See also Create/Set TAGs via PowerCLI

  • PowerCli for audit information

    Hi folks can anyone help with this, I need to get the information below are virtual environment (each esxi and esx host) and was wondering if someone has a script to complete?

    Vpshere product name

    Version 4.1 etc.

    Enterprise edition etc.

    Name of the computer ESX1 etc.

    Number of cores

    Number of physical processes

    I can get the name of carrots and physics by the GET-vmhost | selection version, name, Numcpu etc, but I'm not sure there is a better way to get it?

    Also Vcentre info - information about the license if anyone can help with this.

    Thanks to all who responded.

    Hello

    regarding the licensing stuff feel free to throw a look my solution

    http://psvmware.WordPress.com/2012/08/13/get-licensereport-to-obtain-informations-regarding-licenses-within-virtual-Center/

    And for the properties that you are looking for here, you were doing ok

    Get-vmhost | {select version,name,@{n='total CPU; e = {$_.numcpu}}, @{n = 'number of sockets'; e = {$_.extensiondata.hardware.cpuinfo.numcpupackages}}

    for guests, it will choose its version, the host name, the number of cpu, the number of sockets

    The rest you will earn on top of link

    Kind regards

    Greg

  • PowerCLI for 'Not' VMs in a folder

    I am trying to retrieve a list of virtual computer with the exception of a select few names I want to accomplish this in DOES not receive the names in a certain folder.

    I tried this example:

    Get - VM | where {$_.} Name - don't (Get-Data-Center "someDataCenter" |) Get-file "SomeFolder" | Get - VM)}

    I realize that I could take the long way around and record the names of the virtual machines in a txt and then get back them with something like:

    Get - VM | where {$_.} Name - only (type c:\folder\file.txt)}

    But I want to know how logically the action the other direction.

    In addition, and this excited me was really until I completely failed him... I tried this:

    $vms = get - VM

    {Foreach ($vm to $vms)
    {Switch ($VM)}
    (Get-Datacenter "MyCenter" |) Get-file test. Get - VM) {}
    default {$exclude += $_.} Name}
    }
    }
    I tried to accomplish VMs not getting NOT another way, and I didn't want to wait to 'write' list the names of virtual machine, so I thought that I could save by default as a variable called $exclude and continue to add each VM name on it.
    What happened was that I have this long with each VM set name variable... so if I had 2 VMs named 'Test' and 'Test1', the variable $exclude would show this:
    PS C:\ > $exclude
    TestTest1
    Each individual letter would be a table element, $exclude [0] would be the letter "T" Test and not the name VM 'Test '.  Thanks for any help, and I hope that I have explained clearly.

    Maybe something like that? :

    #Omits parent folder names that match nameoffolder1 or foldername1
    Get-VM | where-object {$_.Folder -notmatch "nameoffolder1|foldername1"}
    #OR this which omits any vm w/ a parent folder matching the string nameoffolder
    Get-VM | where-object {$_.Folder -notmatch "nameoffolder"}
    

    Post edited by: Zsoldier

  • Using PowerCLI for update vROps

    Now that vROps API fully support REST and PowerShell supports the REST, how can I take a power shell script and do something like:

    • import a list of virtual machines from a CSV file
    • vROps by using components REMAINS powerShell
    • Create a custom group in vROps containing these virtual machines?

    Thank you!

    So, you can use Invoke-RESTMethod to call the REST API.  Of that, it returns a json object type that can be analyzed through ConvertFrom-JSON.  On the other hand, you should be able to use ConvertTo-JSON to create the text of the PUBLICATION using Invoke-RESTMethod command.

    I personally have not tapped into this area yet and probably won't be able to, but I used a lot of PowerShell to make interaction REST API without difficulty, this should be no different.

  • PowerCLI for 3 VMs at once.

    I'm working on a great script, and I can't wrap my head around it.  I want to get the names of some virtual machines, but I want to be able to get the VMS in groups of 3, it could be 2 or 4, I just arbitrarily chose 3.  My ultimate goal is to export the virtual machines, but I want to their section, so I'm not under a great export at the same time.

    So if I have 12 VMs, I want to get the first 3, export them, and then the next 3, export them and so on.

    I realize that it can not always be 12, or a number which divides by 3, but I see that if I use Select-Object and select - top 5 of something that has only 3, it seems to work without any errors, so I'm not too concerned in making sure that the number is divisible by a number.

    I tried something like this:

    #$MyCount was already populated with five names VM

    $CountComplete = $null

    $CountComplete = @)

    While (($Mycount | sort) - don't ($CountComplete | sort)) {}

    $MyCount |  Select - 3 first | Get-Unique

    $CountComplete += $Mycount

    }

    #$CountComplete += $Mycount

    I know the above does not work, but I wonder if this is the right way?

    Try something like this

    I placed a few numbers in the $test table, but it could be VirtualMachine objects, the logic remains the same.

    $test = 1,2,3,4,5,6,7,8,9,10

    $start = 0

    $step = 3

    While ($start - the $test. Count) {}

    Write-Output "handling $($test [$start...). ($start_+_$step_-_1)]) »

    $start += $step

    }

  • Need a script for PowerCLI for a VM under Excel report

    Hello

    Could someone help me with the creation of a script to get a regular monthly report (in the Excel file on a location of vCenter server) which includes the following data:

    VM name, size HDD, RAM allocated, quantity of CPU and 4 Custom Annotations (key and value 0-3)

    Thanks in advance!

    It is a simple tool called RVtool... use that it is just a minutes of the thing, he'll get all the necessary detial and you save what excel...

Maybe you are looking for

  • How can I import bookmarks firefox desktop for iPhone safari?

    I know that you cannot synchronize, but how do you import to iPhone safari?is there, for example, a way to bring firefox bookmarks HTML file in iPhone. and import them into safari that way? a few ideas I've included: using the dropbox app, by pluggin

  • Very slow Echoback of strikes since the last update.

    All add-ons are disabled. It is not the connection INet MS IE not having this problem.

  • Download OEM XP Home Edition?

    I have an old Sony Vaio laptop computer to five year (model PCG-7F1L) and have had some virus on it. It is therefore seriously compromised now that I want to restore the whole system, but I do not have the restore disks and the system is still the re

  • I can't update my iPhoto in El Capitan

    Im having a problem to update my iPhoto when I upgraded to El Capitan recently. Everytime I open iPhoto, he invites me to take stock of the app store. However, when I entered my AppleID user and pass, it pops up the message: "This update is not avail

  • where can I go to menu start to sign as Dell dell 4600i xp3-administrator

    I tried for a week, to connect as an administrator on my computer, dell 4600i itsa it is an old but has windows xp3, you need to know almost How to start good shape can't find it, dell said they do for me for $ 89, but still would not know how sign,