First off, fantastic work on these cmdlets. Thanks a bunch!
I am trying to connect to my filer over HTTPS using a set of AD credentials that are different than the ones I am logged onto my machine with. For example, I am logged on to my workstation as domain\normalAndy but I need to connect to the filer as domain\adminAndy.Each time I connect, I get "incorrect credentials."
I wrote a function using the .NET API in PowerShell a while back and I think I might know what is going on. I get a System.Management.Automation.PSCredential variable called $credential and then do the following. The trick is the if statement that puts the "domain\" in front of the username when you call the SetAdminUser() method on the NetApp.Manage.NaServer object.
$username = $credential.GetNetworkCredential().UserName
$password = $credential.GetNetworkCredential().Password
$domain = $credential.GetNetworkCredential().Domain
if ($domain) {$username = "$domain\$username"}
$NtapServer = New-Object NetApp.Manage.NaServer($filer,1,0)
$NtapServer.Port = $port
$NtapServer.TransportType = $transportType
$NtapServer.SetAdminUser($username,$password)
return $NtapServer
Any ideas?
Thanks again. fantastic work!
Andy Schneider
http://get-powershell.com