Script to export "managedBy" attribute for all Computers in AD

Hi, kindly assist to have script (VBS or Powershell) to export below informations on computer objects within a Active Directory OU.

Computer name
Operating System
Operating System Version
Service Pack
managedBy
Date of Creation
TJOSYAsked:
Who is Participating?
 
Will SzymkowskiConnect With a Mentor Senior Solution ArchitectCommented:
pretty straightforward use the below script.
Import-module activedirectory
Get-ADComputer -Filter * -Properties name, operatingsystem, operatingsystemversion, OperatingSystemServicePack, managedby, whenCreated | select name, operatingsystem, operatingsystemversion, OperatingSystemServicePack, managedby, whenCreated | Export-csv "c:\ComputerSpecs.csv" -notypeinformation

Open in new window



Will.
0
 
it_saigeDeveloperCommented:
Will is just on it today.  I swear this is the 80th question I have opened today with him being the first responder.  ;)

-saige-
0
 
Will SzymkowskiSenior Solution ArchitectCommented:
Will is just on it today.  I swear this is the 80th question I have opened today with him being the first responder.

Slow day at the office ROFL!

Will.
0
 
TJOSYAuthor Commented:
Thank you Will.. question: can I have this script customized for a specific Active Directory OU
0
 
Will SzymkowskiConnect With a Mentor Senior Solution ArchitectCommented:
Sure use the following command below...

Import-module activedirectory
Get-ADComputer -Filter * -searchbase "ou=myou,dc=domain,dc=com" -Properties name, operatingsystem, operatingsystemversion, OperatingSystemServicePack, managedby, whenCreated | select name, operatingsystem, operatingsystemversion, OperatingSystemServicePack, managedby, whenCreated | Export-csv "c:\ComputerSpecs.csv" -notypeinformation

Open in new window


Change -searchbase "ou=myou,dc=domain,dc=com" to the OU in your domain environment.

Will.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.