Test Network Share(s) single/multiple

Testing the connectivity for a single network share or multiple network shares:

# Multi drive Network Share path-test

# enter mapped drive letters here

$ns1="t:\"

$ns2="y:\"

$ns3="z:\"

# $ns4="q:\"

# Note Q: does not exist for testing

foreach($p in $ns1,$ns2,$ns3)

# add $ns4 in array for testing

#===================== Do not modify below ===================

{

if(test-path $p)

    {Write-Eventlog -computername LocalHost -logname 'Windows PowerShell' `

    -Category 3 -source PowerShell -eventID 600 -EntryType Information `

    -message "$p is ONLINE and available."}

else

    {Write-Eventlog -computername LocalHost -logname 'Windows PowerShell' `

    -Category 3 -source PowerShell -eventID 600 -EntryType Error `

    -message "$p is OFFLINE and unavailable."}

}

 

Anonymous