Use powershell to get synthetic fcp "target" port wwpn

Hello,
I am trying to query my virtual fcp target ports to get status and wwpn from within my VM for SAN automation.
I have exhausted my searches only to find information/commands to use from the parent.
PS C:\> $StorageSubsystem = Get-StorageSubsystem
PS C:\> Get-Targetport -StorageSubsystem $StorageSubsystem
PS C:\>
PS C:\>
PS C:\>
I have found these:
https://gallery.technet.microsoft.com/scriptcenter/Find-HBA-and-WWPN-53121140
one liner:
Get-WmiObject -class MSFC_FibrePortHBAAttributes -namespace "root\WMI" | Select -Expandproperty Attributes | % { ($_.PortWWN | % {"{0:x2}" -f $_}) -join ":"}
All gives me my initiator WWNN/WWPN.
I would like to get my discovered Target ports from within my VM. If anyone can point me in the right direction or has an example, I would greatly appreciate it.

Hello,
I am trying to query my virtual fcp target ports to get status and wwpn from within my VM for SAN automation.
I have exhausted my searches only to find information/commands to use from the parent.
PS C:\> $StorageSubsystem = Get-StorageSubsystem
PS C:\> Get-Targetport -StorageSubsystem $StorageSubsystem
PS C:\>
PS C:\>
PS C:\>
I have found these:
https://gallery.technet.microsoft.com/scriptcenter/Find-HBA-and-WWPN-53121140
one liner:
Get-WmiObject -class MSFC_FibrePortHBAAttributes -namespace "root\WMI" | Select -Expandproperty Attributes | % { ($_.PortWWN | % {"{0:x2}" -f $_}) -join ":"}
All gives me my initiator WWNN/WWPN.
I would like to get my discovered Target ports from within my VM. If anyone can point me in the right direction or has an example, I would greatly appreciate it.

