Identify the role of use

This is the question that the solution could be very useful. Is there a way to create a list of all the objects that they are actually assigned to roles in powershell? I ran the perl script in the roles of VMware VirtualCenter Management and permissions but this script displays all of the objects and the user/group and the associated role. For my environment, it took about 20 minutes to run and about 12 000 exported objects. I want to see is just assigned roles and the object that it is assigned to you, and not the child objects. I have not all objects, that objects actually assigned to a role. 12 000 objects are a lot of items to check when trying to find discreptancies. For example, if I have a role in the record of data centers, I want to see:

#RoleName # #Object awarded to # #User or group given permission to #.

Thank all in advance for the help.

There are many ways to list the inventory of the environment of VI.

You can list the 2 branches ("Hosts and Clusters" and "Virtual Machines and templates"), similar to the VI client show.

See, for example, use get-inventory to get the store of data, cluster, resourcepool, vm in hirarchy

Or you can use the list returned by the cmdlet Get-inventory.

The example script below using the cmdlet Get-inventory.

It filters the hidden folders, called 'vm' and 'host' since you can normally set permissions for these.


filter Get-Permissions{
    $report = @()
     $object = Get-View -Id $_.ID
     if($object.Name -ne "vm" -and $object.Name -ne "host"){
          $path = get-path $object
          $perms = $authMgr.RetrieveEntityPermissions($object.MoRef, $false)

          if($perms.Count -gt 0){
            foreach($perm in $perms){
              foreach($role in $authMgr.RoleList){
                      if($role.RoleId -eq $perm.RoleId){
                        $row = "" | select roleName, objName, principalName
                  $row.roleName = $role.Name
                  $row.objName = $path
                  $row.principalName = $perm.Principal
                  $report += $row
                }
               }
            }
        }
     }
     $report
}

function get-path($entity){
     $path = $entity.Name
     while($entity.Parent -ne $null){
          $entity = Get-View -Id $entity.Parent
          if($entity.Name -ne "vm" -and $entity.Name -ne "host"){
               $path = $entity.Name + "\" + $path
          }
     }
     return $path
}

$authMgr = Get-View AuthorizationManager

Get-Inventory | Get-Permissions

Note 1: the order of objects returned is the order returned by the cmdlet Get-inventory.

This can be changed by channeling the result of the Sort-Object cmdlet.


Get-Inventory | Get-Permissions | Sort-Object -property objName

Note2: the script returns not inherited permissions.

This can easily be changed by changing the 2nd parameter in the RetrieveEntityPermissions method on $true

Tags: VMware

