I have a script that runs against remote sites to map a drive and work with a file. I use Test-Connection
to make sure the remote server is alive, then attempt to map the location needed with net use
. My problem is that, depending on who runs the script a certain subset of remote locations is pingable, but cannot be mapped. Is there any way to make net use
time out after a shorter time, or another way to do this with Windows 7 or 2008 commands?
Home
/
user-3000
Joshua Nurczyk's questions
I have some servers that are commonly having error 1000s. I want to find if it's the same application all the time, or if it's different applications. I am using this:
Get-EventLog application 1000 -entrytype error -newest 10 | select timegenerated,message | Export-Csv errors.csv
and the output shows the application name (specifically the exe file) as part of the multi-line message field.
I have not been able to figure out how to extract just the application name from the output.
Piping the output to Get-Member makes it look like the message field is an array, but I cannot figure out how to extract that part of the array at this point.
Get-EventLog application 1000 -entrytype error -newest 10 | %{$_.machinename,$_.timegenerated,$_.ReplacementStrings[0]}
This gives me the output I want, except it's generated over three lines, and Export-CSV doesn't want to parse it properly. How can I get them all on one line?