Here, you can find detailed information on using our "ready to au2mate" PowerShell Scripts.
TABLE OF CONTENTS
Credentials
We use stored "Credentials" in our PowerShell Scripts to make it easier for you to deploy.
The following list should help you see the "Credentials" we are using.
Name | Variable for Cred | Variable for File | Filename |
SMTP Credentials | $SMTPcredential | $SMTPcredential_File | SMTPCreds.xml |
Teams Graph API | $TeamsCred | $TeamsCred_File | TeamsCreds.xml |
Azure REST API | $AzureRestAPICred | $AzureRestAPICred_File | AzureRestCreds.xml |
Azure Graph API | $AzureADGraphAPICred | $AzureADGraphAPICred_File | AzureADCreds.xml |
Mail Graph API | $AzureGraphMailCred | $AzureGraphMailCred_File | AzureGraphMailCreds.xml |
MS Graph API | $MSGraphAPICred | MSGraphAPICred_File | MSGraphAPICred.xml |
SMTP Credentials
These Credentials are used to send Emails via SMTP.
$credential = Get-Credential $credential | Export-CliXml -Path 'C:\TFS\PS-Services\CredentialStore\SMTPCreds.xml'
Teams Graph API
It is used to send Teams Adaptive Cards via Graph API
Create an Azure App Registration with the following “Delegated MS GRAPH API” Permissions
- User.Read
- User.ReadWrite
- User.ReadBasic.All
- User.Read.All
- User.ReadWrite.All
- GroupMember.Read.All
- Directory.AccessAsUser.All
- Channel.ReadBasic.All
- ChannelSettings.Read.All
- ChannelSettings.ReadWrite.All
- Group.Read.All
- Group.ReadWrite.All
- Directory.Read.All
- Directory.ReadWrite.All
- ChannelMessage.Send
- Chat.Create
- Chat.ReadWrite
- ChatMessage.Send
- Chat.ReadWrite
You need to create an Azure App Registration with appropriate Rights.
See MS Documentations for Details
Graph API Documentation: Use the Microsoft Graph API to work with Microsoft Teams - Microsoft Graph v1.0 | Microsoft Docs
Azure App: Register your app with the Azure AD v2.0 endpoint - Microsoft Graph | Microsoft Docs
[hashtable]$values = @{ } $values.clientId = "a0000a00-0e0d-000e-aaaf-ed000b00df00" $values.clientSecret = "~V00gCE~aAUW-0oRd~I0LQYAof00r-r0z0" $values.tenantName = "tenant.onmicrosoft.com" $values.User= "usernam@domain.com" $values.PW = "yoursupperpassword" $values| Export-CliXml -Path 'C:\TFS\PS-Services\CredentialStore\TeamsCreds.xml'
Azure Rest API
These credentials are used to make MS GRAPH API Rest Calls and execute the Actions needed in our Scripts.
Create an Azure App Registration with the following “Application MS GRAPH API” Permissions
- Application.ReadWrite.All
- Application.ReadWrite.OwnedBy
- User.Read
[hashtable]$values = @{ } $values.clientId = "a0000a00-0e0d-000e-aaaf-ed000b00df00" $values.clientSecret = "V00gCE~aAUW-0oRd~I0LQYPJ4-vxg-2x3" $values.tenantID = "a0ba3ab6-fde5-0000-000d-e000c00dc000" $values| Export-CliXml -Path 'C:\_SCOworkingDir\TFS\PS-Services\CredentialStore\MSGraphAPICred.xml.xml'
Azure Graph API
These credentials are used to make REST API Calls and execute the Actions needed in our Scripts.
- Create an Azure App Reg
- Add Azure App Reg the Contributor Role in your Subscription
- List, Start, and Stop VM (Details: https://www.techguy.at/control-azure-vm-with-powershell-and-azure-rest-api)
[hashtable]$values = @{ } $values.clientId = "a0000a00-0e0d-000e-aaaf-ed000b00df00" $values.clientSecret = "V00gCE~aAUW-0oRd~I0LQYPJ4-vxg-2x3" $values.tenantID = "a0ba3ab6-fde5-0000-000d-e000c00dc000" $values| Export-CliXml -Path 'C:\_SCOworkingDir\TFS\PS-Services\CredentialStore\AzureRestCreds.xml'
Mail Graph API
MS Graph API
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article