Skip to content

Instantly share code, notes, and snippets.

@marckean
Last active December 18, 2016 01:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marckean/66c0c0c50b33faa0a845fc9538b0ab5d to your computer and use it in GitHub Desktop.
Save marckean/66c0c0c50b33faa0a845fc9538b0ab5d to your computer and use it in GitHub Desktop.
$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