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('ADFS02VMName'),'/InstallADFS')]", | |
"apiVersion": "2015-05-01-preview", | |
"location": "[resourceGroup().location]", | |
"dependsOn": [ | |
"[concat('Microsoft.Compute/virtualMachines/', parameters('ADFS02VMName'))]", | |
], | |
"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/user/folder/", | |
"InstallADFSPackageURL": "[concat(parameters('repoLocation'), 'InstallADFS.zip')]", | |
"InstallADFSConfigurationFunction": "InstallADFS.ps1\\InstallADFS", | |
"AddToADFSFarmScriptUrl": "[concat(parameters('repoLocation'), 'AddToADFSFarm.ps1')]", |
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
$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
Configuration InstallWAP | |
{ | |
param | |
( | |
[string[]]$NodeName="localhost" | |
) |
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
Node $NodeName | |
{ | |
LocalConfigurationManager | |
{ | |
ActionAfterReboot = 'ContinueConfiguration' | |
ConfigurationMode = 'ApplyOnly' | |
RebootNodeIfNeeded = $true | |
} |
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 InstallWAP #install WAP Role | |
{ | |
Ensure = "Present" | |
Name = "Web-Application-Proxy" | |
} |
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 InstallWAP | |
{ | |
param | |
( | |
[string[]]$NodeName="localhost" | |
) | |
Node $NodeName | |
{ | |
LocalConfigurationManager |
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
<# | |
ConfigureWAP.ps1 is passed the username for an account that has local administrator access on the ADFS Server | |
#> | |
param | |
( | |
$AdminUsername | |
) | |
#password for the local administrator account on the ADFS server is encrypted and stored in a local folder | |
#define the directory where the files are stored and the key used to encrypt the password, so that the password |
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
#read in the contents of the file containing the encypted password for the account with local administrator | |
#access on the ADFS Server, and decrypt the password using the key | |
$adminpassword = Convertto-SecureString -String (Get-Content -Path $($localpath+"adminpass.key")) -key $key | |
#Create a PSCredential Object using the account username and password | |
$AdminCreds = New-Object System.Management.Automation.PSCredential($($AdminUsername), $adminpassword) |
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
#import the certificate that was used to create the ADFS Farm | |
Import-PfxCertificate -Exportable -Password $adminpassword -CertStoreLocation cert:\localmachine\my -FilePath $($localpath+"fs.adfsfarm.com.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"} | |
Install-WebApplicationProxy -FederationServiceName fs.adfsfarm.com -FederationServiceTrustCredential $AdminCreds -CertificateThumbprint $cert.thumbprint |