Answer the question
In order to leave comments, you need to log in
Completely disable an Active Directory account?
Such a task is worth it.
You need to disable the account in Active Directory, then move it to a separate remote users folder. And the exchange mail needs to be removed from the list of addresses and moved to the remote database.
How can this be done through Powershell?
Answer the question
In order to leave comments, you need to log in
1. It has already been said above. in addition, I can also suggest Set-ADUser -Enabled: $false
2. It seems to me that you meant Exchange commands
. So you need
Set-Mailbox --HiddenFromAddressListsEnabled:$true
It is also an AD attribute msExchHideFromAddressLists
and
New-MoveRequest -TargetDatabase "DbForDisabledUsers"
Hey!
Here you will have 2 tasks in 1 script:
1 - Use this Disable-ADAccount cmdlet
2 - I did not fully understand the task of moving. But probably you just want to disable some kind of mail. You need the Disable-Mailbox cmdlet . There are also Get and Set implementations, if something needs to be looked at or changed beforehand.
account blocking https://theitbros.com/active-directory-disable-account/
transfer to another location
Get-ADUser $name| Move-ADObject -TargetPath 'OU=nonactive,OU=compny,DC=domain,Dc=net'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question