Similar Questions

  • Identify the best CPU using multiple queries on the database environment

    Hello

    We live high CPU on one of our development servers (AIX 6/11 GR 2). It has several databases and we need check the queries that are causing hiking of the cpu.

    So, how can we specific database queries and it is when there are multiple databases?

    I could use nmon to get the process, $ query session v and v $, v$ sqlarea, if there is only one.

    Thank you!

    Hello

    There will be no direct approach (check if GRID allows to control/OEM), AWR and STATSPACK review should be best approach once and for all the DB to fix permanently, if not then...

    Identify top/topas/nmon top or 10 os process ID's, although they features will look like unless the owner is different.

    Return to the command prompt using ps - ef

    ajay@cts-db-vashi#ps -ef| egrep -i "8716444|7471138|12451978"
    oracle9i  8716444        1   0   Dec 14      - 291:51 ora_dia0_CTS
    oracle9i 12451978        1   0   Dec 14      - 62:50 ora_vktm_TBMS
     
    

    If you don't want to use top/topas/nmon use below with appropriate sort to get high cpu/memory process & pass it to v$ for more details in sqlplus

    /usr/bin/ps aux |/usr/bin/sort -nrk 3,3 | egrep -iv "root" | head -10
    

    Thank you
    Ajay more
    http://www.moreajays.com

  • predefined CSS layouts: identify the one in use and modification

    Dreamweaver CS5:

    How can you identify what predefined CSS formatting has been chosen for a page? How can we change the predefined layout that is used for a page. For example,.

    changing ' 1 fixed column, footer and header centered"to"2 column liquid, bar right side, header, and footer.

    Moving thread on the forum of Discussion General Dreameaver.

  • The duplicate files. Same file appears in different directories - how to identify the programs that use these files?

    Hello

    Question 1 - I have a list of duplicate on my computer files. Very often, the same file appears in two or more different locations. So I guess this could mean different copies of the same file is used by various programs. It would then be important to know what program is using this file prior to the removal of duplicates.

    Question 2 - it would be possible to point all programs that use a file given in one place? That is to centralize the location of a file. What I think, could eliminate the need to have different copies at different locations. If so, how is it please?

    Thank you for your help.

    The duplication that you see is the result of a bad installation program written by eSupport. It has nothing to do with Microsoft. I could do this:

    1. Rename the folder c:\eSupport in eSupport.junk
    2. Wait a week or two.
    3. If all goes well, remove the renamed folder.
  • Need to identify the designation of port COM through BACK...

    I'm editting a program that sends and receives information to a device via a USB - serial adapter. Previously, the program has been run only on one pc which always use the same COM port when the device is connected. Scripts used with this program have been written to always specify this port. After having taken the device and connected to another pc, the pc allocates another COM port - this is a relatively easy task for me to go through the device management and identify the appropriate COM port, modify the script and get the device communicates with the pc. HOWEVER, in the future, communication must be maintained between the device and a laptop with any user.

    The program you are using may open a windows command prompt and run DOS commands. If possible, I would like to help you find a way to use BACK to identify the COM port used by the USB adapter so I can assign this port number for a variable to be used in scripts, creating their infallible to any user.

    Thanks for your time,

    Chris

    Hello

    To improve assistance to this subject, you can ask your question in the MSDN forums.

    http://social.msdn.Microsoft.com/forums/en-us/categories

  • Identifying the policy of CAB

    Hello

    I'm designing Christmas cards (I know its July!) for a parent who heads a local branch of "Citizens Advice Bureau" and I need help to identify the font that uses the logo. Here is a picture of res highish logo: http://www.southwarkadvice.org.uk/images/CABlogo2.jpg

    Any ideas?

    Adam

    Frutiger 75 Black = Black of Frutiger humanist 777 black (Bitstream) is

    FreeSetBold (Paratype)

  • "this identifier apple is still used with the app store - 3times deducted from my credit card.

    I am trying to connect to the iStore, but I receive the following message: "" this identifier apple is still used with the app store.

    I following the registration process, but nothing happened just 3times deducted from my credit card...

    I filled the fields are all required and still does not work, just my credit card losing ~ $7 Dollar (2.2 dollar every time with the following msg: ITUNES ITUNES.COM/BILL.) COM READ) I don't want to spend more money for a simple registration... Thanks for help.

    They are fresh from holding temporary store, your card issuer should remove in a few days or more: on the payment card's authorization in the iTunes Store - Apple Support

    A card having a chance to be accepted it must be registered with the same name and address (including the format and spacing etc) that you have on your iTunes account and have been issued by a bank in the country where you are (and, therefore, the country that sits on your iTunes account). If it is you can check with the card issuer to see if it is them who are in decline. Or do you have another card you could try?

    Or to create a new account without giving details of the payment: create an iTunes Store account, App Store and iBooks Store without credit card or other method of payment - Apple Support

  • I bought a used iPhone 5 s to a friend, he has his iCloud account, signed at and I forgot the password, email used to iCloud is also bound to an identifier apple in any way to log out of the account without the password iCloud? iOS 9.1

    I bought a used iPhone 5 s to a friend, he has his iCloud account, signed at and I forgot the password, email used to iCloud is also bound to an identifier apple in any way to log out of the account without the password iCloud? iOS 9.1

    N °

  • How can I identify the date when the last system restore was used to roll back the pc?

    Original title: how System Restore last used

    As the title suggests, how can I identify the date when the last system restore was used to roll back the pc?

    I can remove all restore points. I've used twice now the beta off Defender & he assures me
    the pc is clean Virgin.

    I have just got rid of a Trojan dropper & a Win 32/AmmyyAdmin. -(whatever it was!)

    I now seem to have acquired Windows Powershell along the way, gawd knows where!

    He was not here a few days ago and I don't have any idea where it is!

    What is it and should I be worried?

    Thank you

    Hello

    You can check this link:

    How to restore Windows XP to a previous state

    http://support.Microsoft.com/kb/306084

  • How can I use the excpeption address in widows debugging to identify the cause?

    Hello

    I have a windows xp machine crashes randomly.

    I did a debug and wonder how I can identify the driver that is the cause using the exception address.

    Dump below:

    Microsoft (R) debugging Version of Windows 6.12.0002.633 X 86
    Copyright (c) Microsoft Corporation. All rights reserved.

    Loading dump file [E:\Mini072911-01.dmp]
    The mini kernel dump file: only registers and the trace of the stack are available

    Symbol search path is: SRV * c:\debug-symboles * http://msdl.microsoft.com/download/symbols
    Executable search path is:
    Windows XP Kernel Version 2600 (Service Pack 3) MP (2 processors) free x 86 compatible
    Product: WinNt, suite: TerminalServer SingleUserTS
    By: 2600.xpsp_sp3_gdr.101209 - 1647
    Computer name:
    Kernel base = 0x804d7000 PsLoadedModuleList = 0x8055d720
    The debugging session: 21:08:37.390 Thu Jul 28 2011 (UTC + 01:00)
    System Uptime: 1 day 11:05:14.187
    Loading the kernel symbols
    ...............................................................
    ................................................................
    .................................................
    Loading user symbols
    Loading unloaded module list
    ..................................................
    *******************************************************************************
    *                                                                             *
    * Bugcheck analysis *.
    *                                                                             *
    *******************************************************************************

    Use! analyze - v to obtain detailed debugging information.

    Bugcheck 1000007E, {c0000005, 874551ad, ba557b04, ba557800}

    Probably caused by: ntkrpamp.exe (nt! KiSwapContext + 2f)

    Follow-up: MachineOwner
    ---------

    1: kd >! analyze - v
    *******************************************************************************
    *                                                                             *
    * Bugcheck analysis *.
    *                                                                             *
    *******************************************************************************

    SYSTEM_THREAD_EXCEPTION_NOT_HANDLED_M (1000007e)
    It is a very common bugcheck.  Usually the PIN address of exception
    the driver/function that caused the problem.  Always note this address
    and the date of the picture link / driver that contains this address.
    Some common problems are the exception code 0 x 80000003.  This means a hard
    coded breakpoint or assertion was hit, but this system has been started
    / /NODEBUG.  It is not supposed to happen as developers should never have
    breakpoints coded hard in retail code, but...
    In this case, make sure a debugger must be connected and the
    system startup/DEBUG.  This will we will see why this breakpoint is
    happening.
    Arguments:
    Arg1: c0000005, the unhandled exception code
    Arg2: 874551ad, the address that the exception occurred at
    Arg3: ba557b04, address of Exception report
    Arg4: ba557800, address of the context record

    Debugging information:
    ------------------

    EXCEPTION_CODE: (NTSTATUS) 0xc0000005 - the instruction at "0 x % lx 08" referenced memory at "0 x % 08 lx. The memory could not be '%s '.

    FAULTING_IP:
    + 2f
    874551ad f3a4 MOV byte ptr rep are: [edi], byte ptr [esi]

    EXCEPTION_RECORD: ba557b04-(.exr 0xffffffffba557b04)
    ExceptionAddress: 874551ad
    ExceptionCode: c0000005 (access violation)
    ExceptionFlags: 00000000
    NumberParameters: 2
    Parameter [0]: 00000001
    Parameter [1]: 01000000
    Try to write at the address 01000000

    CONTEXT: ba557800-(.cxr 0xffffffffba557800)
    EAX = 00000000 ebx = 875677d ecx 8 = 00000200 edx = 00000000 esi = 8745bb80 edi = 01000000
    EIP = 874551ad esp = ba557bcc ebp = ba557bd4 iopl = 0 nv up ei pl nz na po nc
    CS = 0008 ss = 0010 ds = 0023're = 0023 fs = 0030 gs = 0000 efl = 00010202
    874551ad f3a4 MOV byte ptr rep are: [edi], byte ptr [esi]
    Reset the default scope

    CUSTOMER_CRASH_COUNT: 1

    DEFAULT_BUCKET_ID: DRIVER_FAULT

    Nom_processus: System

    Error_code: (NTSTATUS) 0xc0000005 - the instruction at "0 x % lx 08" referenced memory at "0 x % 08 lx. The memory could not be '%s '.

    EXCEPTION_PARAMETER1: 00000001

    EXCEPTION_PARAMETER2: 01000000

    WRITE_ADDRESS: 01000000

    FOLLOWUP_IP:
    NT! KiSwapContext + 2f
    80545a1b 8b2c24 mov ebp, dword ptr [esp]

    FAILED_INSTRUCTION_ADDRESS:
    + 2de2faf01dadfc0
    874551ad f3a4 MOV byte ptr rep are: [edi], byte ptr [esi]

    BUGCHECK_STR: 0X7E

    EXCEPTION_DOESNOT_MATCH_CODE: This indicates a hardware error.
    Instruction to 874551ad does not read/write in 01000000

    LAST_CONTROL_TRANSFER: from 87456682 to 874551ad

    STACK_TEXT:
    WARNING: Frame IP not in any known module. Sequence of images may be wrong.
    ba557bd4 87456682 01000000 00000000 00000010 0x874551ad
    ba557c00 804ef19f 8ad2dd98 87567768 8ad2dd98 0 x 87456682
    ba557c30 80545a1b ba557c88 00000000 00000000 nt! IopfCallDriver + 0 x 31
    ba557c34 ba557c88 00000000 00000000 00000000 nt! KiSwapContext + 0x2f
    00000000 00000000 00000000 00000000 00000000 0xba557c88

    SYMBOL_STACK_INDEX: 3

    SYMBOL_NAME: nt! KiSwapContext + 2f

    FOLLOWUP_NAME: MachineOwner

    MODULE_NAME: nt

    Nom_image: ntkrpamp.exe

    DEBUG_FLR_IMAGE_TIMESTAMP: 4d00d46f

    STACK_COMMAND: .cxr 0xffffffffba557800; Ko

    FAILURE_BUCKET_ID: 0x7E_CODE_ADDRESS_MISMATCH_BAD_IP_nt! KiSwapContext + 2f

    BUCKET_ID: 0x7E_CODE_ADDRESS_MISMATCH_BAD_IP_nt! KiSwapContext + 2f

    Follow-up: MachineOwner

    See you soon

    KeV

    Hi Kev,

    The issue of Windows XP, you have posted is related to Windows XP in a domain environment. It is better suited for the IT Pro TechNet public. Please ask your question in the TechNet forums for assistance.

    Hope the helps of information.

  • How can I identify the name of the invisible file for a backup file successfully to an external hard drive USB2 separate? I use Windows Vista backup program (Service Pack 2),

    How can I identify the name of the invisible file for a backup file successfully to an external hard drive USB2 separate?  I use Windows Vista backup program (Service Pack 2), and I need to do backups plus two from other computers on the same external hard drive.  To do this, I think I would need to identify each backup file separate I know which file to specify if I need to do a restore.

    How can I accomplish this? The program does not seem to give me the ability to specify a file to which to write the backup during a given session files.  In addition, I do not understand why I can not see the file name in Windows Explorer - my files options are defined to be able to view hidden and system.  Would be grateful for any help you can provide, tonight if possible.   Best regards, Oliver for Norm

    Hello

    See this link:

    http://Windows.Microsoft.com/en-us/Windows-Vista/back-up-and-restore-frequently-asked-questions

    http://Windows.Microsoft.com/en-us/Windows-Vista/set-up-or-change-automatic-backup-settings

    http://Windows.Microsoft.com/en-us/Windows-Vista/back-up-your-programs-system-settings-and-files

  • Using the loopback address to identify the IPsec peer

    I have two IOS routers and you want to use the loopback address on the remote router as address such peer recommended in documents such as "Configuration with EIGRP and IPX using GRE Tunneling IPSec."

    On the local router, I identify the remote router via its address and loopback on the remote router, I configure crypto MYMAP map interface S0/0 and BRI1/0 (with nothing configured on the other than the IP address loopback interface)

    When I establish an IPsec tunnel from the remote router, it uses the interface S0/0 as its source address.

    I tried to configure card crypto MYMAP on loopback0 instead of BRI1/0 and S0/0, but it did not work.

    How can I get the remote router to use as source address loopback address?

    Thanks in advance for any help offered.

    Try to use the "crypto-loopback address 0.

    -Dembélé

  • How to identify the siebel custom index created from DB without using siebel tools

    Dear Experts,

    Please let us know how to identify siebel custom indexes that are created directly through DB. We don't are not sure on the customer tables had created indexes.

    Thank you

    Carine Ch

    Hello carine,.

    Thank you for using Oracle communities.

    Custom indexes created without using Siebel tools are not included in the schema definition in the Siebel Repository.

    Just for your information, these indexes are deleted during the upgrade of database. In order to preserve these indexes, add them to the repository Siebel using Siebel Tools.

    Now come to your query you have utility DBCHCK.

    DBCHCK is that Siebel provided utility to compare the logical schema in the Siebel Repository against objects in the physical Oracle database.

    DBCHCK must be run regularly to check the status of the Siebel business, especially after a release.

    DBCHCK can be useful to identify custom index added by the development team, but not added to the repository using Siebel tools.

    You can run it from a server in the environment. A performance by connection to the base. This should be run from the folder siebsrvr

    You can get more information from document following knowledge.

    How the Dictutl and the dbchck to run? (Doc ID 475677.1)

    I hope it helps.

    Best regards

    Chetan

    P.S. If one of the answers was correct or useful, it would be great if you can mark as appropriate help the other identified correctly updated.

  • How to identify the fonts used in text format?

    How to identify the fonts used in text format?

    Hi DSB.

    Open the document in Reader, go to the menu file-> properties, then click on the tag are. You will see a list of the fonts used in the document.

    Another option is to copy the text and paste it into MS Word, where you can simply move your mouse over the text to display the name of the font.

    Kind regards

    Nicos

  • How to identify the Protocol of network storage using PowerCli

    Hi all

    Does anyone know how to identify the network storage protocol using Powercli? If you do could you please point me in the right direction and appropriate controls to be used.

    Thank you.

    See you soon

    With the Get-EsxCli cmdlet, you get to many of the features esxcli.

    Something like that

    $esxcli = Get-EsxCli -VMHost MyEsx$esxcli.storage.core.path.list()
    

    You can use Select-Object to choose the specific properties of the returned objects.

    For example

    $esxcli = Get-EsxCli -VMHost MyEsx$esxcli.storage.core.path.list() | Select RuntimeName,Transport
    

