Les articles précédents sont disponibles ci-dessous:
Etape 1: Configuration de l’authentification des utilisateurs
Dans cette partie nous allons utiliser le script de la fiche technique : http://technet.microsoft.com/en-us/library/dn197169.aspx
Ci-dessous, la liste des variables utilisées lors du script de configuration de la relation « server-to-server ».
$spcn="*.<public_root_domain_name>.com" $spsite=Get-Spsite <principal_web_application_URL> $site=Get-Spsite $spsite $spoappid="00000003-0000-0ff1-ce00-000000000000" $spocontextID = (Get-MsolCompanyInformation).ObjectID $metadataEndpoint = "https://accounts.accesscontrol.windows.net/" + $spocontextID + "/metadata/json/1"
$spcn="*.<public_root_domain_name>.com"
$spsite=Get-Spsite <principal_web_application_URL>
$site=Get-Spsite $spsite
$spoappid="00000003-0000-0ff1-ce00-000000000000"
$spocontextID = (Get-MsolCompanyInformation).ObjectID
$metadataEndpoint = "https://accounts.accesscontrol.windows.net/" + $spocontextID + "/metadata/json/1"
Ci-dessous une copie d’écran pour l’exemple :
Le script ci-dessous télécharge le certificat se trouvant sur site vers le SharePoint Online :
$cerPath = "<path to replacement certificate (.cer file)>" $cer = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 -ArgumentList $pfxPath, $pfxPass $cer.Import($cerPath) $binCert = $cer.GetRawCertData() $credValue = [System.Convert]::ToBase64String($binCert); #La date de début (StartDate) doit être la date du jour. La date de fin (EndDate) doit être la date d'expiration du certificat STS. Date au format Mois/Jour/Année New-MsolServicePrincipalCredential -AppPrincipalId $spoappid -Type asymmetric -Usage Verify -Value $credValue -StartDate <start_date. > -EndDate <end_date>
$cerPath = "<path to replacement certificate (.cer file)>"
$cer = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 -ArgumentList $pfxPath, $pfxPass
$cer.Import($cerPath)
$binCert = $cer.GetRawCertData()
$credValue = [System.Convert]::ToBase64String($binCert);
#La date de début (StartDate) doit être la date du jour. La date de fin (EndDate) doit être la date d'expiration du certificat STS. Date au format Mois/Jour/Année
New-MsolServicePrincipalCredential -AppPrincipalId $spoappid -Type asymmetric -Usage Verify -Value $credValue -StartDate <start_date. > -EndDate <end_date>
Ci-dessous, une copie d’écran pour l’exemple :
Le script ci-dessous va rajouter un « Service Principal Name » (SPN) dans le SharePoint Online
$msp = Get-MsolServicePrincipal -AppPrincipalId $spoappid $spns = $msp.ServicePrincipalNames $spns.Add("$spoappid/$spcn") Set-MsolServicePrincipal -AppPrincipalId $spoappid -ServicePrincipalNames $spns
$msp = Get-MsolServicePrincipal -AppPrincipalId $spoappid
$spns = $msp.ServicePrincipalNames
$spns.Add("$spoappid/$spcn")
Set-MsolServicePrincipal -AppPrincipalId $spoappid -ServicePrincipalNames $spns
ATTENTION !!! Notez la différence par rapport à la fiche Technet. Lors de l’exécution de la commande Set-MsolServicePrincipal, j’ai eu une « Unknown error » (pratique pour débugger !! J). J’ai corrigé le problème avec la commande suivante (en fait j’ai tout simplement passer en dur le « Service Principal Name »)
Set-MsolServicePrincipal -ServicePrincipalNames 00000003-0000-0ff1-ce00-000000000000/*.sharepoint.com -AppPrincipalId $spoappid
Pour vérification, vous pouvez exécuter les commandes suivantes :
$msp = Get-MsolServicePrincipal -AppPrincipalId $spoappid $spns = $msp.ServicePrincipalNames $spns
$spns
En résultat, vous devez avoir un SPN de la forme :
00000003-0000-0ff1-ce00-000000000000/*.<public domain name>.com
Ci dessous, une copie d’écran pour l’exemple :
Cette étape va permettre la liaison entre L’ID de l’application principale de SharePoint Online avec le Service « Application Management » de SharePoint Server 2013.
$spoappprincipalID = (Get-MsolServicePrincipal -ServicePrincipalName $spoappid).ObjectID $sponameidentifier = "$spoappprincipalID@$spocontextID" $appPrincipal = Register-SPAppPrincipal -site $site.rootweb -nameIdentifier $sponameidentifier -displayName "SharePoint Online"
$spoappprincipalID = (Get-MsolServicePrincipal -ServicePrincipalName $spoappid).ObjectID
$sponameidentifier = "$spoappprincipalID@$spocontextID"
$appPrincipal = Register-SPAppPrincipal -site $site.rootweb -nameIdentifier $sponameidentifier -displayName "SharePoint Online"
La commande PowerShell ci-dessous va permettre la définition du « Realm » de SharePoint :
Set-SPAuthenticationRealm -realm $spocontextID
Enfin, nous allons créer un « Service Application Proxy » pour Windows Azure AD.
New-SPAzureAccessControlServiceApplicationProxy -Name "ACS" -MetadataServiceEndpointUri $metadataEndpoint -DefaultProxyGroup New-SPTrustedSecurityTokenIssuer -MetadataEndpoint $metadataEndpoint -IsTrustBroker:$true -Name "ACS"
New-SPAzureAccessControlServiceApplicationProxy -Name "ACS" -MetadataServiceEndpointUri $metadataEndpoint -DefaultProxyGroup
New-SPTrustedSecurityTokenIssuer -MetadataEndpoint $metadataEndpoint -IsTrustBroker:$true -Name "ACS"
Validation de la création du proxy :
· Dans l’administration centrale de SharePoint, cloquez sur “Security”
· Dans la section « General Security » cliquez sur « Manage Trust »
· Vérifiez qu’une entrée « ACS », ou le nom que vous lui avez donné, existe
#region Replace STS Certificate
Add-PSSnapin Microsoft.SharePoint.Powershell
$pfxPath = "C:\Temp\franmerPFX.pfx"
$pfxPass = "Pass@word1"
$stsCertificate = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 $pfxPath, $pfxPass, 20
Set-SPSecurityTokenServiceConfig -ImportSigningCertificate $stsCertificate
certutil -addstore -enterprise -f -v root $stsCertificate
iisreset
net stop SPTimerV4
net start SPTimerV4
#endregion
#region Load Modules
Add-PSSnapin Microsoft.SharePoint.PowerShell
Import-Module Microsoft.PowerShell.Utility
Import-Module MSOnline –force
Import-Module MSOnlineExtended –force
Import-Module Microsoft.Online.SharePoint.PowerShell -force
#region log to SharePoint Online
$cred=Get-Credential
Connect-MsolService –Credential $cred
#region Définition des variables
$spcn="*.SharePoint.com"
$spsite=Get-Spsite http://ITCampSP1
#region Upload STS certificate to SP Online
$cerPath = "C:\Temp\Export_IIS_Franmer.cer"
New-MsolServicePrincipalCredential -AppPrincipalId $spoappid -Type asymmetric -Usage Verify -Value $credValue -StartDate 10/23/2013 -EndDate 9/27/2014
#region Add SPN for the public domain name
#Modification par rapport à la fiche technet
#region Register the SharePoint Online application principal
#region Set the SharePoint authentication Realm
#region Configure On-premises proxy for Azure AD
Au plaisir de vous voir lors d’un IT Camp SQL 2014/Power BI.
Franck Mercier
Pour tester Windows Server 2012, Windows 8, SQL Server 2012, SQL Server 2014 CTP2 et Power BI, vous pouvez télécharger gratuitement la version d’évaluation disponible sous la forme :
Windows Server 2012 :
SQL Server 2012 :
Evaluation SQL Server 2014 CTP2 :
Evaluation Power BI :
Testez Azure gratuitement pendant un mois :
Jeu : Tentez de gagner votre livre numérique ! Tentez de gagner votre livre numérique !
Téléchargez une version d’évaluation gratuite et tentez de gagner votre e-book !
Un gagnants tous les 10 téléchargements.
Windows 8, déploiement et migration Décelez tout ce qu’il faut savoir sur le déploiement et la migration vers Windows 8.
Il est offert en partenariat avec les éditions EYROLLES, tous les 10 téléchargements d’une version d’évaluation gratuite de Windows Server 2012 R2, ou System Center 2012 R2.