Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
$domain = 'trusbron.com'
# Sign into AAD
$secpasswd = ConvertTo-SecureString "MyPassword" -AsPlainText -Force
$LiveCred = New-Object System.Management.Automation.PSCredential ("admin@tenant.onmicrosoft.com", $secpasswd)
Connect-MsolService –Credential $LiveCred
##########################################################################################
################################## ADFS Cmdlets ###################################
##########################################################################################
Import-Module ADFS
# Check to see if you're logged onto the Primary ADFS server, if not logon to the primary ADFS computer
Get-AdfsSyncProperties
# Set the context by adding the FQDN of the ADFS server
Set-MsolAdfscontext -Computer ADFSServer.trusbron.Corp # FQDN of the primary ADFS server
# To check all MSOL registered federated domains that are not AAD managed domains e.g. managed or onmicrosoft.com:
Get-MsolDomain | ? {$_.Authentication -ne 'Managed'} | fl *
# To check all MSOL registered domains that are AAD managed domains e.g. not federated or onmicrosoft.com:
Get-MsolDomain | ? {$_.Authentication -eq 'Managed'} | fl *
# To check federation status for a specific MSOL domain
Get-MsolFederationProperty –DomainName $domain
# Convert the domain from Federated to Standard - if you are permanently decommissioning
Convert-MsolDomainToStandard –DomainName $domain -SkipUserConversion $false -PasswordFile c:\userpasswords.txt
# Convert the domain from Federated to Standard - if you are temporarily switching
Convert-MsolDomainToStandard –DomainName $domain -SkipUserConversion $true -PasswordFile c:\userpasswords.txt
# Convert the domain from Standard to Federated - supporting multiple domains
Convert-MSOLDomainToFederated -DomainName $domain -supportmultipledomain
# Convert the domain from Standard to Federated
Convert-MSOLDomainToFederated -DomainName $domain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.