This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xComputer JoinDomain | |
{ | |
Name = $MachineName | |
DomainName = $DomainName | |
Credential = $DomainCreds # Credential to join to domain | |
DependsOn = "[xWaitForADDomain]DscForestWait" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xPendingReboot Reboot1 | |
{ | |
Name = "RebootServer" | |
DependsOn = "[xComputer]JoinDomain" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WindowsFeature installADFS #install ADFS | |
{ | |
Ensure = "Present" | |
Name = "ADFS-Federation" | |
DependsOn = "[xPendingReboot]Reboot1" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Configuration InstallADFS | |
{ | |
param | |
( | |
[Parameter(Mandatory)] | |
[string]$MachineName, | |
[Parameter(Mandatory)] | |
[string]$DomainName, | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#get the admin and adfs passwords first | |
$adminpassword = Convertto-SecureString -String (Get-Content -Path $($localpath+"adminpass.key")) -key $key | |
$adfspassword = Convertto-SecureString -String (Get-Content -Path $($localpath+"adfspass.key")) -key $key | |
$DomainAdminCreds = New-Object System.Management.Automation.PSCredential($($DomainName+"\"+$DomainAdminUsername), $adminpassword) | |
$AdfsSvcCreds = New-Object System.Management.Automation.PSCredential($($DomainName+"\"+$AdfsSvcUsername), $adfspassword) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#install the certificate that will be used for ADFS Service | |
Import-PfxCertificate -Exportable -Password $adminpassword -CertStoreLocation cert:\localmachine\my -FilePath $($localpath+"adfs_certificate.pfx") | |
#get thumbprint of certificate | |
$cert = Get-ChildItem -Path Cert:\LocalMachine\my | ?{$_.Subject -eq "CN=fs.adfsfarm.com, OU=Free SSL, OU=Domain Control Validated"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Configure ADFS Farm | |
Import-Module ADFS | |
Install-AdfsFarm -CertificateThumbprint $cert.thumbprint -Credential $DomainAdminCreds ` | |
-FederationServiceName fs.adfsfarm.com -FederationServiceDisplayName "Active Directory Federation Service" ` | |
-ServiceAccountCredential $AdfsSvcCreds -OverwriteConfiguration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param ( | |
$DomainName, | |
$DomainAdminUsername, | |
$AdfsSvcUsername | |
) | |
#the domain admin and adfs service passwords are encrypted and stored in a local folder | |
$localpath = "C:\Program Files\WindowsPowerShell\Modules\Certificates\" | |
$Key = (3,4,2,3,56,34,254,222,1,1,2,23,42,54,33,233,1,34,2,7,6,5,35,43) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "Microsoft.Compute/virtualMachines/extensions", | |
"name": "[concat(parameters('ADFS01VMName'),'/InstallADFS')]", | |
"apiVersion": "2015-05-01-preview", | |
"location": "[resourceGroup().location]", | |
"dependsOn": [ | |
"[concat('Microsoft.Compute/virtualMachines/', parameters('ADFS01VMName'))]" | |
], | |
"properties": { | |
"publisher": "Microsoft.Powershell", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"repoLocation": "https://raw.githubusercontent.com/nivleshc/arm/master/", | |
"InstallADFSPackageURL": "[concat(parameters('repoLocation'), 'InstallADFS.zip')]", | |
"InstallADFSConfigurationFunction": "InstallADFS.ps1\\InstallADFS" |