mirror of
https://dev.azure.com/effectory/Survey%20Software/_git/Cloud%20Engineering
synced 2026-02-27 18:52:18 +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
|
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)
|
foreach ($subscription in $subscriptions)
|
||||||
# {
|
{
|
||||||
# Write-Host " --------------------------------------------------------------------"
|
Write-Host " --------------------------------------------------------------------"
|
||||||
|
|
||||||
# $scope = $subscription.Id.Substring($subscription.Parent.Length, $subscription.Id.Length - $subscription.Parent.Length)
|
$scope = $subscription.Id.Substring($subscription.Parent.Length, $subscription.Id.Length - $subscription.Parent.Length)
|
||||||
# $subscriptionId = $scope.Replace("/subscriptions/", "")
|
$subscriptionId = $scope.Replace("/subscriptions/", "")
|
||||||
# Write-Host " Subscription [$($subscription.DisplayName) - $subscriptionId]"
|
Write-Host " Subscription [$($subscription.DisplayName) - $subscriptionId]"
|
||||||
# Write-Host " --------------------------------------------------------------------"
|
Write-Host " --------------------------------------------------------------------"
|
||||||
|
|
||||||
# $assignments = GetAllPolicies -scope $scope | Where-Object {
|
$assignments = GetAllPolicies -scope $scope | Where-Object {
|
||||||
# $prop = $_.properties
|
$prop = $_.properties
|
||||||
# if ($prop.LastModifiedDateTime) { return $_ }
|
if ($prop.LastModifiedDateTime) { return $_ }
|
||||||
# }
|
}
|
||||||
|
|
||||||
# foreach ($assignment in $assignments)
|
foreach ($assignment in $assignments)
|
||||||
# {
|
{
|
||||||
# $assignmentName = $assignment.name
|
$assignmentName = $assignment.name
|
||||||
# Write-Host " Updating assignment [$($assignment.id)]"
|
Write-Host " Updating assignment [$($assignment.id)]"
|
||||||
# UpdatePolicy -scope $scope -roleManagementPolicyName $assignmentName -patchValue $patchValue
|
UpdatePolicy -scope $scope -roleManagementPolicyName $assignmentName -patchValue $patchValue
|
||||||
# }
|
}
|
||||||
# }
|
}
|
||||||
}
|
}
|
||||||
Write-Host "=========================================================================================="
|
Write-Host "=========================================================================================="
|
||||||
Write-Host "Done."
|
Write-Host "Done."
|
||||||
|
|||||||
Reference in New Issue
Block a user