PowerShell

Active Directory: How to retrieve the Domain SID

Recently I needed the domain SID to configure MFA with a 3rd party tool. Where can I get the domain SID? That’s exactly what I will show in this blog post. Let’s get started!

Retrieving Domain SID

Open PowerShell. Hit the keys and enter the One-Liner below to retrieve the Domain SID of your Active Directory Domain.

(Get-ADDomain).DomainSID.Value 

With this command the domain SID is not displayed, it is copied to the clipboard.

(Get-ADDomain).DomainSID.Value | Set-Clipboard

To save the domain SID to a file execute the following command.

(Get-ADDomain).DomainSID.Value | Out-File $home\domainsid.txt

I hope this post was helpful for one or the other.

1 reply »

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.