How to add the AD security group in each virtual machine with a name corresponding in VCenter?

Hi all

I would like to know if it is possible with VMware PowerCLI v4.1, I created the universal security group called 'Local administrators on %ComputerName%' for each server I have in UO computers by location OR separate and that he manually add members of the Local, but I want to attribute this security group in each computer virtual with the same name if possible.

Basically, it's something like this:

In the ad, here are computer objects:
DOMAIN.com/Computers/ mailserver1-VM
DOMAIN.com/Computers/ DBServer1-VM
DOMAIN.com/Computers/ ApplicationServer1-VM

In the ad's local security group objects:
DOMAIN.com/SecureProductionOU/ 'Administrator locally on mailserver1-VM'
DOMAIN.com/SecureProductionOU/ 'Local on DBServer1-VM administrator.
DOMAIN.com/SecureProductionOU/ 'Local on ApplicationServer1-VM administrator.

So I want to affect these security group in each respective name of VMS in VCenter:

VCenter01.domain.com
Datacenter1
HighPerformanceCluster1
Mailserver1-VM - Local Administrator on mailserver1-VM - role: read-only
DBServer1-VM - Local Administrator on DBServer1-VM - role: read-only
ApplicationServer1-VM - Local Administrator on ApplicationServer1-VM - role: read-only

Any kind of aid and assistance would be appreciated grgeatly.

Thank you.

Hi Albert,

I don't know what you want to check exactly, so I give 2 possible solutions.

(1) you have a fixed number of names known to virtual machines for which you want to add this permission.

$targetVM = "MailServer1-VM","DBServer1-VM","ApplicationServer1-VM"

Get-Cluster -Name HighPerformanceCluster1 | Get-VM | `    where {$targetVM -contains $_.Name} | %{    New-VIPermission -Entity $_ -Principal ("DOMAIN\Local Administrator on " + $_.Name) `       -Role (Get-VIRole -Name ReadOnly) -Confirm:$false   }

(2) you want to check for each virtual computer if the security group exist and then add the authorization.

Get-Cluster -Name HighPerformanceCluster1 | Get-VM | `    Where{Get-QADObject ("DOMAIN\Local Administrator on " + $_.Name) `        -DontUseDefaultIncludedProperties -WarningAction SilentlyContinue `        -ErrorAction SilentlyContinue -SizeLimit 1} | %{    New-VIPermission -Entity $_ -Principal ("DOMAIN\Local Administrator on " + $_.Name) `        -Role (Get-VIRole -Name ReadOnly) -Confirm:$false} 

Note that this requires the Quest AD snap-in must be installed. If you have a version without the Quest AD snap let me know.

Tags: VMware

