mirror of
https://dev.azure.com/effectory/Survey%20Software/_git/Cloud%20Engineering
synced 2026-02-27 18:52:18 +01:00
cusom roles for locks
This commit is contained in:
@@ -16,6 +16,8 @@ class ResourceCheck {
|
||||
[string] $Tag_Data = ""
|
||||
[string] $Tag_Delete = ""
|
||||
[string] $Tag_Split = ""
|
||||
[string] $Tag_CreatedOnDate = ""
|
||||
[string] $Tag_Deployment = ""
|
||||
}
|
||||
|
||||
Write-Host "========================================================================================================================================================================"
|
||||
@@ -24,7 +26,7 @@ Write-Host "====================================================================
|
||||
|
||||
$subscriptions = Get-AzSubscription | Where-Object State -eq "Enabled"
|
||||
|
||||
$fileName = "c:\temp\2022-07-29 azure_resources.csv"
|
||||
$fileName = "c:\temp\2023-03-08 azure_resources.csv"
|
||||
#rm $fileName
|
||||
|
||||
foreach ($subscription in $subscriptions)
|
||||
@@ -52,7 +54,8 @@ Set-AzContext -SubscriptionId $subscription.Id
|
||||
$resourceCheck.Tag_Data = $resource.Tags.data
|
||||
$resourceCheck.Tag_Delete = $resource.Tags.delete
|
||||
$resourceCheck.Tag_Split = $resource.Tags.split
|
||||
|
||||
$resourceCheck.Tag_CreatedOnDate = $resource.Tags.CreatedOnDate
|
||||
$resourceCheck.Tag_Deployment = $resource.Tags.drp_deployment
|
||||
$Result += $resourceCheck
|
||||
}
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@ Write-Host "====================================================================
|
||||
|
||||
$subscriptions = Get-AzSubscription | Where-Object State -eq "Enabled"
|
||||
|
||||
$fileName = "c:\temp\2022-08-04 azure_webapps.csv"
|
||||
rm $fileName
|
||||
$fileName = "c:\temp\2023-03-15 azure_webapps.csv"
|
||||
# rm $fileName
|
||||
|
||||
foreach ($subscription in $subscriptions)
|
||||
{
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
#Get-AzRoleDefinition 'Storage Data Contributor' | ConvertTo-Json
|
||||
|
||||
Set-AzRoleDefinition -InputFile 'C:\Repository\Cloud Engineering\Cloud Engineering\Custom roles\Storage Data Contributor.json'
|
||||
|
||||
$fileName = "c:\temp\subscriptions.csv"
|
||||
Get-AzSubscription | Export-Csv -Path $fileName -NoTypeInformation
|
||||
|
||||
|
||||
|
||||
Set-AzRoleDefinition -InputFile 'C:\Repository\Cloud Engineering\Custom roles\Storage Data Contributor.json'
|
||||
Set-AzRoleDefinition -InputFile 'C:\Repository\Cloud Engineering\Custom roles\Storage Data Reader.json'
|
||||
New-AzRoleDefinition -InputFile 'C:\Repository\Cloud Engineering\Custom roles\Resource Lock Administrator.json'
|
||||
Reference in New Issue
Block a user