Maybe you are looking for

  • Recently several sites showed some bold words, and when the cursor is hovered over them, an ad appears. Is this a problem of Firefox and I

    On several sites, including the BBC, copy appears with the words highlighted. By moving the cursor over them reveals an ad related to the word. This seems to have started a couple of weeks

  • All of the updates fail.

    All of my updates important keep neglect and are now for about a year. Tried most things to solve this problem, any ideas? Maybe reformat? right, here is some information. Windows vista Home premium sp2 32-bit sys. last successful update installed wa

  • My CPU is overheating?

    I have a HP Pavilion g6 with AMD APU A10 - 4600M. Since one of my previous laptops is dead after 2-3 years due to the overheating, I was check Core Temp on my new laptop computer. Well, it says 100 TJMax and time light more than 90 on the more demand

  • Presario CQ60-211dx - upgrade CPU T3400; Update Flash?

    I have a Compaq Presario CQ60-211DX, that has a CPU Intel 585. After reading the forum, I bought a CPU T3400 as an upgrade. Do I need to Flash the BIOS? It is currently updated for the 585, but it will be different for theT3400? If so, I flash before

  • HP Office jet 6000: HP Office Jet 6000 used print

    Hi, I hope someone can help. I have a HP office Jet 6000 which is wired cable to my laptop. There was a problem when printing to the printer used documents. Laptop is running Windows 7 32 bit I tried the following: 1: replace the cable 2: serve all d