Script to convert HBA WWN lowercase and add ': '.


Hello

Is it possible to convert the output of wwn script details below to lower case and: after every two characters.

like below 10:00:00:00:c9:ab:cd:ef

script used:

Get-data center 'test ' | Get-Cluster "testcluster | Get-VMhost | Get-VMHostHBA-type FibreChannel | where {$_.} Status - eq 'on-line'} | Select @{N = 'Center'; E={$Datacenter}},@{N="cluster '; E={$cluster}},VMHost,device,status,@{N="WWN '; E = {« {0} » : x-f$ _. PortWorldWideName}} | Export-Csv C:\output.csv

I did a complete overhaul of the code.

Try it like this

$dcName = "MyDatacenter"$clusterName = "MyCluster"

$list = Get-Datacenter -Name $dcName | % {    $datacenter=$_  $datacenter | Get-Cluster -Name $clusterName | %{    $cluster = $_    Get-VMhost -Location $cluster | Get-VMHostHBA -Type FibreChannel | where {$_.Status -eq "online"} |       Select @{N="Datacenter";E={$datacenter}},        @{N="Cluster";E={$cluster}},        @{N="VMHost";E={$_.VMHost.Name}},        Device,Status,        @{N="WWN";E={((("{0:X}"-f $_.PortWorldWideName).ToLower()) -replace "(\w{2})",'$1:').TrimEnd(':')}}    }}

#Output CSV to current directory.$list | export-csv -NoTypeInformation C:\output.csv

Tags: VMware

