Zeto-Trust | Minimalize permissions | Auto-Assign permissions at the end of month; rollback permissions on 1st day of the month.

Posted: 01/16/2024 in security

Why user need to has access to APP if he only needs access at the end of the month?

Solution:
$groupName = "AppXYZ"
$domainController = "your_domain_controller"
$userToAdd = "username"
$currentDate = Get-Date
if ($currentDate.Day -eq 25)
Add-ADGroupMember -Identity $groupName -Members $userToAdd -Server $domainController
else
if ($currentDate.Day -eq 1)
Remove-ADGroupMember -Identity $groupName -Members $userToAdd -Server $domainController


Leave a comment