- Community Home
- >
- Servers and Operating Systems
- >
- HPE ProLiant
- >
- Server Management - Systems Insight Manager
- >
- Powershell script as custom tool isn't executing
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2018 05:50 PM - edited 02-26-2018 05:55 PM
02-26-2018 05:50 PM - edited 02-26-2018 05:55 PM
Powershell script as custom tool isn't executing
Good Afternoon Guys,
I'm working on setting up a custom tool in HP SIM (7.4.0). When I use CMS tool and uses a batch script to run, it completes successfully and triggers the script sitting on the CMS server. But If I change the script to a powershell script, the task gets stuck in 'Running' state and the script doesn't get initiated.
I created a custom CMS tool, and then attached the tool with an Automatic Event handling task (run tools only when critical event triggers).
If I use the below batch script, the task completes, and updates the output file.
(
echo %DATE% - %TIME%
echo ------------------------------------
echo NoticeLabel: %NoticeLabel%
echo NoticeState: %NoticeState%
echo NoticeSeverityStr: %NoticeSeverityStr%
echo DeviceName: %DeviceName%
echo -----------------------------------
) >> C:\Tools\Scripts\output.txt
Following is a similar PowerShell script. When the task triggers, the status of task gets stuck at 'Running', and the output file doesn't get created/updated.
$NoticeLabel = $ENV:NoticeLabel
$NoticeSeverityStr = $ENV:NoticeSeverityStr
$DeviceName = $ENV:DeviceName
$NoticeState = $ENV:NoticeState
"Time: " + (Date) | Out-File C:\Tools\Scripts\output.txt -Append
"-----------------------------------------" | Out-File C:\Tools\Scripts\output.txt -Append
"NoticeLabel: " + $NoticeLabel | Out-File C:\Tools\Scripts\output.txt -Append
"NoticeSeverityStr: " + $NoticeSeverityStr | Out-File C:\Tools\Scripts\output.txt -Append
"DeviceName: " + $DeviceName | Out-File C:\Tools\Scripts\output.txt -Append
"NoticeState: " + $NoticeState | Out-File C:\Tools\Scripts\output.txt -Append
"-----------------------------------------" | Out-File C:\Tools\Scripts\output.txt -Append
I checked and confirmed the powershell execution policy is configured as 'Unrestricted'
I also checked the access permissions, and everything looked fine.
I checked on servers with powershell version 2.0 and 3.0
Just wondering if someone can shade some light, as to why the script isn't executing. Could it be because of the PS version, or perhaps CMS tool doesn't support PS script at all.
Thanks in advance.