All Projects → dgoldman-msft → PSServicePrincipal

dgoldman-msft / PSServicePrincipal

Licence: MIT license
PowerShell module for creating and deleting enterprise and registered applications as well as SPN object (single and batch) for automation. This can be used as a facilitator for setting up Exchange PowerShell CBA

Programming Languages

powershell
5483 projects

Projects that are alternatives of or similar to PSServicePrincipal

cryptomkt-node
CryptoMarket Node SDK
Stars: ✭ 21 (+50%)
Mutual labels:  exchange
conduit
Conduit - Open Source 0x Relayer API implemented in NodeJS
Stars: ✭ 18 (+28.57%)
Mutual labels:  exchange
Microsoft365
Manage Microsoft 365 with PowerShell
Stars: ✭ 30 (+114.29%)
Mutual labels:  exchange
idex-sdk-js
IDEX v3 SDK built with TypeScript, supporting both web and Node environments.
Stars: ✭ 35 (+150%)
Mutual labels:  exchange
PSBlackListChecker
Basic functionality of this module is ability to quickly verify if given IP address is on any of over 80 defined DNSBL lists. Below code will return results only if IP is on any of the lists. Advanced functionality of this module is ability to send reports to your email when things get bad on one of those 80 defined DNSBL listrs.
Stars: ✭ 50 (+257.14%)
Mutual labels:  exchange
binance-pump-bot
Automation for Binance p&d(pump and dump) activity, ensures fastest purchase and provides auto selling functionality to lockdown profit during these events.
Stars: ✭ 112 (+700%)
Mutual labels:  exchange
Firepower O365 Feed Parser
This is a Sample Script that can parse the O365 Web Service API and upload it to Firepower Management Center as Group Objects.
Stars: ✭ 56 (+300%)
Mutual labels:  o365
QuickTeams
Download, Clone, Archive, Un-Archive your Microsoft Teams and manage the apps you've installed to them
Stars: ✭ 31 (+121.43%)
Mutual labels:  o365
allsafe
Intentionally vulnerable Android application.
Stars: ✭ 135 (+864.29%)
Mutual labels:  certificate
3dub
www dev server with livereload, file watching, http2, https, self signed cert generation
Stars: ✭ 28 (+100%)
Mutual labels:  certificate
components
Example Components (Built with Tonic)
Stars: ✭ 62 (+342.86%)
Mutual labels:  cba
testnet.backend
Backend for a ViaBTC exchange server (trading engine)
Stars: ✭ 18 (+28.57%)
Mutual labels:  exchange
LetsEncrypt
C# layer for generation of wildcard Let's Encrypt SSL certificates
Stars: ✭ 67 (+378.57%)
Mutual labels:  certificate
powerbi-embed-v2
Power BI Embedded with Custom Controls PoC
Stars: ✭ 34 (+142.86%)
Mutual labels:  azuread
coinbase-pro-rs
Coinbase pro client for Rust
Stars: ✭ 127 (+807.14%)
Mutual labels:  exchange
binance-client-websocket
🛠️ C# client for Binance websocket API
Stars: ✭ 41 (+192.86%)
Mutual labels:  exchange
blessclient
Go client to negotiate SSH certificates
Stars: ✭ 58 (+314.29%)
Mutual labels:  certificate
Remove-DuplicateItems
Script to remove duplicate items from Exchange mailboxes.
Stars: ✭ 32 (+128.57%)
Mutual labels:  exchange
acme2
Another PHP client for acme protocal (version 2) implementation, used for generating letsencrypt's free ssl certificates.
Stars: ✭ 45 (+221.43%)
Mutual labels:  certificate
cryptocli
The ultimate tool for data transfer, manipulation and proxy.
Stars: ✭ 16 (+14.29%)
Mutual labels:  certificate

Description

This is a PowerShell module that will help in the creation (single and batch) enterprise, registered applications / service principals to be used with Microsoft application development. Application that connect to Office 365 will no longer be able to use Basic Authentication because it is being deprecated. This means that PowerShell will need a secure way to connect (interactively and automated) to Azure applications. For application workloads that require CBA (Certificate Based Authentication) (I.E Microsoft Exchange PowerShell) you can use this module to automate the onboarding of the necessary requirements that will allow you to connect using certificates. This method cuts down the 10-15 minutes of manual creation to just under a minute for single application creation.

NOTE: Due to incompatibility issues with the AzureAD module and PowerShell core at this time this module will only run on Windows PowerShell 5.X. If you try to run this on Module on PowerShell core it will partial run but you will not be able to create service principals and applications and will receive the following error: At this time AzureAD PowerShell module does not work on PowerShell Core. Please use PowerShell version 5 or 6 to create Registered Applications. Once the AzureAD module is PowerShell compatible this module will be updated accordingly.

Getting Started with PSServicePrincipal

  1. First open a new PowerShell console as 'Administrator' and run the following command:
Install-Module -Name PSServicePrincipal

This will install the PSServicePrincipal module into your local PowerShell module path.

  1. Run the following command:
Import-Module PSServicePrincipal

This will import the PSServicePrincipal module into your local PowerShell session. If you have any problems you can download the nupkg file directly from the PowerShell Gallery: https://www.powershellgallery.com/packages/PSServicePrincipal/1.0.11

At this point you have installed and loaded the PSServicePrincipal module and you are ready to create new service principals.

Example

1. Open PowerShell as an administrator
2. New-ServicePrincipalObject -DisplayName 'ExchangeCBAApp' -RegisteredApp -Cba -CreateSingleObject

In the above example we will create a new service principal object in the Azure tenant with a display name of 'ExchangeCBAApp', and we are passing in three argument switches. These three switches instruct the PSServicePrincipal module to do the following:

  1. -RegisteredApp will create a registered Azure application (different from an Azure enterprise application).
  2. -Cba will perform the following steps: a. Create a Self-Signed certificate (which will be stored locally as uploaded to the newly created Azure application. You just supply a DNS name and password for the certificate. b. Export the certificate (.pfx and .cer) files to your drive. c. Import the certificate to your local user certificate store. d. Import the certificate thumbprint to your newly created registered Azure tenant application. e. Apply the necessary api rights (Exchange.ManageAsApp) permissions to your application. (This is needed for unattended automation)
  3. -CreateSingleObjectCreate will make sure we create a single service principal object (different from batch creation).

This will allow for a local interactive PowerShell session to connect to Exchange Online via CBA. If your intent is to use unattended automation you will need to copy the certificate from the local user certificate store to the computer's localMachine certificate store.

The last step you need to do is manually verify the settings and grant consent to the application to allow access.

  1. Select the 'Azure Active Directory' option
  2. Select 'App Registrations'
  3. Select your application from the application list
  4. Select Certificates & secrets and verify the certificate thumbprint has been added successfully.
  5. Select 'API Permissions' to verify that 'Exchange.ManageAsApp' has been added successfully.
  6. Select 'Grant Admin Consent for 'YourDomain' (Default Directory).

This will apply the permissions to the application in the tenant. Please allow up to 2 hours for Azure AD replication to take effect.

  1. Add your application to an Azure security RBAC role that you want your application to have rights for. (This is based on your security model).
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].