Need PS script to find out which ID has been used to add system to domain

darshan kumar 1 Reputation point
2021-09-15T08:04:34.687+00:00

Hi

I need a PS script to find out who added system to domain, i am able to get hostname created & last logon date.

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,364 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Andreas Baumgarten 96,361 Reputation points MVP
    2021-09-15T08:38:25.213+00:00

    Hi @darshan kumar ,

    as far as I know there is no attribute in AD for the computer class storing the information who added the computer in AD domain.

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten

    1 person found this answer helpful.
    0 comments No comments

  2. Limitless Technology 39,351 Reputation points
    2021-09-15T13:35:48.23+00:00

    Hi there,

    Get domain information from Active Directory
    PS C:\> Get-ADDomain -Identity user.com
    This command gets the domain information for the domain user.com.
    Get domain information of the current local computer domain
    PS C:\> Get-ADDomain -Current LocalComputer
    This command gets the domain information of the current local computer domain.
    This link might be helpful for you https://learn.microsoft.com/en-us/powershell/module/activedirectory/get-addomain?view=windowsserver2019-ps

    Hope this answers all your queries, if not please do repost back.
    If an Answer is helpful, please click "Accept Answer" and upvote it : )

    0 comments No comments