审核ISCSi的脚本 [英] Script to Audit ISCSi

查看:59
本文介绍了审核ISCSi的脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我写了下面的脚本tom audit iscsi,我得到如下输出。


$ AuditISCSI = Invoke-Command -ComputerName $ ComputerName {get-iscsisession} | FT PSComputerName,InitiatorPortalAddress,IsConnected -autosize


输出:


PSComputerName InitiatorPortalAddress IsConnected

-------------- ---------------------- ---------- -

slcqc038        10.214.89.117                  True



有什么方法可以让我以这种格式获得输出 


InitiatorPortalAddress:10.214.89.117


IsConnected:True  






$



解决方案

是。 学习基本的PowerShell,你将能够做到这一点:


学习PowerShell:

https://mva.microsoft.com/en-us/training-courses/getting-started-with-microsoft-powershell-8276


当你想要对象时不要使用FT。



Hi ,

I wrote below script tom audit iscsi and I am getting the output as below.

$AuditISCSI = Invoke-Command -ComputerName $ComputerName { get-iscsisession } | FT PSComputerName, InitiatorPortalAddress, IsConnected -autosize

Output:

PSComputerName InitiatorPortalAddress IsConnected
-------------- ---------------------- -----------
slcqc038       10.214.89.117                 True

Is there any ways so that I will get the output in this format 

InitiatorPortalAddress :10.214.89.117

IsConnected:True  

解决方案

Yes.  Learn basic PowerShell and you will be able to do this:

Learn PowerShell: https://mva.microsoft.com/en-us/training-courses/getting-started-with-microsoft-powershell-8276

Don't use FT when you want objects.


这篇关于审核ISCSi的脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