Similar Questions

  • How to assign the ID of group for each group in the SQL query.

    Hi all

    I want to assign the ID of group for each group (group ID of series). I tried with the row_number function but did not work for my requiredment. Here is my sample data and my requirement.

    Col1
    A
    A
    A
    A
    A
    B
    C
    D
    D
    D
    D
    E
    E
    E
    F
    G
    G
    G

    I want to get number of each column with ID group assign to it value. Here is my example output

    Col1 County Group ID
    A 5 1
    A 5 1
    A 5 1
    A 5 1
    A 5 1
    B 1 2
    C 1 3
    D 4 4
    D 4 4
    D 4 4
    D 4 4
    E 3 5
    E 3 5
    E 3 5
    F 1 6
    G 3 7
    G 3 7
    G 3 7

    Select col1, count (1) NTC (col1 partition).

    ROW_NUMBER() over (partition by col1 by col1 order) tbl_test grp_id.

    Please help me solve this problem.

    SELECT

    COL1,

    COUNT (*) ON MYCOUNT (COL1 PARTITION).

    DENSE_RANK () OVER (ORDER BY COL1) GROUPID

    Of

    T1;

  • How everyone counts the total amount of GHz for virtual machines on a host-cluster?

    Hello

    I want to do some basic sizing and I may\may do not go the way to write about it.  For example, suppose I have a cluster of 4 nodes with a total of 200GHz and 1 TB of RAM on all four hosts with 100 VM.  How can I get the total amount of GHz\Memory that each virtual machine is configured with (not necessaryly to aid real-time) so that I can workout or demonstrate what fits on one or two hosts in the cluster, for example?

    Thanks for your help and advice in advance

    You can do this via the inventory tool called RVTOOL which allow you to do an inventory of all your virtual machines and hosts with the resource assigned and served. hope, it will help you.

  • How to disable the HA/DRS option on a virtual machine?

    I have a virtual machine running under VMware cluster of 8 ESXi hosts. I want HA/DRS must be disabled on this virtual machine, as well as VMware may not move this vm incase of any failure. Can someone help me on this request?

    Hello Krishna,

    Yes. You can do this in the DRS and HA game settings for each virtual machine individually in cluster settings.

    There are various tabs of options HA - VM and VM - DRS in the vSphere client.

    In the new web client, these parameters are on a tab:

    Manage->-> VM overrides settings.

    Set the DRS automation level and priority to restart HA to disabled for this virtual machine. Also choose to leave it turned on like HA host Isolaiton response.

  • How can I know which folder the files are stored in a virtual machine with PowerCli?

    Good afternoon.

    How to use PowerCLi can find the folder where the virtual machine files are stored?

    This will find info about the location of vmdk.

    Get - vm | Get-hard drive

  • How to pass the start settings in starting a virtual machine?

    How can I use PowerCLI to start a new Linux VM and the nucleus of some startup parameters?

    What would be more simple: (a) to make and use a virtual machine model, or (b) to boot from an ISO image, or (c) start with a Linux VM and the clone who?

    The basic Linux is RedHat on an ISO on the network (ISO can be on a local path running the PowerCLI script if necessary).  If a model would be easier then a diagram how to make one of my ISO would be great!

    RedHat Linux can be configured by passing parameters of the kernel startup, so kickstart configures the system, something like

    KS=/my/path/KS.cfg otherparams

    where KS.cfg says kickstart what to do.

    How to pass the start settings in the new virtual machine?

    (It is probably completely irrelevant, but I work with Xen using bash scripting and)

    $UUID = xe model vm-install = "RedHatLinux64bit."

    XE vm-param-set uuid = $UUID PV-args="ks=/my/path/ks.cfg '.

    XE-vm-beginning uuid = $UUID

    now, it must be implemented on ESX. To determine when the new VM is fuly configured, my scripts from kickstart wrote a semaphore to be detected by the bash script.)

    I know very little about ESX and PowerCLI details will be particularly useful if you please!

    Thank you!

    Enjoy your break

  • How to remove the msg: "consolidation of disks of virtual machines is necessary."

    Hi all

    I implement vSphere 5, and I have the following message displayed in the vCenter (virtual machine Summary tab). Does anyone know how to remove the message without consolidating the snapshot?
    ----------------------------------------------------
    "Consolidation of disks of virtual machines is necessary."
    ----------------------------------------------------

    I think vCenter is detect the Delta for this virtual machine and warning me that I have to consolidate the snapshot. However, I do not want to consolidate the snapshot because the database is still running when the snapshot was taken, and there is a great chance that the data will be corrupt when I consolidate this delta disk file.

    I looked towards the top of the Knowledge Base, but it does not say how to stop the message without actually consolidate the snapshot.
    ----------------------------------------------------
    Instant KB:2003638 in vSphere consolidation 5
    http://KB.VMware.com/selfservice/microsites/search.do?language=en_US & cmd = displayKC & externalId = 2003638
    ----------------------------------------------------

    Thanks for you information in advance!

    < environment >

    -VMWare vSphere 5 ESXi
    -VMWare vSphere vCenter 5
    -NetApp storage

    the message will disappear as soon as snapshots are consolidated.  There is no way to remove the message otherwise.  Just think of it as a reminder that the snapshots should be engaged.

  • How to get the status of data for each virtual [identify overprovisioning] computer store?

    Hi people,

    Could help me is it you please in the generation of report of VM and its data store location (data stocker store free space, size set up and operation). ?

    Ideally, it should be like this:

    The virtual computer name. Name of the data store. Size of the data store. Total configured data store size

    Thank you

    The following script adds the ProvisionedSpaceGB property to the output of the script of Luke:

    Get-VM | ForEach-Object {
      if ($_)
      {
        $vm = $_
        $vm | Get-Datastore | ForEach-Object {
          if ($_)
          {
            $Datastore = $_
            "" | Select-Object -Property @{N="VM name";E={$vm.Name}},
            @{N="ProvisionedSpaceGB";E={$vm.ProvisionedSpaceGB}},
            @{N="Datastore Name";E={$Datastore.Name}},
            @{N="Datastore Size (GB)";E={[Math]::Round($Datastore.CapacityMB/1KB,0)}},
            @{N="Datastore Total Provisioned size (GB)";E={[Math]::Round(($Datastore.CapacityMB-$Datastore.FreeSpaceMB)/1KB+$Datastore.ExtensionData.Summary.Uncommitted/1GB,0)}},
            @{N="Datastore Used Space (GB)";E={[Math]::Round(($Datastore.CapacityMB-$Datastore.FreeSpaceMB)/1KB,0)}}
          }
        }
      }
    }
    
  • How to get the list of files for a virtual machine?

    Hello

    Virtual machines can have their files distributed on several issues (even through several data warehouses).

    PowerCLI gives us an easy way to retrieve the data warehouse associated with a virtual (Get-data store) machine, but it doesn't seem to be a built-in method to get the list of all records where a given virtual machine stores all its files. Or maybe I'm just blind ;-)

    Can anyone offer an overview on how to achieve this?

    Thank you

    No, that sounds like a good idea to copy/back up virtual machines.

    I adapted the script. She now returns one row for each unique record

    foreach($vm in Get-VM){
      $folders = $vm.ExtensionData.LayoutEx.File | %{$_.Name.Split('/')[0]} | Sort-Object -Unique  $folders | Select @{N="VM";E={$vm.Name}},@{N="Folder";E={$_}}
    }
    
  • How to use the second network card physical to Virtual Machine?

    Two queries. We strive to VMware Server 2

    How to increase the speed of the network of the guest operating system.  Currently it shows 10 Mbps.

    If we have a second physical network adapter, is it possible to use it for the guest OS. ?

    We are noobs, please give links to this info or explain in steps.

    concerning

    Merlina.

    Welcome to the VMware forums communities.  You may be able to fix your problem by changing the type of virtual NETWORK adapter and install VMware Tools.  See this KB article - http://kb.vmware.com/kb/1002456.

    Dave

    VMware communities user moderator

    Now available - vSphere Quick Start Guide

    You have a system or a PCI with VMDirectPath?  Submit your specifications to Officieux VMDirectPath HCL.

  • How can I assign a static ip for each virtual machine

    I have the NIC 2 and 3 vm on my vm server.

    I did find documentation how to assign an ip for each virtual computer fix.

    pleas help me... but probably easy...

    Assuming you have the management and the virtual machines on the same network, attach both rising/NIC bindings to the vSwitch0, configure the management network and tie each VM to the port "VM Network" group. As DSTAVERT mentioned, the IP of the virtual machine configuration is done in the VM themselves, as if they were physical systems.

    sample:

    If you have different subnets for the management and the virtual machines, you must either create multiple vSwitches or work with the VLAN.

    André

  • Windows Mail: How to add the new contact group

    In Windows Mail my toolbar has no "New Contact Group" to click.  How can I create a new contact group, please?

    In Windows Mail my toolbar has no "New Contact Group" to click.  How can I create a new contact group, please?

    RE: New group contact button missing
     
    Open Windows Mail > click Contacts > on this Contacts window, right-click on an open space inside the window > click Customize this folder > under what kind of folder do you want? Click the pointer on the far right (there is only a single pointer here), click Contacts > OK

    Now look, you will see new Contact button group.

    t-4-2

  • How to add the user to the Group?

    HY,
    Let's say I'm new to application Express 3.2.1 :)... I searched for exmple or no matter how how to add the user in the Group (at the level of the PL/SQL application).
    I know wwv_flow_group_users Traoré is an opinion not a table. I also know thet CREATE_USER_GROUP procedure create us group, and with the CURRENT_USER_IN_GROUP function, we see if the user is in the selectet group.

    But again, my question is how to add the user to the Group?

    Thank you
    Andrej

    Published by: user10719915 on October 16, 2009 12:18 AM

    Hello

    It will be colon delimited.

    Concerning

    Paul

  • How to rename the temporary tablespace group name

    How to rename the temporary tablespace group name?  I have to remove all the temporary tablespace under the Group and then re-create the temporary tablespace again.

    EBS r12.1.1

    Database 11.0.1.7

    Please see any id doc.

    concerning

    pritesh Rodriguez

    Thanks for your update. I have solved my problem by creating a new group and add temporary tablespace to new goup.

    concerning

    pritesh Rodriguez

  • ORA-20001: unauthorized access (package for the undefined security group variable).

    I'm creating an application that uses the authentication of the APEX and characteristics (work) registration and forgot password forms (does not work).

    My I forgot the password is public (requires authentication). The user provides the user name and a secret answer, which are validated and then provides the new password. I try to use htmldb_util.reset_pw to reset the password of the user, but it does not work.

    I have a process on the new password page call a PL/SQL anonymous block that looks like this (see below), where username = P16_ITEM1 and P18_ITEM1 = new password.

    BEGIN
    apex_040000.htmldb_util.reset_pw (V ('P16_ITEM1'), V ('P18_ITEM1'));
    END;

    I don't know how to send a message of success/failure of such PL/SQL block to the APEX, but that's a separate issue, I guess.

    In any case, during the trial through SQL Developer as the user with APEX_ADMINISTRATOR_ROLE, I get the following error:

    ORA-20001: unauthorized access (package for the undefined security group variable).
    ORA-06512: at "APEX_040000.WWV_FLOW_FND_USER_API", line 22
    ORA-06512: at "APEX_040000.WWV_FLOW_FND_USER_API", line 1220
    ORA-06512: at "APEX_040000.HTMLDB_UTIL", line 1253
    ORA-06512: at line 8 level

    I've searched previous discussions and tried different suggestions with no luck.

    I'm on Oracle DB 11g XE and APEX 4.x.

    Any help will be appreciated. Thank you

    Alex.

    In any case, during the trial through SQL Developer as the user with APEX_ADMINISTRATOR_ROLE, I get the following error:

    ORA-20001: unauthorized access (package for the undefined security group variable).

    When executing code outside the Apex which depends on the security defined Apex group, perform the following steps before your own code:

    wwv_flow_api.set_security_group_id(apex_util.find_security_group_id('YOUR_SCHEMA_NAME'));
    

    Google "wwv_flow_api.set_security_group_id" for more details, like this blog:

    http://www.easyapex.com/index.php?p=502

    -Morten

    http://ORA-00001.blogspot.com

Maybe you are looking for

  • How to change pdf files

    I had a bad crash - register lost. RELOADED files but no registry. All files pdf entered into jpeg. It will be opened in Acrobat, but I can't change the default jpeg teir. How I can solve, even on a file-by-file

  • Customer complaint

    I realize that your company cares not anyone who uses your computer more - apparently Microsoft believes that the consumer will always stand, no matter how much grief they put in the lives of the people.  Windows 7 and the new office are examples of

  • BlackBerry development

    Hi guys I'm new to the development of blackberry applications. Ihad develop applications using the html5 with angular. My dough is that blackberry will accept the apk for submission?

  • Microsoft Media all-in-One keyboard, reprogramming of the 'home' button does not (wireless keyboard)

    The tone is re-programmable, using Microsoft Mouse and keyboard Center. (His new purchase, so I'm a little disappointed). So, I changed the default value of "Open Internet Explorer", the so-called "Instant Viewer". It only works intermittently.  Some

  • Impossible to use VOIPBUSTER on my PC

    I also used VOIPBUSTER on my PC / XP... Now on my new PC Windows 7 Home Premium 64bits, I can't use VOIPBUSTER... always with the intention to go online but never reach... You solved the problem with Voipbuster? Concerning