PowerShell function to find stale and old trusts in your Active Directory

Trusts… most of the times you create them and never look back… until you have to create a new one.
So what about legacy/ancient trusts? Trusts you don’t need? Trusts that aren’t in use?
Again a post that goes in the category of a clean ‘n healthy environment: A PowerShell function to find stale trusts in your Active Directory.
…and trust me when I write that this can be an eye-opener in many environments 🙂

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

functionGet-ADStaleTrusts{

&lt;#

.SYNOPSIS

Performs an inventory of the trusts inyour Active Directory environment.

.DESCRIPTION

PErforms an inventory of the trusts inyour Active Directory environment