cohesity / cohesity-powershell-module

This repository provides a PowerShell Module for Cohesity DataPlatform. https://cohesity.github.io/cohesity-powershell-module
Apache License 2.0
42 stars 16 forks source link

Add `-Domain` Parameter to Connect-CohesityCluster #247

Open angrycuban13 opened 2 days ago

angrycuban13 commented 2 days ago

🚀 Feature Request

It would be very helpful if the Connect-CohesityCluster cmdlet had a -Domain parameter. That way you could specify if you want to authenticate as a local user, domain user, etc.

I understand you can authenticate as a domain user currently by following the instructions as outlined in Example 2. However, this requires you to specify a password in plain text which defeats the whole purpose of using the -Credentials parameter.

My current workaround for this is as follows:

This "janky" way sets the Domain property in the GetNetworkCredential() method of the PSCredential object.

Connect-CohesityCluster -Server myserver.contoso.com -Credential $credentials

Example or reference

Connect-CohesityCluster -Server myserver.contoso.com -Credential (Get-Credential) -Domain "mydomain.com"

angrycuban13 commented 1 day ago

You can also specify the domain when creating a PSCredential object by using domain\username. However, I still think the module would benefit from using -Domain parameter.

angrycuban13 commented 1 day ago

Potentially, you could also make it part of Set-CohesityCmdletConfig so the module knows you always want to authenticate as a domain user every time.