in reply to Re^6: how to print out windows service status
in thread how to print out windows service status

Some functions require administrative rights; this might be one of them. Are you running it as an admin or as an umprivileged user?
  • Comment on Re^7: how to print out windows service status

Replies are listed 'Best First'.
Re^8: how to print out windows service status
by ytjPerl (Scribe) on Jul 31, 2017 at 19:07 UTC
    Hi poj, I had consideration of that, but I do not think that is the issue. As I am able to use your script to get some of services status, I put the services name into my $inputfile, the service status I got is still like '' if I leave the first element of array as '', otherwise it would be the first element of this array @state_name. btw, I also tried somewhere I have full control, I had the same result.

      Post the content of XiServiceList.txt

        this file is just a list of services name with first entry hostname.
        localhost AMD External Events Utility aspnet_state SensrSvc CryptSvc