ONTAP Discussions

gMSA account

ToddBarton
641 Views

Is it possible to login to a NetApp cluster (9.13) using a global Managed Service Account to run a powershell script?

3 REPLIES 3

AlexDawson
503 Views

If the system is configured for domain authentication and the account is part of a group that is authorised for the ONTAPI login method, it should work.

ToddBarton
435 Views

The system is configured for domain authentication and the account is part of a group authorized for ONTAPI login. I can't figure out how to run the Get- and Add-Credential to include both the Userid (gMSA account) and the password in my script to allow the connection to the NetApp cluster.

Sanaman
412 Views

You can use stored credentials for auto login, similar to

 

$credential = Get-Credential
$credential.password |ConvertFrom-SecureString |set-Content C:\Users\domain_user\encrypted_password.txt

 

$encrypted = Get-Content C:\Users\domain_user\encrypted_password.txt | ConvertTo-SecureString
$dom_user = "domain\domain_user"


$credential = New-Object System.Management.Automation.PsCredential($dom_user, $encrypted)

 

Then use that credential ($credential) to login to the cluster ($filer)

 

$ClusterConnection = Connect-NcController -name $filer -Credential $credential
# If the connection is not success, exit else continue.


if (!$ClusterConnection) {
Write-Host "Unable to connect to $filer, please ensure all supplied information is correct and try again"
Exit

} else

{ Continue with you script}

 

Hope that helps

Public