Advertisement
mariussm

PowerShell - ADFS SharePoint

Jun 1st, 2014
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Add-PSSnapin "Microsoft.SharePoint.PowerShell"
  2.  
  3. $cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2("C:\users\mariussm.gwrnd\downloads\adfs.goodworkaround.com-PUBLIC.cer")
  4. $idclaim = New-SPClaimTypeMapping "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/privatepersonalidentifier" -IncomingClaimTypeDisplayName "Account ID" –SameAsIncoming
  5.  
  6. $map = @($idclaim)
  7. # Optional additional claims:
  8. # $map += New-SPClaimTypeMapping “http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name” -IncomingClaimTypeDisplayName “Display Name” –LocalClaimType “http://schemas.goodworkaround.com/identity/claims/name"
  9. # $map += New-SPClaimTypeMapping "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname" -IncomingClaimTypeDisplayName "Surname" –SameAsIncoming
  10. # $map += New-SPClaimTypeMapping "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname" -IncomingClaimTypeDisplayName "Givenname" –SameAsIncoming
  11.  
  12. $realm = "urn:sharepoint:azuresp1"
  13. $signinurl = "https://adfs.goodworkaround.com/adfs/ls/"
  14.  
  15. New-SPTrustedIdentityTokenIssuer -Name "adfs.goodworkaround.com" -Description "ADFS 3.0 Goodworkaround" -Realm $realm -ImportTrustCertificate $cert -ClaimsMappings $map -SignInUrl $signinurl -IdentifierClaim $idclaim.InputClaimType
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement