PowerShell to search for domain Computer objects

  • Comments posted to this topic are about the item PowerShell to search for domain Computer objects

  • Hello Fahim,

    How is this different from

    Get-ADComputer "RAL" | select Name, DistinguishedName | fl

    ?

    Thank you,

    AK

  • aleksbor (4/30/2013)


    ...

    How is this different from

    Get-ADComputer "RAL" | select Name, DistinguishedName | fl

    ...

    In order to use that Cmdlet, I had to activate the ActiveDirectory feature of windows on the querying server.

    Personally I wouldn't want to install the ActiveDirectory feature on my SQL Server, which is where I would be querying from, hence I'd be without the "Get-ADComputer".

    I tried to import the module alone, but with no luck, maybe there is a way and I just didn't get it.

    This is why I wrote that longer script that used commands already available inside my non-AD server.

  • I see. I usually do this sort of thing from my PC. Also, I beleive in PS V3 modules load automatically...

  • If I could get your command to work, without installing the AD feature, I'd love to get that working. I agree, my work-around is much less efficient.

    Please send me instructions or details I'd love to give it a shot, and update my article.

  • Load one of those (depending on OS):

    http://www.microsoft.com/en-in/download/details.aspx?id=34595

    and run that command I posted earlier.

  • It turns out that I already had the latest version of PowerShell.

    However what I needed to do was install a Windows Feature called "RSAT-AD-PowerShell", which then allowed me to run your CMDlet.

    Now that I can run the Get-ADComputer cmdlet, how do you wildcard the name ? Or do I have to write that Filter wrapper in Powershell ?

  • You may try something of this sort:

    Get-ADComputer -SearchBase "OU=Servers,OU=Computers,DC=you_domain,DC=local" -Filter *

    get-help get-adcomputer -examples will show you more examples.

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply