Use PowerShell to find Operating System on specific OU

With the Get-ADComputer cmdlet you can get the Windows Operating System version of a specific OU. This can be useful if you plan a upgrade or migration in your organization. You need import the Active Directory module to accomplish this task. The Active Directory module is imported by default if RSAT is installed, if not, then you can install it using the following command:

You can get a list of all the properties of an ADComputer object by running the following command:

Find computer information on specific OU

To display the information about the computer objects in a specific OU we use the SearchBase parameter:

You can also use filtering. For example, if you want get all the servers with Windows Server OS Installed, run the following command:

You can export the search result from Get-ADComputer cmdlet by pipe the Export-CSV command:

Thank you for spending some time at my site and in my blog. I hope you come to visit again soon 😉

About Lex van der Horst 201 Articles

Be the first to comment

Leave a Reply