Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking status of shared resoure/mapped drive

Status
Not open for further replies.

theniteowl

Programmer
May 24, 2005
1,975
US
I need to write a script that will test the status of a mapped drive to see if it is available or disconnected.
Essentially I need to know how to poll the resource and have a list of possible return codes and what they mean.

We have mapped drives from our servers to sharespace on a SAN. When not accessed for a period of time (15 mins) the network connection disconnects them but they should come back quickly once they are accessed again.
Sometimes though they disconnect in a way that they can not come back automatically and all the mappings have to be disconnected first then re-mapped.
The disconnects are causing problems with an application server and we have no way of knowing when the disconnects occur because the log files do not record these disconnects and they happen sometime between 6PM and 7AM sporadically.
I want to write a script that will periodically check the status and log the results so that we can compare the disconnects against our application's log files to see if we can match up each type of disconnect with ongoing application issues.

I can easily write a script that will try accessing the resource and report if it was successful or not but that would change the disconnect state if it was just the simple disconnect. I need to just check the status, perhaps with some API call to Windows, so that I am not affecting the state, just observing.

Anybody?

At my age I still learn something new every day, but I forget two others.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top