First steps with NetApp PowerShell Module
In this blog post, you will find the initial steps to get started with the NetApp PowerShell Module, from user requirements to basic script for PowerShell connection to the ONTAP cluster through a secure connection. Whether you’re a seasoned IT professional or just beginning your journey with NetApp, this tutorial will provide you with the foundational knowledge to start leveraging PowerShell for efficient and effective storage management. Let’s dive in and explore how you can enhance your NetApp experience with the power of automation!
User requirements, test credentials
- Create an user from CLI session:
security login create -user-or-group-name userName role admin -authentication-method password
for next applications:- http: Native access for PowerShell
- ontapi: For Zappi calls
- ssh: Useful for Invoke-NcSSH cmdlet
- Test access from PowerShell pointing to cluster IP address or DNS name with cmdlet
Connect-NcController 10.10.
10
.10 - Provide newly created credentials

Secure your credentials, start scripting
In today’s digital landscape, securing your credentials is paramount. The PowerShell cmdlet ConvertTo-SecureString
offers a robust solution for encrypting sensitive information, such as passwords, ensuring they are not stored or transmitted in plain text. By converting plain text passwords into secure strings, you significantly reduce the risk of unauthorized access and data breaches.
Benefits of Using ConvertTo-SecureString:
- Enhanced Security: Encrypts passwords, making them unreadable to unauthorized users.
- Compliance: Helps meet security standards and regulations by avoiding plain text storage.
- Ease of Use: Seamlessly integrates with other PowerShell cmdlets for secure automation.
- Flexibility: Supports various encryption methods to suit different security needs.
Adopting ConvertTo-SecureString
in your PowerShell scripts is a proactive step towards safeguarding your credentials and maintaining a secure IT environment.
- Enter next cmdlet pipeline for secure string management, then provide the password.
Read-Host "Enter the password:" -AsSecureString | ConvertFrom-SecureString | Out-File C:\temp\pass.txt

- The secured password will be displayed as hashed long string of characters for the selected
Out-File
location - Open PowerShell ISE, create a new file, then create a new variable for the username
$user = "admin"
- Import the secured password
$securestring = Get-Content -Path "C:\temp\pass.txt" | ConvertTo-SecureString
- Create a new credential object
$credential = New-Object management.automation.pscredential $user, $securestring
- Connect to your system
Connect-NcController cluster1 -Credential $credential
- Save the file. Congrats, this is your first NetApp PowerShell script for basic connection.
