Looking for a way to create an automated and large number of DRS rules.

For example, I have a lot of machines named like this;

Fs001a

Fs001b

I need to create AntiAffinity rules to keep the 'a' and 'b' machines on separate hosts.

The created rule should be like "Fs001" and both machines.

New-DrsRule-development of Cluster-name Fs001 - KeepTogether $false VM - Fs001a, Fs001b

Any help/direction with powercli script that can do this would be greatly appreciated. I don't know how to handle the name match in powershell. It's something I want to run as a scheduled task to avoid human error in the rules missed or incorrect.

Try like this

Get-VM -Name *[ab] |Group-Object -Property {$_ -match "(?.*)[a|b]"; $Matches["name"]} | where {$_.Count -eq 2} | %{    New-DrsRule -Cluster Development -Name $_.Values[0][1] -KeepTogether $false -VM $_.Group}

Only when the script detects 2 identical names (one ends with one and the other with b), he creates a rule of DRS

Tags: VMware

Similar Questions

  • Looking for a way to create a dropdown menu with two sublayers

    I am looking for a solution in Fireworks CS3: create a drop down menu that will profoundly two instead of the standard depth. TOP LEVEL > SECOND FLOOR > THIRD LEVEL

    Anyone know if this is possible?

    Thank you!

    Thank you... I'll go to work.

  • Filter hit FxV question - looking for a way to create unique hit counter

    Hello

    is there a way to make a FxV unique hit counter for specific web pages?

    (1) I don't want to post multiple in the same session - as if the user click on the 'back' button and access into the page again.

    (2) Unfortunately, our web page design reuses the same name of the page - as splash.do, but has a runtime context variable.  I want to only capture charges for the first time that the splash.do is hit.  But if the user navigates to another page in the path of purchase which is also called splash.do - I don't want to count it, press.

    Thank you

    "mark".

    Mark,

    I don't know what is the best approach.  Here are two ideas to consider.

    Option 1 - create a successful filter which updates a session custom field only if the custom field is already filled.  The first time of the session, that the field is updated, the metric will update.  Then the filter hit will not be matched again for this session.

    It is an example.

    Option 2 - create a session filter.  In the filter of the session, match using a filter of success which is only splash.do.  If any session with URL/path of this updates the metric.  Session filters only updated at the end of a session, so it will match only once.  The filter of success for splash.do will have a lot of matches, but the session filter will update only once if there is a corresponding success.

    One of these give a try.

    Jeff

  • Looking for a tutorial on creating environments of texture

    Looking for different ways to create texture as the old ruff solid backgrounds and backgrounds of parchment.

    I'm trying to reproduce the method I used in Photoshop CS3, Photoshop CS5, but I forgot how do.

    Google.com - it does wonders...

  • Looking for a way to separate my libraries of different music on two separate iPods.

    Hello everyone, I'm looking for a way to separate my distinctly different music on two separate iPods. My PC has 54 GB pop/rock songs and classical music of 23 GB ones, and I want to be available only on his own iPod, an iPod for the classical music and one for non-Classical each kind. Ideally, the playlists would go with appropriate music.

    The PC is W10, iPods are the Classic models.

    What is the best way to achieve this, please?

    Grateful for ideas.

    Kind regards

    Peter

    Your library may already have a classic playlist. (See Restore Original smart playlists , if it is not.) You can expand the playlist rules, or change the properties of the tracks as required such that it contains all your classical music. You can then create a second playlist corresponding to all of the rules:

    • Playlist is music
    • Playlist is not classic

    and give it a name, for example, not classical or Rock & pop.

    Set each relevant device to sync with the playlist.

    TT2

  • I am looking for the way that my invention

    I am an inventor of VR technology. I know what may be in the future.

    I have a tech for the VR game industry.

    I am looking for the way to realize my ideas. Can you help me?

    VR is the next big thing for the past 15 years. And yet...

  • Looking for a way to programmatically set the visible front part when opens a Subvi

    I'm looking for a way to programmatically set the visible portion of the front panel, when a Subvi opens.  Did not find all the messages that are related, but I do not know how to ask the right question.  To be clear, I want to write a VI assistance programme through a list of subVIs to ensure that background images are all in the same place when to open their respective subVIs.  I hate to play manually with scroll bars before I save each of the screws...  I'm thinking I need to find the top/left of the background image location (know already do) and then to set a property of the VI FP some offset or these values, but I can't find the corresponding property. FP:run - timeposition:custom looked promising, but only affects the location of the window, and not the area of the front panel displays the window.

    I should have added that the idea of using the background image does NOT change the origin.  Therefore, always be close enough, as your controls and indicators won't move, just the image.

    I personally use the OpenG VI and the open method of front panel, when I am in your situation.

  • looking for a way to change the font color in the hotmail to chat Messenger?

    I am running windows internet explore 9 and you are looking for a way to change the color of the font in hotmail to chat Messenger, can anyone help with this. You can email me at * address email is removed from the privacy * where I am away from my computer.

    Hello
    The question you have posted is related to Windows Live and would be better suited to the Discussion Windows Live groups. Please visit the link below to find a community that will provide the support you want.
    Hotmail Portal
  • I am looking for a way to only sync music files (mp3, flac, ogg, etc) on local network.

    * Original title: synchronize files

    Hey

    I am looking for a way to only sync music files (mp3, flac, ogg, etc) on local network. The Office uses iTunes, while the laptop is using Media Go. Each adds different files in the folder of the artist.  I want to synchronize only the files of songs themselves. Sync Toy, but also collective dwelling, you cannot add a wildcard character. (e.g. *.mp3). If I sync folders, each computer has useless files. I tried other software of synchronization, but once again, after the sync preview I have to deselect all other files.  I'll sit and listen to my answer. Thanks coach

    You could 'roll' so to speak, but write a batch file.  Inside the batch file would essentially be only one command, the copy command set to copy only the *.mp3 example and ignore existing files.  Basically, SyncToy, but with filters.  The command in the command prompt you would use would be XCOPY or ROBOCOPY, which you can type followed /? to see the options (or both are well documented on the Internet).

    Always it seems to me that it would be easier to just an another artist for iTunes folder and taskbar have their own libraries than others it does not.

  • You are looking for a way to set permissions of files on a folder so that users can view and copy the files out, but may not change the original file in the folder.

    You are looking for a way to set permissions of files on a folder so that users can view and copy the files out, but may not change the original file in the folder.  They will have to copy the files in the folder to make changes and then copy a review of back in.  Locally and on the network

    Hello

    1. In Windows Explorer, right-click the file or folder you want to work with.
    2. In the context menu, select properties and then in the Properties dialog box, click the Security tab.

    3. In the name list box, select the user, contact, computer, or group to which you want to display permissions. If the permissions are grayed out, this means that the permissions are inherited from a parent object.

    https://msdn.Microsoft.com/en-us/library/bb727008.aspx?f=255&MSPPError=-2147217396

  • BlackBerry Smartphones looking for a way to cancel the encryption function

    The pictures I take with my BB 9780 "BOLD" are encypt. I'm looking for a way to cancel the operation of encryption on the new photos. Please notify.

    Try this page...

    https://swdownloads.BlackBerry.com/downloads/contactFormPreload.do?code=A8BAA56554F96369AB93E4F3BB06...

    This is the latest version.

    Tom

  • I'm looking for a way to scan my system with Windows 7 registry entries

    I'm looking for a way to scan my system registry entries. Registry audit tool (Scanreg.exe) to do back in the day, is there something similar in Windows 7?

    * original title - command line - tool of the registry in Windows 7? *

    Hello

    If you think that you are missing something you get a sense that what you're missing. Then, look for the registry.

    There are 3rd party registry cleaners that erasing entries that lead anywhere as far as I KNOW, he didn't y no utility that can guess what program can use the registry and entry is missing.

    Jack-MVP Windows Networking. WWW.EZLAN.NET

  • I am looking for a way to disable or to prevent someone to print my customer web pages, also to prevent someone from copying a page or site. Y at - it such an option in Adobe Muse?

    I am looking for a way to disable or to prevent someone to print my customer web pages, also to prevent someone from copying a page or site. Y at - it such an option in Adobe Muse?

    Hi Gary,.

    There no such function in the Muse, I don't know if it is possible at all.

    Kind regards

    Akshay

  • I'm looking for a way to blur a face for about 8 seconds of a video of 20 minutes. When I use the mosaic is bluring in the same place throughout the 20-minute video. How can I add to the 8 seconds when the face appears?  Thank you.

    I'm looking for a way to blur a face for about 8 seconds of a video of 20 minutes. When I use the mosaic, it is bluring in the same place throughout the 20-minute video. How can I add to the 8 seconds when the face appears?  Thank you.

    Razor the clip at the beginning of the second part 8 and at the end, and then apply the mosaic effect to the clip.

  • Looking for VMUG members help create our site VMUG

    All,

    I'm looking for a volunteer to create / maintain the VMUG DFW website. I've already registered and hosted on godaddy. Is there someone would be able to help to build and maintain the site? It is only 5 pages and should not need to be updated often.

    Shoot me an email if you are interested.

    Thank you

    Tony Gradig

    VMUG Leader

    [email protected]

    I am the game and I can add you to my WordPress setup you can remote admin with a variety of tools (even from iPhone or iPad). Calendar of events and other plugins already there from my other sites.

    -

Maybe you are looking for