• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
ControlUp Community

ControlUp Community

Connect, Learn, and Grow

  • Blog
  • Podcast
  • Meetups
  • Archives
  • Categories
    • ControlUp One Platform
    • ControlUp for Apps
    • ControlUp for Compliance
    • ControlUp for Desktops
    • ControlUp Scripts & Triggers
    • ControlUp Synthetic Monitoring
    • ControlUp for VDI
  • Topics
  • Events
    • Logos & Wallpaper
    • ControlUp.com
  • Join

Troubleshooting Network Share Availability with ControlUp Scouts

Posted on September 12, 2024

The members of ControlUp discuss the possibility of using a Scoutbees Shell Execution scout to check the availability of a network share. Some members recommend using a PowerShell script for this purpose, while others suggest doing a TCP port 445 test. After some troubleshooting, one member shares their successful method of using a PowerShell script with the Share permissions set to "everyone."


Read the entire ‘Troubleshooting Network Share Availability with ControlUp Scouts’ thread below:

Good day

With scoutbees

Is there a way to see if a network share is available ?


AFAIK not out of the box, but you can maybe use a Script (Test-Path $netsworkshare) with an Shell Execution scout!?


Ok awesome

The shell will then be PowerShell

And the argument with then be the path to the script ?


To be honest I never used a Shell Exec scout because I had no use case. Until today 😄

Will try in Lab later and let you know…

I assume you will have to write the script which will check the network share which have to be available on the custom hive running the script.


I like power shell so that I can do

Just need some advise to run the script


You could do a tcp port 445 test. It at least tells you if a fileserver has SMB open. But to test it fully, the shell execution test is the way to go


i did it via a PS script action


@member

Must the script be on the device somewhere ?

And if so do just add this to the shell field ?

powershell.exe -ExecutionPolicy Bypass -File "C:\path\to\your\script.ps1"

@member do you mind sharing what and how you did it ?



Currently in the lab… Seems the script is working though:

“`$share = "\mze-filer-01.lab.brainc1on.de\config"

$checkShare = Test-Path -Path $share

If ($checkShare) {

#Write-Host "Its alive!"

exit 0

} else {

#Write-Host "Its dead!"

exit 666

}“`

I am just fiddling with the exit codes 🙂


Thank you thank you


i put a test file in the share and I have PS look for it


So my script from posted above works in scoutbees with the following config which is quite the same as Brian have.

Just wanted to finish it 😄


looks like mine isn’t working

File: powershell.exe

Arguments: -file c:\tech\scripts\find_files.ps1

Date: Thu, 12 Sep 2024 12:09:11

Exit Code: 0

STDERR Length: 0 b

STDOUT Body:

False


you all are awesome

again i love this community


looking more closely at mine. It reports success even if the output is false.

Not sure How i would make scoutbees interpret the results better

Here is a failure:

“`File: powershell.exe

Arguments: -file c:\tech\scripts\find_files.ps1

Date: Thu, 12 Sep 2024 11:09:12

Exit Code: 0

STDERR Length: 0 b

STDOUT Body:

False“`

Here is a success:

“`File: powershell.exe

Arguments: -file c:\tech\scripts\find_files.ps1

Date: Thu, 12 Sep 2024 12:09:21

Exit Code: 0

STDERR Length: 0 b

STDOUT Body:

True“`


Mine is working quite fine.

If I check it against a non existing share I get the return code 666 I put in my script and scoutbees shows a failure:

@member if your script is just that one line "Test-path…" then you will always get 0 as ExitCode which scoutbess interprets as "successful".

You need to work with exit codes (like I do in my script).

The "Test-Path" just returns a $false if the path you’re checking is not existing but the result of the script is ErroCode 0 anyways…


i get no output using yours.


Woks for me

One is successful then turn off the share on the server and it worked with the fail


i’m getting an access denied. Did you have to grant any ntfs or SMB permissions to the share folder?

STDERR Length: Test-Path : Access is denied At C:\tech\scripts\1find_files.ps1:2 char:15 + $checkShare = Test-Path -Path $share + ~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : PermissionDenied: (\SERVER) [Test-Path], UnauthorizedAccessExcepti on + FullyQualifiedErrorId : ItemExistsUnauthorizedAccessError,Microsoft.PowerShell.Commands.TestPathCommand b


Gave the service account that is singed in on the scoutbees config access to the share and it worked


local system?


It’s the local admin yes


didn’t seem to help


Server team is offline its almost 8 pm here asked for a screenshot on the permissions will share one I get it



If you just want to check the availability of the share you don’t need NTFS (Security) permissions…

Make sure you set the Share permissions (if allowed by company policy) to everyone, then it should work.

If you want to check for an existing file you need (obviously) NTFS read permissions…


yup, i have share set to everyone full control

Continue reading and comment on the thread ‘Troubleshooting Network Share Availability with ControlUp Scouts’.  Not a member? Join Here!


Categories: All Archives, ControlUp Scripts & Triggers, ControlUp Synthetic Monitoring
Topics: Microsoft, PowerShell, Reporting, SaaS & Web App Availability Testing, Scripts, Security, Synthetic Monitoring

Ask Us Anything, Connect, Learn, and Grow with the ControlUp Community!

Login to the ControlUp Community to ask us anything, stay up-to-date on what’s new and coming soon and meet other like-minded techies like you.

Not already a member? Join Today!

Primary Sidebar

ControlUp Academy

Enroll in ControlUp Academy for expert-led technical training, equipping you with skills to effectively deploy, manage, and grow your ControlUp investment.

Learn here >

Rotating Images

Hidden Gem from our Community on Slack!

ControlUp Betas - What's Coming Next?
NEW ControlUp Features - Stay Up-to-Date!
ControlUp Scripts - Scripting, Zero to Hero
Latest KB Articles - Be the First to Learn
Did you Know - with Sivan Kroitoru
Practical Perspectives Technical Use Case Training

Video Tutorials Library

Visit our technical how-to videos, offering step-by-step tutorials on advanced features, troubleshooting, and best practices.

Watch here >

ControlUp Blog

Check out the ControlUp blog for expert advice and in-depth analysis.

Read here >

ControlUp Script Library

Visit the ControlUp technical script library, which offers a multitude of pre-built scripts and custom actions for your monitoring and troubleshooting requirements.

See here >

ControlUp Support

Visit the ControlUp support home and to delve deeper into ControlUp solutions.

Browse here >

Download ControlUp RealTime DX

Start with ControlUp for real-time end-user environment insights, swift troubleshooting, and unprecedented performance optimization. Download now.

Download here >

Footer

      

ControlUp Community
Of Techie, By Techie, For Techie!

Terms of Use | Privacy Policy | Security
Dive Deeper, Learn more at ControlUp.com

  • facebook
  • twitter
  • youtube
  • linkedin

© 2023–2025 ControlUp Technologies LTD, All Rights Reserved.

We use cookies to ensure that we give you the best experience on our website. by continuing to use this site you agree to our Cookie policy..