Similar Questions

  • Please share the Script to retrieve the name of host, HBA, HBAstatus, WWN, pathpolicy and dualpathinfo

    Please share the Script to retrieve the name of host, HBA, HBAstatus, WWN, pathpolicy and dualpathinfo

    Take a look on Re: information on the host hardware with information about the HBA drivers and nic

  • Script to check how the host in the domain and add it to domain

    Hi all

    AM face to face strange question as some or little my esxi host is out and it will be difficult to connect and run to another regular activity.

    Is there a script that can check together how esxi host are out of area and another script that can add back to the domain.

    Thank you in advance for a ton

    Hello.

    This little script will check all your hosts domain name, if none it will put the hostname to out.txt file to the current folder:

    $hostnet = Get-VMHost |Get-VMHostNetwork
       $hostnet |foreach{
       if (!$_.DomainName)
        {
        $_.HostName|out-file .\out.txt
        }
    
       }
    

    Second scenario takes the output generated by the first and adds the domain name of your choice to the host. It will ask you confirmation.

    $nodomainhost = Get-Content .\out.txt
    $domain = "your.domain"
    $nodomainhost|foreach {
    Set-VMHostNetwork -HostName $_ -DomainName "$domain" -Confirm:$true
    }
    
  • Script to remove hard drives as HDD1 of VM and Add again.

    Hi, I tried to write the script to stop the virtual machine and then remove the hard drives as HDD1 and then again add back, here's my script (not yet completed)

    $vmname = testvm02

    Get-VM-name $vmname | %{

    Write-Host 'Stop of the VM' $vmname

    $vmname | Get-VMGuest | where {$_.} State - eq "Running"} | Stop-VMGuest-confirm: $false

    $HDD = get-disk hard - VM $vmname | Hard drive remove

    above script remove all disks that are attached to the VM I want not, I want to only remove that hard hard disks Disk1.

    Can someone please help me to write this script

    its been... Thanks for all the entries

    Here is the script...

    $vmname = get-Content - Path "VM.txt".

    {foreach ($VM to $Vmname)

    $getVM = get-VM-name $VM

    Write-Host 'Stop of the VM' $VM

    $getVM | Get-VMGuest | where {$_.} State - eq "Running"} | Stop-VMGuest-confirm: $false

    {}

    #Wait for the virtual machine to poweroff

    $Shutdownvm = get-VM-name $VM

    $powerstaus = $Shutdownvm.PowerState

    Write-host "pending the judgment of the $VM.

    sleep 5

    } until ($powerstaus - eq "PoweredOff")

    $HDDfile = get-disk hard - VM $VM | Where-Object {$_.} Name - not "Hard Disk 1'} | Select file name

    #$HDDpath = $HDDFile.FileName

    Write-Host "Remove the hard disks in the virtual machine" $VM

    Get-disk hard - VM $VM | Where-Object {$_.} Name - not "Hard Disk 1'} | Remove-hard drive - confirm: $false

    {foreach ($HDD to $HDDfile)

    $HDDpath = $HDD. File name

    Write-Host 'Add the disk to the VM' $VM

    New-disk-hard - VM $VM - DiskPath '$HDDpath '.

    }

    Write-Host 'starting VM' $VM

    Start-VM $getvm

    }

  • I want to add fonts in DW from my own library how to convert InDesign and add the necessary css?

    I want to add my own library fonts (less manage fonts) how to convert InDesign and add the necessary css?

    You must ensure that your font licenses extend to the internet.  Many do not.

    If you are sure that you can use your fonts on the web, use font squirrel to create a kit.

    Custom Web fonts

    Nancy O.

  • Hi I want to get an Acrobat application and SDK to convert PDF OCR, .tiff and .jpg and add wat

    Hi I want to get an Acrobat application and SDK to convert PDF OCR, .tiff and .jpg, add watermark and the reduction in size of files, all in a single product

    Yes, Acrobat Pro can do. The SDK is free t o download.

  • Script to convert CMYK PMS color

    Hi all

    I have a lot of files HAVE with thousands of objects with all the different colors in CMYK.

    Do I have to make converts them into Pantone coated full color (PMS).

    I found a free script showing equivalent pantone color of the blow link.

    10 scripts Illustrator free and extremely useful - Vectips

    And trying to change for the pantone color to apply to the selected object.

    In script, below, I added line 178 and 179 as below.

    activeDocument.selection [0].fillColor.typename = "SpotColor;
    activeDocument.selection [0] matchlist =.fillColor.color [0];

    But it doesn't change color of the object.

    Could you let me know how to do this?

    I don't know how to add a script in this forum. Please download JS code from the link below.

    https://www.dropbox.com/sh/qdxo1pi482h6yyx/AACeeo-KO6-ZPlzwfzpjZZQaa?DL=0

    I'm kind of new scripts and ask yourself how to make this work.

    If anyone can give me some advice, it would be great.

    Thank you.

    Here's a bit of a departure.

    still do not stroke.

    still can not wrong in some cases.

    He uses the book of color "PANTONE + Color Bridge Coated".

    He was loaded into the file PMS.ai

    Save the .ai file in the same directory as the script file.

    This should give you a good place to start.

    qwertyfly.com/files/scripts/PMS.zip

  • Create a script to list all the .bat and .cmd files with the dir command &

    Hello

    Im trying to create a script that will list all the .bat and .cmd files in a specific folder and add the data to a new file (file.txt) - example below:

    dir c:\>desktop\file.txt/OD
    dir d:\>>desktop\file.txt
    dir f:\jobs\*.bat>>desktop\file.txt/OD

    IM able to search the F drive and the list of all the .bat files using a generic parameter, but ideally id like to search for .bat and .cmd files, but whenever I have it try does not work. Any ideas?

    I tried the following:

    dir c:\>desktop\file.txt/OD
    dir d:\>>desktop\file.txt
    dir f:\jobs\*.bat,*.cmd>>desktop\file.txt/OD

    Any help is appreciated, the reason for which I need to check all the .bat and .cmd files is to ensure that the scripts on a cluster are all data, so need them all listed in a doc if possible

    Thank you

    Hello

    Thank you for visiting the Microsoft answers community site. Your question of Windows 7 is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for guys official script Forum. Please ask your question in the official Scripting Guys Forum.

    http://social.technet.Microsoft.com/forums/en-us/iTCG/threads

  • Create and add a message in the log off screen on a Windows 7 PC

    Original title: Log Off Message

    Hi, I was wondering if it is possible to create and add a message in the newspaper off the screen of a Windows 7 PC

    I searched and found only information on adding text in the log to the screen. This text will include the verbiage "Don't forget your USB."

    You can use a script to logoff to do, which is a file that runs automatically when the computer disconnects. http://TechNet.Microsoft.com/en-us/library/cc753583.aspx

  • Help with a script that converts the HTML object text box

    I don't know anything about programming scripts and unfortunately inDesign isn't any panel actions as Photoshop..

    I need a script to convert a text box with HTML code inside a HTML object... I think not, it should be very difficult

    How could be the following:

    (1) select the text box
    (2) cut all text inside
    (3) remove the empty box
    (4) select selection tool
    (5) go to OBJECT/INSERT HTML
    6) paste it into the code before you cut the text box
    (7) OK and close the menu INSERT HTML code

    If the Script works, we could change with HTML code inside a text box to an object HTML (video, card, animations,...)

    The first step could be manually selecting each text box or by selecting all of the boxes that start automatically by "< iFRAME '

    1000 thanks

    Remember that you can not get an answer it if you don't show any attempt of your choice.

    FWIW

    Loïc

  • PDF/A, when I have a standard PDF file and add some text to it, and then save as PDF/A, there is an error.  Any ideas?

    PDF/A, when I have a standard PDF file and add some text to it, and then save as PDF/A, there is an error.  Any ideas?

    Preflight check should give you an idea of the problem. It may be that the file must be flattened before attempting the conversion. Not all aspects of a PDF file can be converted to PDF/A.

  • Running against several VC and add these results

    Morning

    I'm pretty new on the side PoweShell of things and have been struggling for the last days of arrival in front of what I thought would be a simple script.

    We run around 9 Virtual Centres for the moment due to the large number of VDI we have. The support team have difficulty working with VC to go when they need access to the consoles.

    I created the following script to get the news have asked the team, but I'm stuck at two places.

    • I can get the script runs correctly on a single virtual circuit, but as soon as I try to run it against more it fails. The script presents unique access

    • When the script is running is it possible to add the name of the virtual server Center as a result? It was asked that teams use it as a filter field as well

    Any help on this would stop tear my hair out me and greatly appreciated

    See you soon

    James

    $server = "xxxxxx".

    $user = "xxxxxx".

    $pwd = "xxxxx".

    *

    SE connect-VIServer $server -user $user -password $pwd

    * get - vm | Select @{Name = 'Host'; Expression = {$_.} $host.name}}, name, memory, NumCpu, Description, PowerState, @{Name = "MAC"; expression = {foreach($nic_in_(__Get-View*_$_.ID).guest .net) {$nic.macAddress}}} | Export-csv c:\temp\output.csv*

    *

    Oops again, sorry

    Post edited by: hugopeeters

  • Help me remove the zeros and add the decimal point using Expression GREP

    Hello, I have a few numbers... A few thousand to be exact I need to drop some zeros and add a dollar sign and the decimal representing the cents, how can I do it using GREP Expression. An example of the number would be: 000000000396465 or 000000000044813, it will be always 15 characters, I would like that to be converted to this:

    $3964,65

    $448,13

    Thank you

    Use Adobe CS5 on Mac

    Great, it worked! You just saved me weeks of work.

    Thank you

  • Import: Copy Photos as Digital Negative (DNG) and add to the catalog

    I am importing existing (on disk) Camera RAW (.) CR2) photos in Lightroom.

    I read that it is a good idea to convert Camera RAW files to DNG, so I chose the option copy Photos as Digital Negative (DNG) and add to the catalog.  I also chose to backup the files when you import on an external drive.  DNG files that are created are copied into the new central repository on my hard drive where I keep all my photos that are managed by Lightroom.  The original. CR2 files are left where they were originally.

    I have two questions:

    1. is there a justification to keep the original. Cr2 files in the old file once I converted to DNG in the new central repository?

    2. When does the backup import Lightroom backup of the original. CR2, DNG format files on my external hard drive. Does make sense?  If the disk containing my. How can DNG photos breaks down, I use the container backup. CR2 files if Lightroom is expected to make them. DNG ones?

    Thanks for the ideas!

    acresofgreen,

    Of course, it is a matter of opinion, but once you've decided to switch to DNG, and you converted your CR2 files, I would empty the original CR2 on DVD files, I hope never to be looked at again.  Then include your DNG in a normal backup routine that includes an external hard drive on the spot and online, the off-site source as well. The backup in place when importing is not intended to save the newly created, just DNG the imported the files themselves.  In rare cases, the conversion of the DNG format has a little problem and until you have a chance to look at each image, keep the original CR2s somewhere, but not necessarily easily accessible, is logical. My backup, comments also to point 1 above.

    The f

  • I have an ipod touch 128 GB... but I'm almost to reach its maximum.  I want to do is buy a new ipod touch 128 GB and add new music without synchronizing the entire library to it... I have 2 ipods in conjunction with other copies

    I have an ipod touch 128 GB... but I'm almost to reach its maximum.

    I want to do is buy a new ipod touch 128 GB and add new music without synchronizing the entire library to it... I have 2 ipods in conjunction with the other copies of the other.

    is this possible?

    What should I do?

    Matt

    When you get the new iPod, you can use iTunes on your computer to select and synchronize the music you want on it, in the same way that you synchronize your current iPod - your iTunes will recognize them as different devices and will remember your choice of synchronization for each, it will not (unless, for example, you restore the backup of your current on her iPod) put the same content on both.

    (I asked for your post be moved to the iPod Touch forum, where you have posted is the iPad forum use.)

Maybe you are looking for

  • Should I have Norton Security for Safari?

    Should I have Norton Security for Safari?

  • Cannot control the spacing between the lines. Help!

    I'm trying to do something simple: type text in a blank document of Pages. I am writing in 14pt Baskerville, and although I have 1-line attributed to spacing, forced spacing is huge, more like a single-spaced in giant securities. Perhaps more "1/4 fu

  • Equium A100: How to increase WiFi range

    Hello I have an Equium A100 and wondering if I can increase the wi - fi range with any form of add the accessories?I have to balance my laptop on the windowsill of my apartment to pick up my more close to 'hot spot '. Any ideas?Thank you.Gus

  • To change my backup for different backup settings

    I want to know how to configure the various to back up my files. I use pentdrive, I don't want to use the cd to copy my files. I need to see where I can change this performance. I got help from certified Microsoft people and they do not solve the pro

  • theme does not appear

    before, when I'm trying to change my theme, the styLe of windows xp is an option. but after cleaning my registry using Registry Mechanic, there is only windows classic. I tried to download themes of microsoft.com, but they show no more. What should I