Similar Messages

  • Using Powershell to get current permissions of folders/sub-folders and files

    Hi Team
    Need assistance here.
    Need a powershell script to get and list current AD groups and users having permissions to folders/its subfolders and files
    Cheers

    Hello,
    The TechNet Wiki Discussion Forum is a place for the TechNet Wiki Community to engage, question, organize, debate, help, influence and foster the TechNet Wiki content, platform and Community.
    Please note that this forum exists to discuss TechNet Wiki as a technology/application.
    As it's off-topic here, I am moving the question to the
    Where is the forum for... forum.
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • How to get Workflow details from workflowinstance ID using PowerShell

    Greetings
    I would like to know if there is a quick PowerShell command that I can run that returns details (eg, name, title, etc) associated with a workflow instance ID presented in an error message.  I would like to be able to do this to assist with troubleshooting
    2010 and 2013 workflow operation.  This would be beneficial in a situation where error messages are filling the Workflo Operations log, and these messages only present a workflowinstance ID and nothing else.  If I could could quickly use PowerShell
    to get details associated with that workflowinstance, it would greatly simplify troubleshooting, as I could more rapidly identify what running instance and list the workflow is associated with.
    Steve
    General

    Hi Stephan,
    According to your description, my understanding is that you want to list the running workflow instances in SharePoint 2013 On-premise.
    You can use PowerShell commands with SPWorkflowState enumeration to classify the workflow instances.
    More information:
    http://www.codeproject.com/Articles/679628/Easiest-Way-of-Cancelling-All-S
    http://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.workflow.spworkflowstate(v=office.15).aspx
    Best Regards,
    Wendy
    Wendy Li
    TechNet Community Support

  • How to get Document Set property values in a SharePoint library in to a CSV file using Powershell

    Hi,
    How to get Document Set property values in a SharePoint library into a CSV file using Powershell?
    Any help would be greatly appreciated.
    Thank you.
    AA.

    Hi,
    According to your description, my understanding is that you want to you want to get document set property value in a SharePoint library and then export into a CSV file using PowerShell.
    I suggest you can get the document sets properties like the PowerShell Command below:
    [system.reflection.assembly]::loadwithpartialname("microsoft.sharepoint")
    $siteurl="http://sp2013sps/sites/test"
    $listname="Documents"
    $mysite=new-object microsoft.sharepoint.spsite($siteurl)
    $myweb=$mysite.openweb()
    $list=$myweb.lists[$listname]
    foreach($item in $list.items)
    if($item.contenttype.name -eq "Document Set")
    if($item.folder.itemcount -eq 0)
    write-host $item.title
    Then you can use Export-Csv PowerShell Command to export to a CSV file.
    More information:
    Powershell for document sets
    How to export data to CSV in PowerShell?
    Using the Export-Csv Cmdlet
    Thanks
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to get Systemstate Backup size using PowerShell command in Windows 2008 R2

    Hi,
    We using WBSummary command to get completed backup status.
    I need to find how much data is backed up  using powerShell command .
    Is there any way to get the details , i can see the GUI but no in command.
    Please advise
    Regards Gopi K

    Hi,
    You mentioned that you can see the system state backup size in the GUI. Does the backup size mean the amount of date transferred?
    It seems that there is no such a PowerShell to get Systemstate Backup size. You may need to you need a PowerShell scripts to do this work.
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=ITCG
    Regards,
    Mandy
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • How to get DocSet property values in a SharePoint library into a CSV file using Powershell

    Hi,
    How to get DocSet property values in a SharePoint library into a CSV file using Powershell?
    Any help would be greatly appreciated.
    Thank you.
    AA.

    Hi AOK,
    Would you please post your current script and the issue for more effcient support.
    In addition, to manage document set in sharepoint please refer to this script to start:
    ### Load SharePoint SnapIn
    2.if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null)
    3.{
    4. Add-PSSnapin Microsoft.SharePoint.PowerShell
    5.}
    6.### Load SharePoint Object Model
    7.[System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SharePoint”)
    8.
    9.### Get web and list
    10.$web = Get-SPWeb http://myweb
    11.$list = $web.Lists["List with Document Sets"]
    12.
    13.### Get Document Set Content Type from list
    14.$cType = $list.ContentTypes["Document Set Content Type Name"]
    15.
    16.### Create Document Set Properties Hashtable
    17.[Hashtable]$docsetProperties = @{"DocumentSetDescription"="A Document Set"}
    18.$docsetProperties = @{"CustomColumn1"="Value 1"}
    19.$docsetProperties = @{"CustomColum2"="Value2"}
    20. ### Add all your Columns for your Document Set
    21.
    22.### Create new Document Set
    23.$newDocumentSet = [Microsoft.Office.DocumentManagement.DocumentSets.DocumentSet]::Create($list.RootFolder,"Document Set Title",$cType.Id,$docsetProperties)
    24.$web.Dispose()
    http://www.letssharepoint.com/2011/06/document-sets-und-powershell.html
    If there is anything else regarding this issue, please feel free to post back.
    Best Regards,
    Anna Wang
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • How to get information about cluster disk using powershell

    Hi
    How can I list all cluster disks in my Hyper-V cluster using Powershell? I see two cluster disk "Cluster Disk 1" and "Cluster Disk 1" in my cluster management console but I would like to see them using powershell.
    Kind Regards Tomasz

    http://tinyurl.com/mfro3q5
    Get-ClusterResource
    Get-ClusterQuorum
    Get-ClusterSharedVolume
    . : | : . : | : . tim

  • How can I get a list of OOB Site from a SharePoint WebApplication using Powershell Script

    Hi,
    Could anybody help on this?
    Thanks,
    Srabon
    srabon

    You can include the WebTemplate parameter in the select, from that you will get the template ID for all sites.
    I am sure you know the custom template IDs then just filter / use if else to get the desired results.
    check this blog, track inventory session.
    http://sharepointpromag.com/sharepoint-2010/inventorying-sharepoint-using-powershell
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • I have recently update to the OS Maverik and I use a projector with a mini display port adaptor to my MacBook Air, ever since the only thing that projects is my desktop picture.  I cannot get it to project my school work that I need to teach my students.

    I have recently update to the OS Maverik and I use a projector with a mini display port adaptor to my MacBook Air, ever since the only thing that projects is my desktop picture.  I cannot get it to project my school work that I need to teach my students. Help!

    Hi Becki514,
    Welcome to the Support Communities!
    The following articles may help you with your projector issue:
    Apple computers: Troubleshooting issues with video on internal or external displays
    http://support.apple.com/kb/ht1573
    Apple Mini DisplayPort adapters: Frequently asked questions (FAQ)
    http://support.apple.com/kb/ht3382
    Mac notebooks: How to use your computer in closed clamshell (display closed) mode with an external display
    http://support.apple.com/kb/ht3131
    I hope this information helps ....
    Have a great day!
    - Judy

  • Is there a way to get long running SQL Agent jobs information using powershell?

    Hi All,
    Is there a way to get long running SQL Agent jobs information using powershell for multiple SQL servers in the environment?
    Thanks in Advance.
    --Hunt

    I'm running SQL's to fetch the required details and store it in centralized table. 
    foreach ($svr in get-content "f:\PowerSQL\Input\LongRunningJobsPowerSQLServers.txt"){
    $dt = new-object "System.Data.DataTable"
    $cn = new-object System.Data.SqlClient.SqlConnection "server=$svr;database=master;Integrated Security=sspi"
    $cn.Open()
    $sql = $cn.CreateCommand()
    $sql.CommandText = "SELECT
    @@SERVERNAME servername,
    j.job_id AS 'JobId',
    name AS 'JobName',
    max(start_execution_date) AS 'StartTime',
    max(stop_execution_date)AS 'StopTime',
    max(avgruntimeonsucceed),
    max(DATEDIFF(s,start_execution_date,GETDATE())) AS 'CurrentRunTime',
    max(CASE WHEN stop_execution_date IS NULL THEN
    DATEDIFF(ss,start_execution_date,stop_execution_date) ELSE 0 END) 'ActualRunTime',
    max(CASE
    WHEN stop_execution_date IS NULL THEN 'JobRunning'
    WHEN DATEDIFF(ss,start_execution_date,stop_execution_date)
    > (AvgRunTimeOnSucceed + AvgRunTimeOnSucceed * .05) THEN 'LongRunning-History'
    ELSE 'NormalRunning-History'
    END) 'JobRun',
    max(CASE
    WHEN stop_execution_date IS NULL THEN
    CASE WHEN DATEDIFF(ss,start_execution_date,GETDATE())
    > (AvgRunTimeOnSucceed + AvgRunTimeOnSucceed * .05) THEN 'LongRunning-NOW'
    ELSE 'NormalRunning-NOW'
    END
    ELSE 'JobAlreadyDone'
    END)AS 'JobRunning'
    FROM msdb.dbo.sysjobactivity ja
    INNER JOIN msdb.dbo.sysjobs j ON ja.job_id = j.job_id
    INNER JOIN (
    SELECT job_id,
    AVG
    ((run_duration/10000 * 3600) + ((run_duration%10000)/100*60) + (run_duration%10000)%100)
    +
    STDEV
    ((run_duration/10000 * 3600) + ((run_duration%10000)/100*60) + (run_duration%10000)%100) AS 'AvgRuntimeOnSucceed'
    FROM msdb.dbo.sysjobhistory
    WHERE step_id = 0 AND run_status = 1
    GROUP BY job_id) art
    ON j.job_id = art.job_id
    WHERE
    (stop_execution_date IS NULL and start_execution_date is NOT NULL) OR
    (DATEDIFF(ss,start_execution_date,stop_execution_date) > 60 and DATEDIFF(MINUTE,start_execution_date,GETDATE())>60
    AND
    CAST(LEFT(start_execution_date,11) AS DATETIME) = CAST(LEFT(GETDATE(),11) AS DATETIME) )
    --ORDER BY start_execution_date DESC
    group by j.job_id,name
    $rdr = $sql.ExecuteReader()
    $dt.Load($rdr)
    $cn.Close()
    $dt|out-Datatable
    Write-DataTable -ServerInstance 'test124' -Database "PowerSQL" -TableName "TLOG_JobLongRunning" -Data $dt}
    You can refer the below link to refer out-datatable and write-dataTable function.
    http://blogs.technet.com/b/heyscriptingguy/archive/2010/11/01/use-powershell-to-collect-server-data-and-write-to-sql.aspx
    Once we've the table details, I'm sending one consolidated email to automatically.
    --Prashanth

  • I want to get comcast i want to use either my time capsule or air port as the gateway can i do that

    I'm thinking about getting comcast internet but I don't want to buy their modem can I use either my time capsule or air port as the gateway

    You can use a Time Capsule or any other AirPort Base Station for your wireless router, but you still need a modem.

  • How to get Metadata column values using powershell(CSOM)

    Hi,
    I am trying to get list column values using Powershell (CSOM), but I am getting for Metata data columns.
    I am getting internal value as System.Collections.Generic.Dictionary`2[System.String,System.Object] 
    Can anybody let me know how to get the values for metadata columns?
    Any help would be greatly appreciate.
    Thank you.
    AA.

    Hi
    Go through the links. It'll help.
    SharePoint 2013 Code Tips – Setting a Managed Metadata Field with the Client Object Model(CSOM and JSOM)
    Indul Hassan
    Microsoft Community Contributor
    http://www.indulhassan.com
    You Snooze.. You Lose !!

  • Need to get a listing of all users and their corresponding Exchange 2013 Mailbox Quotas using Powershell

    I will be changing the default quota on mailboxes soon, but there are a number of others who have "customized" quotas and I will need to identify them also.
    Charlie

    The following powershell command can get you the mailboxes that are using "custum "quota:
    Get-Mailbox -Resultsize unlimited | where-object {$_.UseDatabaseQuotaDefaults -eq $false}

  • Get list urls using powershell

    Hi all,
    I used below url to get all lists using powershell.
    http://sharepointrelated.com/2011/11/28/get-all-sharepoint-lists-by-using-powershell/
    But i wanted to retrieve all urls of a lists using powershell.Can any one please help.
    Regards,
    Praveen

    This will loop through all the lists and give you the output of the URL:
    $SPWeb = Get-SPWeb "http://sitecollection"
    $List = $SPWeb.Lists
    foreach($i in $List)
    $i.DefaultView.Url
    You could also do this:
    $SPWeb = Get-SPWeb "http://SiteCollention"
    $List = $SPWeb.Lists
    foreach($i in $List)
    $b = $i.DefaultView.Url
    $a = "http://SiteCollention" + "/" + $b
    write-host $a
    If this is helpful please mark it so. Also if this solved your problem mark as answer.

  • Get the daily incremental search crawl information using PowerShell script

    Dear Friends ,
        I want to get the daily incremental search crawl information using PowerShell script . I need this information into CSV or txt format . Can you please help me with this.
    valmiki

    Hi
    I  have got the below script which worked .
    ## SharePoint Reference
    [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
    [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Administration")
    [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server.Search.Administration")
    [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server.Search")
    [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server")
    function global:Get-CrawlHistory($url)
    trap [Exception] {
    write-error $("ERROR: " + $_.Exception.GetType().FullName);
      write-error $("ERROR: " + $_.Exception.Message);
      continue;  
    $s =
    new-Object Microsoft.SharePoint.SPSite($url);
    $c = [Microsoft.Office.Server.Search.Administration.SearchContext]::GetContext($s);
    $h =
    new-Object Microsoft.Office.Server.Search.Administration.CrawlHistory($c);
    Write-OutPut $h.GetCrawlHistory();
    $s.Dispose();
    Get-CrawlHistory
    -url  http://your_site_url/
      |
    Export-CsvF:\temp\search.csv
    valmiki

Maybe you are looking for