az deployment group create --resource-group "rg-data" --template-file dcr.bicep --parameters "workspaceName=log-arc-001" "dcrName=dcr-test-001" "workspaceResourceGroupName=rg-arc" "location=westeurope"
This file contains hidden or 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
| namespace AppRegExo; | |
| /// <summary> | |
| /// Strongly-typed configuration bound from the "ExchangeOnline" section of appsettings.json. | |
| /// </summary> | |
| public sealed class AppSettings | |
| { | |
| /// <summary>Azure AD (Entra ID) directory/tenant ID.</summary> | |
| public string TenantId { get; set; } = string.Empty; |
This file contains hidden or 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
| name: Deploy Azure Function App | |
| on: | |
| push: | |
| paths: | |
| - 'azf/**' | |
| branches: [ main ] | |
| workflow_dispatch: | |
| # CONFIGURATION |
This file contains hidden or 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
| Connect-MgGraph -Scopes "User.Read.All", "Group.Read.All", "Domain.ReadWrite.All", "AuditLog.Read.All" | |
| $guests = Get-MgUser -Filter "userType eq 'Guest'" -ExpandProperty "memberOf" -Property "createdDateTime", "signInActivity", "displayName", "userPrincipalName", "mail", "userType" | |
| [array]$guestsReport = @() | |
| $guest = $guests | Select-Object -First 1 | |
| foreach($guest in $guests) { | |
| "{0} [{1}] (groups: {2}); Created = {3}; Last Sign In = {4}" -f $guest.DisplayName, $guest.userPrincipalName, $guest.memberOf.Count, $guest.createdDateTime, $guest.signInActivity.lastSignInDateTime |
This file contains hidden or 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
| install-module Microsoft.Graph.Users, Microsoft.Graph.Identity.SignIns, Microsoft.Graph.Groups | |
| Connect-MgGraph -Scopes 'User.ReadWrite.All', 'GroupMember.ReadWrite.All', 'Group.ReadWrite.All' | |
| $groupId = "c259b03c-6b11-44ea-a768-76b077d2cb93" | |
| $invite = [PSCustomObject]@{ | |
| mail = "test@firma.cz" | |
| name = "Franta Novák" | |
| } |
This file contains hidden or 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
| <# setup | |
| Connect-AzureAD | |
| $PasswordProfile = New-Object -TypeName Microsoft.Open.AzureAD.Model.PasswordProfile | |
| $PasswordProfile.Password = "<SecretPassword>" | |
| $PasswordProfile.ForceChangePasswordNextLogin = $false | |
| $user = New-AzureADUser ` | |
| -DisplayName "Photo Syncer" ` | |
| -PasswordProfile $PasswordProfile ` | |
| -UserPrincipalName "<UserName>" ` |
This file contains hidden or 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
| preview |
This file contains hidden or 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
| $configFilePath = "$($env:USERPROFILE)\aad.cnf" | |
| $data = Get-Content $configFilePath | |
| $config = [System.Text.Encoding]::Unicode.GetString([Convert]::FromBase64String($data)) | ConvertFrom-Json | |
| $token = Invoke-ClientCredentialsFlow -Tenant $config.TenantId -ClientId $config.ClientId -ClientSecret $config.ClientSecret | |
| $headers = @{ | |
| "Authorization" = "Bearer $($token.AccessToken)" | |
| } | |
| # Get AAD Users. |
This file contains hidden or 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
| $nsgName = "litware-sccm012021-05-10T04-44-28-34" | |
| $nsgResourceGroup = "litware-infra" | |
| $priority = 200 | |
| $sourceAddressPrefix = "*" # zdrojový server/prefix pro odesílání SMTP přes ExO | |
| #region Helper functions | |
| function Set-NsgRule { | |
| param( | |
| $nsg, | |
| $smtpEndpoint, |
NewerOlder