Solved

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

Posted on 2015-02-11
5
297 Views
Last Modified: 2015-02-11
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
0
Comment
Question by:TJOSY
  • 3
5 Comments
 
LVL 53

Accepted Solution

by:
Will Szymkowski earned 500 total points
ID: 40604046
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
 
LVL 33

Expert Comment

by:it_saige
ID: 40604077
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
 
LVL 53

Expert Comment

by:Will Szymkowski
ID: 40604082
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
 

Author Comment

by:TJOSY
ID: 40604091
Thank you Will.. question: can I have this script customized for a specific Active Directory OU
0
 
LVL 53

Assisted Solution

by:Will Szymkowski
Will Szymkowski earned 500 total points
ID: 40604874
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

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
In this article we will learn how to backup a VMware farm using Nakivo Backup & Replication. In this tutorial we will install the software on a Windows 2012 R2 Server.
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question