VMware Cloud Community
EcoBassam
Enthusiast
Enthusiast
Jump to solution

Get SSO Config inromation with PowerCLI

Hello,

We are building a script to make an audit of the configuration our multiple vCenters and we do not find any information related to SSO Configuration in PowerCLI side, for example : Identity sources, Policies ... Mainly anything in the following section accessible through the WebClient : Administration >> Single Sign-ON.

Is this possible with PowerCLI ? If not what other scriptable ways are availbale ? (we are exploring getting the information through sql scripts against the DB)

Thanks for your help Smiley Happy

Regards,

Tags (2)
Reply
0 Kudos
1 Solution

Accepted Solutions
FanZhang
Contributor
Contributor
Jump to solution

I worked with EcoBassam on this subject and using the information provided by lamw I managed to make a script that retrives the required information.

Thanks for the links provided by lamw, they really helped me a lot.

wmdird is an LDAP based system, so firstly we can use JXplorer to explorer the tree structure of LDAP:

IP.png

We will find all  identity sources in the path: /Services/IdentityManager/Tenants/vsphere.local/IdentityProviders

If we would like to use powercli/powershell to get the same information as we can see in the JXplorer, we may want to use ldapsearch in sso server, of course we must have ldapsearch installed in the server:

Here is an exemple of Invoke-VMScript which I used in my script for a SSO server 5.5:

$scriptsso = @"

&"$env:C:\the\directory\to\ldapsearch.exe" -h localhost -w $password -p 11711 -x -D "cn=Administrator,cn=users,dc=vsphere,dc=local" -b "cn=IdentityProviders,cn=vsphere.local,cn=Tenants,cn=IdentityManager,cn=Services,dc=vsphere,dc=local" -s one "vmwSTSDomainName=*"

"@

$invokesso = Invoke-VMScript -ScriptText $scriptsso -VM $Vm -GuestUser $user -GuestPassword $password

$invokesso.ScriptOutput | out-string -Stream | set-content $VMsubfolder\infosso.txt

Then we get a txt file infosso.txt with all Identity Sources

  edit identity source.png

We can get all the information available in Edit Identity Source screenshot above:

They are just under different names:

Domain Type

vmwSTSDomainType

Identity source type

vmwSTSProviderType

Name

vmwSTSName

Primary server URL

vmwSTSConnectionStrings

Domain Name

vmwSTSDomainName

Domain alias

vmwSTSAlias

Regards,

Fan

View solution in original post

Reply
0 Kudos
7 Replies
LucD
Leadership
Leadership
Jump to solution

No PowerCLI integration at the moment I'm afraid.

Although there is a SSO SDK, I have the impression it only provides API to work with tokens (acquire, renew, validate).

There don't seem to be any SSO Management API as far as I can tell (but lamw will surely correct me if I'm wrong on this :smileygrin:)

There are a number .Net and Java examples in the SDK

And there is a fling with sample code, as you can read in William's vSphere SDK for JavaScript Fling released


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

lamw
Community Manager
Community Manager
Jump to solution

EcoBassam
Enthusiast
Enthusiast
Jump to solution

Thanks for both replies LucDLucD and lamwlamw

I forgot to mention that we are still in version 5.5 of vSphere, is the "vmdir" available also for vSphere 5.5 ?

What we are trying to get for the moment is the "Identity sources" configuration elements shown on the screenshot below :

identySources.png

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Yes.
If that is on a Windows-based vCenter 5.5, you can have a look at vCenter Server 5.5 Single Sign-On VMDir deep dive


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

FanZhang
Contributor
Contributor
Jump to solution

I worked with EcoBassam on this subject and using the information provided by lamw I managed to make a script that retrives the required information.

Thanks for the links provided by lamw, they really helped me a lot.

wmdird is an LDAP based system, so firstly we can use JXplorer to explorer the tree structure of LDAP:

IP.png

We will find all  identity sources in the path: /Services/IdentityManager/Tenants/vsphere.local/IdentityProviders

If we would like to use powercli/powershell to get the same information as we can see in the JXplorer, we may want to use ldapsearch in sso server, of course we must have ldapsearch installed in the server:

Here is an exemple of Invoke-VMScript which I used in my script for a SSO server 5.5:

$scriptsso = @"

&"$env:C:\the\directory\to\ldapsearch.exe" -h localhost -w $password -p 11711 -x -D "cn=Administrator,cn=users,dc=vsphere,dc=local" -b "cn=IdentityProviders,cn=vsphere.local,cn=Tenants,cn=IdentityManager,cn=Services,dc=vsphere,dc=local" -s one "vmwSTSDomainName=*"

"@

$invokesso = Invoke-VMScript -ScriptText $scriptsso -VM $Vm -GuestUser $user -GuestPassword $password

$invokesso.ScriptOutput | out-string -Stream | set-content $VMsubfolder\infosso.txt

Then we get a txt file infosso.txt with all Identity Sources

  edit identity source.png

We can get all the information available in Edit Identity Source screenshot above:

They are just under different names:

Domain Type

vmwSTSDomainType

Identity source type

vmwSTSProviderType

Name

vmwSTSName

Primary server URL

vmwSTSConnectionStrings

Domain Name

vmwSTSDomainName

Domain alias

vmwSTSAlias

Regards,

Fan

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Thanks for sharing that, great find!


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
EcoBassam
Enthusiast
Enthusiast
Jump to solution

Many thanks to you  LucDLucD and lamwlamw, your help is very appreciated Smiley Happy

Reply
0 Kudos