mirror of
https://dev.azure.com/effectory/Survey%20Software/_git/Cloud%20Engineering
synced 2026-02-27 18:52:18 +01:00
43 lines
1.6 KiB
PowerShell
43 lines
1.6 KiB
PowerShell
#Connect-AzAccount
|
|
|
|
class ResourceCheck {
|
|
[string] $ResourceId = ""
|
|
[string] $Id = ""
|
|
[string] $Kind = ""
|
|
[string] $Location = ""
|
|
[string] $ResourceName = ""
|
|
[string] $ResourceGroupName = ""
|
|
[string] $ResourceType = ""
|
|
[string] $SubscriptionId = ""
|
|
[string] $SubscriptionName = ""
|
|
[string] $Tag_Team = ""
|
|
[string] $Tag_Product = ""
|
|
[string] $Tag_Environment = ""
|
|
[string] $Tag_Data = ""
|
|
[string] $Tag_Delete = ""
|
|
[string] $Tag_Split = ""
|
|
}
|
|
|
|
Write-Host "========================================================================================================================================================================"
|
|
Write-Host "Creating policy assignment overview."
|
|
Write-Host "========================================================================================================================================================================"
|
|
|
|
# $subscriptions = Get-AzSubscription
|
|
|
|
# $fileName = "c:\temp\2020-08-12 azure_policies.csv"
|
|
# rm $fileName
|
|
|
|
# foreach ($subscription in $subscriptions)
|
|
# {
|
|
# Set-AzContext -SubscriptionId $subscription.Id
|
|
|
|
# $allAssignments = Get-AzPolicyAssignment
|
|
# $allAssignments | Export-Csv -Path $fileName -Append -NoTypeInformation
|
|
# }
|
|
|
|
$fileName = "c:\temp\2020-08-14 azure_policiy_definitions.csv"
|
|
Get-AzPolicyDefinition -Builtin | Export-Csv -Path $fileName -NoTypeInformation
|
|
|
|
Write-Host "========================================================================================================================================================================"
|
|
Write-Host "Done."
|