pan_2: (Default)
[datetime]$dtBootUp = [Management.ManagementDateTimeConverter]::ToDateTime((Get-WmiObject Win32_OperatingSystem).LastBootUpTime)


@(Get-WinEvent -ea SilentlyContinue -FilterHashtable @{LogName = "System"; StartTime = $dtBootUp.AddDays(-1); id=1074} )[1]
Tags:
pan_2: (Default)
Get all available information from iLO (version 3 and newer) of HP Server with HPiLOCmdlets

#get stored credentials from clixml file
$oiLOCredentials = Import-Clixml D:\Shares\Scripts\CredentialsStore\HP-iLO_hpautomation.clixml


foreach ($oiLO in "10.7.222.218")
{
#splat connection params
$hConnectParams = @{'Credential'=$oiLOCredentials; 'Server' = "10.7.222.218"}

#get commandlet list
$aCommandsList = Get-Command -Module HPiLOCmdlets Get-HPiLO*

#execute each commandlet against address
foreach ($oCommand in $aCommandsList)
{
Write-Host $oCommand.Name -fo Yellow
& $oCommand.Name @hConnectParams | fl
}

}#end foreach $oiLO
Tags:

PoSh

2013-10-31 23:53
pan_2: (Default)
How to get a neat table of all iSCSI Server Targets (WinTarget) on Windows Server 2012+ using PowerShell:
$isst = Get-IscsiServerTarget
# 
$oResult = foreach ($target in $isst)
    {
    
    foreach ($lun in $target.LunMappings)
        {
        $obj = "" |  select ComputerName, TargetIqn, TargetName,  Description, vDiskPath
        $obj.Computername = $target.ComputerName
        $obj.TargetIqn    = $target.TargetIqn
        $obj.TargetName   = $target.TargetName
        $obj.Description  = $target.Description
        $obj.vDiskPath    = $lun.Path
        $obj
        }

    }

$oResult 

Use
$oResult | ft -AutoSize
or
$oResult | ogv
to get formatted output:
ComputerName TargetIqn                                           TargetName     Description                   vDiskPath                                                 
------------ ---------                                           ----------     -----------                   ---------                                                 
S43          iqn.1991-05.com.microsoft:s43-exchange-bases-target exchange-bases target for exchange databases F:\iSCSIVirtualDisks\vs10-exchange-mailboxes.vhd          
S43          iqn.1991-05.com.microsoft:s43-dfs-target            dfs            Target for virtual DFS Server E:\iSCSIVirtualDisks\dfs-fileshare-commonfiles.vhd        
S43          iqn.1991-05.com.microsoft:s43-dfs-target            dfs            Target for virtual DFS Server E:\iscsivirtualdisks\dfs-fileshare-archive-photobank.vhd  
S43          iqn.1991-05.com.microsoft:s43-dfs-target            dfs            Target for virtual DFS Server E:\iscsivirtualdisks\dfs-fileshare-archive-commonfiles.vhd
S43          iqn.1991-05.com.microsoft:s43-dfs-target            dfs            Target for virtual DFS Server E:\iscsivirtualdisks\dfs-fileshare-archive-traktat.vhd    
S43          iqn.1991-05.com.microsoft:s43-dfs-target            dfs            Target for virtual DFS Server G:\iSCSIVirtualDisks\dfs-fileshare-companies.vhd          
S43          iqn.1991-05.com.microsoft:s43-dfs-target            dfs            Target for virtual DFS Server H:\iSCSIVirtualDisks\dfs-fileshare-verstka.vhd            
S43          iqn.1991-05.com.microsoft:s43-dfs-target            dfs            Target for virtual DFS Server I:\iSCSIVirtualDisks\dfs-fileshare-system.vhd      
Tags:
pan_2: (Default)
$log1 = get-messagetrackinglog -Start "01.04.2011 0:00:00" -End "11.05.2011 23:58:00" -resultsize unlimited | % {$_.Recipients -like "*DOMAINNAME.ru"} | select -unique

Получить список уникальных адресов получателей с 1 апреля

Profile

pan_2: (Default)
pan_2

September 2017

M T W T F S S
    123
45678910
11121314151617
18 192021222324
252627282930 

Syndicate

RSS Atom
Page generated 2017-09-20 07:23

Expand Cut Tags

No cut tags