Is there a way in AD or any other way to get all ADFS servers in the company?

Hi,

Is there a way in AD or any other way to get all ADFS servers in the company?

Thanks
LVL 1
SAM2009Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

yo_beeDirector of Information TechnologyCommented:
Good evening Sam.

How many do you think your have?
yo_beeDirector of Information TechnologyCommented:
from your adfs server run this Powershell command

Get-AdfsFarmInformation

It will list all servers that are part of your ADFS farm.
SAM2009Author Commented:
Do I need to install something first? Because I got:

Get-AdfsFarmInformation : The term 'Get-AdfsFarmInformation' is not recognized
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

yo_beeDirector of Information TechnologyCommented:
Sorry.  This is a 2016 ADFS command.
If you are running ADFS on a server 2016 you should be able to run this from there.

Try this to confirm if the ADFS module is loaded.

Get-Command *ADFS*

Open in new window

SAM2009Author Commented:
yes but get commands are limited to:

Cmdlet          Get-ADFSAttributeStore
Cmdlet          Get-ADFSCertificate
Cmdlet          Get-ADFSClaimDescription
Cmdlet          Get-ADFSClaimsProviderTrust
Cmdlet          Get-ADFSConfiguration
Cmdlet          Get-ADFSEndpoint
Cmdlet          Get-ADFSProxyConfiguration
Cmdlet          Get-ADFSRelyingPartyTrust
Cmdlet          Get-ADFSSyncConfiguration
Shaun VermaakTechnical SpecialistCommented:
That will only get you servers within the ADFS farm.

You will probably have to check all servers if role is installed
Senior IT System EngineerIT ProfessionalCommented:
Yes, like the below script for example:

$domain= 'DOMAIN\Username'
$pass=ConvertTo-SecureString -String 'YourPassword' -AsPlainText -Force
$creds=New-Object System.Management.Automation.pscredential -ArgumentList $domain, $pass

(Get-Content C:\Servers.txt| `
Foreach{Invoke-Command -ComputerName $_ -Verbose -ScriptBlock{get-windowsfeature | `
Where-Object{$_.installed -eq $true -and $_.featuretype -eq 'Role'} |   
select name, installed -ExcludeProperty subfeatures} -Credential $creds}) | `
Format-Table -Property Name, Installed, @{name='Server Name';expression={$_.pscomputername}} -AutoSize

Open in new window


You can Export the data into an excel file by piping the last cmdlet of the script into Export-CSV cmdlet.

Note:  ADFS role: adfs-federation
This Script just gives you Installed Roles, Not the installed features.
To include features as well in the results, please remove the -and $_.featuretype -eq ‘Role’ from the script
yo_beeDirector of Information TechnologyCommented:
I like IT suggestion. I would take that and replace the get-content block with

Get-ADComputer -Filter {(OperatingSystem -like "*windows*server*") -and (Enabled -eq "True")}
yo_beeDirector of Information TechnologyCommented:
Also why do you think you have more than one ?
Senior IT System EngineerIT ProfessionalCommented:
Here it is the updated script:

$domain = 'DOMAIN\Username'
$pass = ConvertTo-SecureString -String 'YourPassword' -AsPlainText -Force
$creds = New-Object System.Management.Automation.pscredential -ArgumentList $domain, $pass

( Get-ADComputer -Filter {(OperatingSystem -like "*windows*server*") -and (Enabled -eq "True")} `
        ForEach-Object {Invoke-Command -ComputerName $_ -Verbose -ScriptBlock {
            Get-WindowsFeature | `
                Where-Object {$_.installed -eq $true -and $_.Name -eq 'ADFS-Federation' -and $_.featuretype -eq 'Role'} |   
                Select-Object name, installed -ExcludeProperty subfeatures
        } -Credential $creds}) | `
    Format-Table -Property Name, Installed, @{name = 'Server Name'; expression = {$_.pscomputername}} -AutoSize

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SAM2009Author Commented:
Thanks all for your help!
yo_beeDirector of Information TechnologyCommented:
Did you find any other rogue ADFS servers ?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows OS

From novice to tech pro — start learning today.