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
# see "man logrotate" for details | |
# rotate log files weekly | |
weekly | |
# keep 4 weeks worth of backlogs | |
rotate 1 | |
# create new (empty) log files after rotating old ones | |
create |
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
/var/log/cron | |
/var/log/maillog | |
/var/log/messages | |
/var/log/secure | |
/var/log/spooler | |
{ | |
missingok | |
sharedscripts | |
postrotate |
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
win: | |
hosts: | |
192.168.57.4 | |
vars: | |
ansible_user: Administrator | |
ansible_password: <myPassword> | |
ansible_connection: winrm | |
ansible_port: 5986 | |
ansible_winrm_scheme: https | |
ansible_winrm_server_cert_validation: ignore |
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
function loginAzure { | |
param ( | |
$tenantID, | |
$azUserName, | |
[securestring]$azSecPassword, | |
$azIsServicePrincipal | |
) | |
# Logout of any pervious AzureRM account | |
try { | |
Logout-AzureRmAccount -ErrorAction Stop |
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
# Provide Local user credentials - No Guest user | |
# This user should be having permission to set/remove permissions on subscriptions | |
Login-AzureRmAccount -Credential (Get-Credential) | |
# Get all subscriptions and loop | |
foreach ($sub in (Get-AzureRmSubscription)){ | |
# Follow this link to view application ID | |
# https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal#get-application-id-and-authentication-key | |
$application = Get-AzureRmADServicePrincipal -ApplicationId (Read-Host -Prompt 'Enter Azure Application ID') | |
$scope = [string]::Concat('/subscriptions/', $sub.ID) | |
try { |
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
Get-AzureRmResourceGroupDeployment -ResourceGroupName 'winVMTest'|Select-Object -Skip 100 | Remove-AzureRmResourceGroupDeployment |
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
## Powershell script referenced from http://keepingitgeek.blogspot.com/2015/01/grant-sql-server-account-access-to-lock.html | |
## Powershell script was converted to a DSC module for implementation. | |
Configuration createServiceUserUser { | |
param( | |
# Parameter help description | |
[Parameter(Mandatory)] | |
[string] | |
$VMHostName, | |
# Parameter help description | |
[Parameter(Mandatory)] |
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
###################################################################### | |
# Powershell Script to unlock Backup Vault Restore point collections.# | |
###################################################################### | |
$resources = Get-AzureRmResource | |
$resourceTypeToUnlock = 'Microsoft.Compute/restorePointCollections' | |
foreach ($resource in $resources) | |
{ | |
if($resource.ResourceType -eq $resourceTypeToUnlock){ | |
$lock = Get-AzureRmResourceLock -ResourceName $resource.Name -ResourceType $resourceTypeToUnlock -ResourceGroupName $resource.ResourceGroupName | |
if($null -ne $lock){ |
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
## Install Module - ensure you are running powershell as Administrato | |
Install-Module -Name BaselineManagement | |
## Import installed module to powershell | |
Import-Module BaselineManagement | |
## Export GPO to DSC | |
ConvertFrom-GPO -Path .\2012R2\ |
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
#Requires -Module AzTable | |
$auditfilterStorageAcc = '<yourStorageAccount>' | |
$auditfilterStorageAccRg = '<yourStorageAccoutResourceGroup' | |
$tableName = '<tableStorageName>' | |
function getStorageAcconts{ | |
$context = (Get-AzStorageAccount -Name $auditfilterStorageAcc -ResoruceGroupName $auditfilterStorageAccRg).context | |
$table = (Get-AzStorageTable -name $tableName -context $context).CloudTable | |
$result = Get-AzTableRow -Table $table -ParitionKey 'filterStorage' |
OlderNewer