이 사이트를 이용함으로써, 당신은 다음에 동의합니다 개인 정보 보호 정책.
수용하다
엔터인IT엔터인IT엔터인IT
  • 집
  • IT 프로
  • 기술
  • 마이크로 소프트
    • 하늘빛
    • 구성 관리자/SCCM
    • DPM
    • 오케스트레이터
    • Hyper-V
    • 마이크로소프트 엣지 인사이더
    • MSI
    • 사무실 365
    • 사무실 내부자
    • 파워 BI
    • 스카이프
    • SQL 서버
    • 팀
  • 창
    • Windows 관리 센터
    • 윈도우 클라이언트
    • 윈도우 서버
  • SCCM 쿼리 컬렉션 목록
독서: PowerShell Enable Active Directory Recycle Bin
글꼴 크기 조정기아아
엔터인IT엔터인IT
글꼴 크기 조정기아아
  • 집
  • IT 프로
  • 기술
  • 마이크로 소프트
  • 창
  • SCCM 쿼리 컬렉션 목록
찾다
  • 집
  • IT 프로
  • 기술
  • 마이크로 소프트
    • 하늘빛
    • 구성 관리자/SCCM
    • DPM
    • 오케스트레이터
    • Hyper-V
    • 마이크로소프트 엣지 인사이더
    • MSI
    • 사무실 365
    • 사무실 내부자
    • 파워 BI
    • 스카이프
    • SQL 서버
    • 팀
  • 창
    • Windows 관리 센터
    • 윈도우 클라이언트
    • 윈도우 서버
  • SCCM 쿼리 컬렉션 목록
그것은 프로

PowerShell Enable Active Directory Recycle Bin

게시: 2월 18, 2024
4 최소 읽기
공유하다

PowerShell Enable Active Directory Recycle Bin, work in Windows Server 2012/2012R2/2016/2019.

1. Enabling Recycle Bin (윈도우 서버 2008 R2):

To enable recycle bin:

  • Open Powershell on the PDC (Primary Domain Controller).

메모: To confirm which server is the primary DC, run the below command:

Get-ADForest | fl
  • Make sure that the server you are using is the SchemaMaster or else the command will not work. Check that the ForestMode shows up as Windows2008R2Forest. If not, run Import-Module ActiveDirectory, then run the following command:
Set-ADForestMode –Identity <yourdomainname> -ForestMode Windows2008R2Forest
  • enable it using Active Directory Domains and Trusts by right-clicking on the top-level item and selecting Raise forest functional level. Please note that this option needs replication if one or more DCs exist, therefore running the PowerShell command yields faster results.
  • Once enabled run the following command in PowerShell:
Enable-ADOptionalFeature –Identity 'CN=Recycle Bin 
Feature,CN=Optional Features,CN=Directory Service,CN=Windows 
NT,CN=Services,CN=Configuration,DC=domain' –Scope 
ForestOrConfigurationSet –Target '<yourdomainname>'

By default, the deleted object lifetime and tombstone lifetime in AD is set to 60 days. If this is not enough, you can modify the value by running the below commands (the below example sets them to 1 year):

Set-ADObject -Identity “CN=Directory Service,CN=Windows  NT,CN=Services,CN=Configuration,DC=domain” –Partition  "CN=Configuration,DC=contoso,DC=com" –Replace:@{"tombstoneLifetime" =  365} 
Set-ADObject -Identity "CN=Directory Service,CN=Windows  NT,CN=Services,CN=Configuration,DC=domain" –Partition  "CN=Configuration,DC=domain"  –Replace:@{"msDS-DeletedObjectLifetime" = 365}

2. How to restore an object:

First, search for the object using one of the following commands using PowerShell. Don’t forget to run the command:

Import-Module ActiveDirectory

Search for all objects:

get-adobject -filter 'IsDeleted -eq $True' -IncludeDeletedObjects 
-properties IsDeleted,LastKnownParent | Format-List 
Name,IsDeleted,LastKnownParent,DistinguishedName

Search for a particular user:

Get-ADObject -Filter {displayName -eq "Name"} -IncludeDeletedObjects

(where Name is the display name of the user)

Once the user or object is found, restore it using the following command:

Get-ADObject -Filter {displayName -eq "Name"} -IncludeDeletedObjects | Restore-ADObject

This will restore it to its last OU location

3. Enabling Recycle Bin (Windows Server 2012/2012R2/2016/2019)

In this version enabled by default. Confirm that the forest functional level is at least Windows2008R2. Once completed:

  • Open Active Directory Administrative Center
  • Right-click on the domain name and select Enable Active Directory Recycle Bin
  • Being that this option changes the collection structure for AD, a prompt will show that this action is irreversible. Press Ok
  • Wait for the change to apply
  • Done

4. How to restore an object (Windows Server 2012/2012R2/2016/2019):

  • To restore an object:
  • Open Active Directory Administrative Center;
  • Click on the domain name folder and open the Deleted Objects folder from the list;
  • Find the object and select Restore. This will automatically restore it to the location from where the object was deleted;
  • To restore the object in another folder or OU, select Restore To;
  • Done
태그됨:Microsoft Windows 서버파워셸창
이전 기사 WordPress Wp-Vcd, deloplen and pushqwer malware remove
다음 기사 How to reset PC BIOS/CMOS
코멘트를 남겨주세요 코멘트를 남겨주세요

답장을 남겨주세요 답장 취소

귀하의 이메일 주소는 공개되지 않습니다. 필수 입력란이 표시되어 있습니다 *

이 사이트는 스팸을 줄이기 위해 Akismet을 사용합니다.. 댓글 데이터가 처리되는 방법 알아보기.

번역

English中文(简体)DanskNederlandsFrançaisDeutschItaliano한국어PolskiPortuguêsRomânăEspañolУкраїнська
~에 의해 Transposh - translation plugin for wordpress

인기 게시물

Windows Server의 시스템 요구 사항 2016
윈도우 서버
구성 관리자 쿼리 컬렉션 목록
구성 관리자 쿼리 컬렉션 목록
configmgr
클래식 팀 사이트의 최신 페이지에서 구조적/관리형 탐색 활성화
기술
SCCM이 DP 위치를 MP에서 예상 버전으로 가져오지 못했습니다.
configmgr

최근 게시물

Ubuntu에서 SSH 보호를 위한 Fail2ban 설치 및 구성 24.04
리눅스
AlmaLinux에서 FirewallD 활성화 및 구성
리눅스
AlmaLinux에서 사용자 생성 및 SSH 키 설정
리눅스
AlmaLinux에서 비밀번호를 재설정하는 방법
리눅스

© 2023 엔터인IT

모바일 버전으로 이동하십시오
돌아온 것을 환영합니다!

귀하의 계정에 로그인하세요

사용자 이름 또는 이메일 주소
비밀번호

비밀번호를 잃어버렸습니다?