mirror of
https://dev.azure.com/effectory/Survey%20Software/_git/Cloud%20Engineering
synced 2026-02-27 10:45:02 +01:00
Subscription pim settings #99024
This commit is contained in:
@@ -66,29 +66,29 @@ foreach ($managementGroup in $managementGroups)
|
||||
UpdatePolicy -scope $scope -roleManagementPolicyName $assignmentName -patchValue $patchValue
|
||||
}
|
||||
|
||||
# $subscriptions = Get-AzManagementGroupSubscription -Group $managementGroup.Name | Where-Object State -eq "Active"
|
||||
$subscriptions = Get-AzManagementGroupSubscription -Group $managementGroup.Name | Where-Object State -eq "Active"
|
||||
|
||||
# foreach ($subscription in $subscriptions)
|
||||
# {
|
||||
# Write-Host " --------------------------------------------------------------------"
|
||||
foreach ($subscription in $subscriptions)
|
||||
{
|
||||
Write-Host " --------------------------------------------------------------------"
|
||||
|
||||
# $scope = $subscription.Id.Substring($subscription.Parent.Length, $subscription.Id.Length - $subscription.Parent.Length)
|
||||
# $subscriptionId = $scope.Replace("/subscriptions/", "")
|
||||
# Write-Host " Subscription [$($subscription.DisplayName) - $subscriptionId]"
|
||||
# Write-Host " --------------------------------------------------------------------"
|
||||
$scope = $subscription.Id.Substring($subscription.Parent.Length, $subscription.Id.Length - $subscription.Parent.Length)
|
||||
$subscriptionId = $scope.Replace("/subscriptions/", "")
|
||||
Write-Host " Subscription [$($subscription.DisplayName) - $subscriptionId]"
|
||||
Write-Host " --------------------------------------------------------------------"
|
||||
|
||||
# $assignments = GetAllPolicies -scope $scope | Where-Object {
|
||||
# $prop = $_.properties
|
||||
# if ($prop.LastModifiedDateTime) { return $_ }
|
||||
# }
|
||||
$assignments = GetAllPolicies -scope $scope | Where-Object {
|
||||
$prop = $_.properties
|
||||
if ($prop.LastModifiedDateTime) { return $_ }
|
||||
}
|
||||
|
||||
# foreach ($assignment in $assignments)
|
||||
# {
|
||||
# $assignmentName = $assignment.name
|
||||
# Write-Host " Updating assignment [$($assignment.id)]"
|
||||
# UpdatePolicy -scope $scope -roleManagementPolicyName $assignmentName -patchValue $patchValue
|
||||
# }
|
||||
# }
|
||||
foreach ($assignment in $assignments)
|
||||
{
|
||||
$assignmentName = $assignment.name
|
||||
Write-Host " Updating assignment [$($assignment.id)]"
|
||||
UpdatePolicy -scope $scope -roleManagementPolicyName $assignmentName -patchValue $patchValue
|
||||
}
|
||||
}
|
||||
}
|
||||
Write-Host "=========================================================================================="
|
||||
Write-Host "Done."
|
||||
|
||||
Reference in New Issue
Block a user