vmware / PowerCLI-Example-Scripts

http://blogs.vmware.com/powercli
Other
765 stars 609 forks source link

Set/Add-LDAPIdentitySource to 'Set As Default' as parameter #540

Closed MallocArray closed 2 years ago

MallocArray commented 2 years ago

Is your feature request related to a problem? Please describe.

I am not aware of any parameter or cmdlet in the VMware.vSphere.SsoAdmin module that can set an Identity Source as the Default

When using the cmdlet to Add-LDAPIdentitySource I can add and remove the sources easily, but not set it as default, which remains a manual step if the one we are adding should be the default

Describe the solution you'd like

Additional parameter that could set the Identity Source being worked on as the Default. My main concern is an LDAP identity source, but should be available for any of the valid types

Describe alternatives you've considered

Currently added a note to the script for users to manually set it as the Default as needed

Additional context

No response

digifuchsi commented 2 years ago

I would love to see this feature implemented, too. :)

dmilov commented 2 years ago

It's possible and it's not a big investment, will be included in the next version.

dmilov commented 2 years ago

Fixed in version 1.3.8

Testing done:

PS C:\Users\dmilov> Get-IdentitySource

Name
----
localos
vsphere.local
sof-powercli-qe.eng.vmware.com

PS C:\Users\dmilov> Get-IdentitySource -Default

Type                   : ActiveDirectory
Alias                  :
AuthenticationType     : PASSWORD
AuthenticationUsername : administrator@sof-powercli-qe
FriendlyName           : sof-powercli-qe
PrimaryUrl             : ldap://sof-powercli-qe.eng.vmware.com:389
FailoverUrl            :
UserBaseDN             : CN=Users,DC=sof-powercli-qe,DC=eng,DC=vmware,DC=com
GroupBaseDN            : CN=Users,DC=sof-powercli-qe,DC=eng,DC=vmware,DC=com
Certificates           :
Name                   : sof-powercli-qe.eng.vmware.com

PS C:\Users\dmilov> Get-IdentitySource -Localos | Set-IdentitySource -Default
PS C:\Users\dmilov> Get-IdentitySource -Default

Name
----
localos

PS C:\Users\dmilov> Get-IdentitySource -External | Set-LDAPIdentitySource -Default
PS C:\Users\dmilov> Get-IdentitySource -Default

Type                   : ActiveDirectory
Alias                  :
AuthenticationType     : PASSWORD
AuthenticationUsername : administrator@sof-powercli-qe
FriendlyName           : sof-powercli-qe
PrimaryUrl             : ldap://sof-powercli-qe.eng.vmware.com:389
FailoverUrl            :
UserBaseDN             : CN=Users,DC=sof-powercli-qe,DC=eng,DC=vmware,DC=com
GroupBaseDN            : CN=Users,DC=sof-powercli-qe,DC=eng,DC=vmware,DC=com
Certificates           :
Name                   : sof-powercli-qe.eng.vmware.com
dmilov commented 2 years ago

1.3.8 is available on PS Gallery