Click here to Skip to main content
15,912,507 members

Comments by Member 10597584 (Top 2 by date)

Member 10597584 20-Feb-14 8:39am View    
Hi,

Now i used the below code but got an error.Although i have mapped my network drives to Z and Y i am still getting error.PFB the code i used.

$net = new-object -ComObject WScript.Network
$net.MapNetworkDrive("Z:", "\\d1dal723\prdload", $false, "apl\smallak", "Smile@05")

$a=Get-ChildItem "\\d1dal723\prdload" -r | ? {$_.psiscontainer -eq $false} | ? {gc $_.pspath |select-string -pattern "err"}
Write-host " Files with error code ERROR : $a"-foreground "magenta"-backgroundcolor "black"

$b=Get-ChildItem "\\d1dal723\prdload" -r | ? {$_.psiscontainer -eq $false} | ? {gc $_.pspath |select-string -pattern "ora[0-9]"}
Write-host " Files with error code ORA : $b"-foreground "magenta"-backgroundcolor "black"

$c=Get-ChildItem "\\d1dal723\prdload" -r | ? {$_.psiscontainer -eq $false} | ? {gc $_.pspath |select-string -pattern "odbc[0-9]"}
Write-host " Files with error code ODBC : $c"-foreground "magenta"-backgroundcolor "black"

$d=Get-ChildItem "\\d1dal723\prdload" -r | ? {$_.psiscontainer -eq $false} | ? {gc $_.pspath |select-string -pattern "TNS"}
Write-host " Files with error code TNS : $d"-foreground "magenta"-backgroundcolor "black"

$e=Get-ChildItem "\\d1dal723\prdload" -r | ? {$_.psiscontainer -eq $false} | ? {gc $_.pspath |select-string -pattern "inaccessible"}
Write-host " Files with error code INACCESSIBLE : $e"-foreground "magenta"-backgroundcolor "black"

$e=Get-ChildItem "\\d1dal723\prdload" -r | ? {$_.psiscontainer -eq $false} | ? {gc $_.pspath |select-string -pattern "Holos not logged "}
Write-host " Files with error code Holos not logged : $e"-foreground "magenta"-backgroundcolor "black"

$e=Get-ChildItem "\\d1dal723\prdload" -r | ? {$_.psiscontainer -eq $false} | ? {gc $_.pspath |select-string -pattern "\?"}
Write-host " Files with error code object no longer exists : $e"-foreground "magenta"-backgroundcolor "black"


Please help
Member 10597584 20-Feb-14 8:38am View    
Hi,

Now i used the below code but got an error.Although i have mapped my network drives to Z and Y i am still getting error.PFB the code i used.

<blockquote class="FQ"><div class="FQA">Quote:</div>$net = new-object -ComObject WScript.Network
$net.MapNetworkDrive("Z:", "\\d1dal723\prdload", $false, "apl\smallak", "Smile@05")

$a=Get-ChildItem "\\d1dal723\prdload" -r | ? {$_.psiscontainer -eq $false} | ? {gc $_.pspath |select-string -pattern "err"}
Write-host " Files with error code ERROR : $a"-foreground "magenta"-backgroundcolor "black"

$b=Get-ChildItem "\\d1dal723\prdload" -r | ? {$_.psiscontainer -eq $false} | ? {gc $_.pspath |select-string -pattern "ora[0-9]"}
Write-host " Files with error code ORA : $b"-foreground "magenta"-backgroundcolor "black"

$c=Get-ChildItem "\\d1dal723\prdload" -r | ? {$_.psiscontainer -eq $false} | ? {gc $_.pspath |select-string -pattern "odbc[0-9]"}
Write-host " Files with error code ODBC : $c"-foreground "magenta"-backgroundcolor "black"

$d=Get-ChildItem "\\d1dal723\prdload" -r | ? {$_.psiscontainer -eq $false} | ? {gc $_.pspath |select-string -pattern "TNS"}
Write-host " Files with error code TNS : $d"-foreground "magenta"-backgroundcolor "black"

$e=Get-ChildItem "\\d1dal723\prdload" -r | ? {$_.psiscontainer -eq $false} | ? {gc $_.pspath |select-string -pattern "inaccessible"}
Write-host " Files with error code INACCESSIBLE : $e"-foreground "magenta"-backgroundcolor "black"

$e=Get-ChildItem "\\d1dal723\prdload" -r | ? {$_.psiscontainer -eq $false} | ? {gc $_.pspath |select-string -pattern "Holos not logged "}
Write-host " Files with error code Holos not logged : $e"-foreground "magenta"-backgroundcolor "black"

$e=Get-ChildItem "\\d1dal723\prdload" -r | ? {$_.psiscontainer -eq $false} | ? {gc $_.pspath |select-string -pattern "\?"}
Write-host " Files with error code object no longer exists : $e"-foreground "magenta"-backgroundcolor "black"
</blockquote>