Created
May 24, 2016 23:22
-
-
Save shawnweisfeld/4d3d70d9d9e04642a81f96195824842c to your computer and use it in GitHub Desktop.
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
$Password = '<<my password>>' | |
Login-AzureRmAccount | |
$azureAdApplication = New-AzureRmADApplication -DisplayName "MyPoshApp" -HomePage "https://www.contoso.org" -IdentifierUris "https://www.contoso.org/example" -Password $Password | |
$azureAdApplication | |
DisplayName : MyPoshApp | |
Type : Application | |
ApplicationId : <<ApplicationID>> | |
ApplicationObjectId : <<Application Object ID>> | |
AvailableToOtherTenants : False | |
AppPermissions : {} | |
IdentifierUris : {https://www.contoso.org/example} | |
ReplyUrls : {} | |
New-AzureRmADServicePrincipal -ApplicationId $azureAdApplication.ApplicationId | |
New-AzureRmRoleAssignment -RoleDefinitionName Owner -ServicePrincipalName $azureAdApplication.ApplicationId.Guid | |
RoleAssignmentId : /subscriptions/<<GUID>>/providers/Microsoft.Authorization/roleAssignments/<<GUID>> | |
Scope : /subscriptions/<<GUID>> | |
DisplayName : MyPoshApp | |
SignInName : | |
RoleDefinitionName : Owner | |
RoleDefinitionId : <<GUID>> | |
ObjectId : <<GUID>> | |
ObjectType : ServicePrincipal | |
Get-AzureRmSubscription | |
SubscriptionName : Visual Studio Enterprise | |
SubscriptionId : <<GUID>> | |
TenantId : <<TenantID GUID>> | |
State : Enabled | |
$secretvalue = ConvertTo-SecureString $Password -AsPlainText -Force | |
$SecureStringAsPlainText = $secretvalue | ConvertFrom-SecureString | |
$SecureStringAsPlainText | Out-File c:\temp\pwd.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment