Code Snippets

Linux_Docker02

Linux_Docker02

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add – add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable"

Linux_Docker01

Linux_Docker01

apt-get update apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg-agent \ software-properties-common

Linux_Docker04

Linux_Docker04

timedatectl set-timezone Europe/Vienna

Password in Powershell Script #004

Password in Powershell Script #004

### Step 1: Creating Securestring encrypted with AES Key $AESKey = New-Object Byte[] 32 [Security.Cryptography.RNGCryptoServiceProvider]::Create().GetBytes($AESKey) $AESKey | Out-File .\Desktop\aes.key $password = Read-Host -AsSecureString $password | ConvertFrom-SecureString -Key $AESKey | Out-File .\Desktop\password.txt ### Step 2: Using Securestring and AES Key in Scripts $username = "Administrator" $AESKey = Get-Content .\Desktop\aes.key $password = Get-Content .\Desktop\password.txt | ConvertTo-SecureString -Key...

Password in Powershell Script #003

Password in Powershell Script #003

### Step 1: Creating Securestring $password = Read-Host -AsSecureString $password | ConvertFrom-SecureString | Out-File .\Desktop\password.txt ### Step 2: Using Securestring in Scripts $username = "Administrator" $password = Get-Content .\Desktop\password.txt | ConvertTo-SecureString $credentials = New-Object System.Management.Automation.PSCredential (“$username”, $password)

Password in Powershell Script #002

Password in Powershell Script #002

$password = "Test1234" | ConvertTo-SecureString -AsPlainText -Force $username = "Administrator" $credentials = New-Object System.Management.Automation.PSCredential (“username”, $password)

Password in Powershell Script #001

Password in Powershell Script #001

Write-Host "Bitte geben Sie die Benutzerdaten ein" $credentials = Get-Credential -Credential Administrator

Exchange: Admin Audit Log #001

Exchange: Admin Audit Log #001

RunspaceId : 6ac12cb7-50d4-409f-988a-db75b052e5bb ObjectModified : /schweigers.at/Users/Kevin CmdletName : Set-Mailbox CmdletParameters : {Identity, DisplayName} ModifiedProperties : {DisplayName} Caller : api@schweigers.local ExternalAccess : False Succeeded : True Error : RunDate : 01.06.2020 20:07:22 OriginatingServer : EX01 (15.01.1979.002) Identity : AAMkAGZhYTY4ZTJhLTkyNjctNDc5Ny1hMjYyLWRmZWE5Yjk1YWFmOABGAAAAAACuoKglPoqYSYE1e/HZITnnBwADdTJFuJn4Rb j9jGDdbjGxAAAAAAEbAAADdTJFuJn4Rbj9jGDdbjGxAADhP9DGAAA= IsValid : True ObjectState : New

ServiceDesk: Add-RoleGroupMember

ServiceDesk: Add-RoleGroupMember

[PS] C:\Windows\system32>Add-RoleGroupMember -Identity "Service Desk" -Member Max.Mustermann

ServiceDesk: New-ManagementRoleAssignment

ServiceDesk: New-ManagementRoleAssignment

[PS] C:\Windows\system32>New-ManagementRoleAssignment -Role "Mail Recipients" -SecurityGroup "Service Desk" -RecipientOrganizationalUnitScope "schweigers.local/Schweigers/User" [PS] C:\Windows\system32>New-ManagementRoleAssignment -Role "Message Tracking" -SecurityGroup "Service Desk" -RecipientOrganizationalUnitScope "schweigers.local/Schweigers/User" [PS] C:\Windows\system32>New-ManagementRoleAssignment -Role "Reset Password" -SecurityGroup "Service Desk" -RecipientOrganizationalUnitScope "schweigers.local/Schweigers/User" [PS] C:\Windows\system32>New-ManagementRoleAssignment -Role "User Options" -SecurityGroup "Service Desk" -RecipientOrganizationalUnitScope "schweigers.local/Schweigers/User"