PowerTip: Use PowerShell to Get a List of Computers and IP Addresses from Active Directory

PowerTip: Use PowerShell to Get a List of Computers and IP Addresses from Active Directory

  • Comments 5
  • Likes

Summary: Use Windows PowerShell and the Active Directory module to get a listing of computers and IP addresses from Active Directory.

Hey, Scripting Guy! Question How can I get a list of all computers, the operating system version, the service pack, and the IP address from Active Directory?

Hey, Scripting Guy! Answer Use the Get-ADComputer cmdlet and specify the ipv4AddressOperatingSystem, and OperatingSystemServicePack properties, as shown here.

Get-ADComputer -Filter * -Properties ipv4Address, OperatingSystem, OperatingSystemServicePack | Format-List name, ipv4*, oper*

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • <p>That helped me a lot!</p>

  • <p>Hi,</p> <p>Get-ADComputer retreives the IP configuration from DNS - right? So it&#39;s not an actual configuration from the client directly?</p>

  • <p>Great scrip! </p>

  • <p>the only comment i would make is after Get-AdComputer, is put </p> <p>-SearchBase &#39;OU=Computers,DC=your,DC=domain,DC=com&#39; if &nbsp;you want to get a SPECIFIC OU vs. the entire domain. &nbsp;(i realize the question was for AD and might have inferred entire directory but in case you wanted just a small subset, this will do.)</p>

  • Hey, Scripting Guy If possible can we get the AD site for ever device?