The transition to NetApp MS Azure AD B2C is complete. If you missed the pre-registration, you will be invited to register at next log in.
Please note that access to your NetApp data may take up to 1 hour.
To learn more, read the FAQ and watch the video.
Need assistance? Complete this form and select “Registration Issue” as the Feedback Category.

Simulator Discussions

Powershell SDK Connect-NcControler returns $NULL when run as SCOM monitor script


I wrote a script that works perfectly in a powershell runspace but when run in SCOM as a monitor, the Connect-NcController returns a $null value.


I can run under the local system context or under my user credentials context so it is not a search path or anything like that.  The only thing I can find is that when SCOM creates the powershell runspace, it has a $host.Version of "7.0.5000.0" instead of "4.0".

the code that works in the 4.0 space but not in the 7.0.5000.0 space is as follows:

$Password=ConvertTo-SecureString -AsPlainText -Force $UserPassword
$Creds=New-Object System.Management.Automation.PSCredential( $UserName,$Password)

$Controller=Connect-NcController -name $ControllerName -credential $Creds


Does anyone know what is different in the SCOM implementation of powershell versus the standard powershell runspace that causes a $null value to be returned.   I have the cmdLet in a try/catch but there is no error so the catch portion of the code never executes.  I could at least work with an error but I just get back a $null value which I cannot work with.


Our storage team does not have any vested interest in using plug-in for scom since it woudl monitor the whole solution but we have an interest in monitoring the CIFS shares and the volumes for alerting and reporting and thus why I went this route.  I can come up with a work-around but was hoping to find a more forthright solution.



NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner