We have server 2003 r2 and therefore do no have the powershell module for AD.
On powershell i typed in
$comp=dsquery computer -name *
it give me the full OU path e.g "CN=PC249083166313,OU=WA Computers,OU=Wales (WA),OU=Professional Services (PS),OU=Departmental Accounts,OU=CI,DC=ci,
however I only need the computer name in the variable $comp,
I then need to run an query and find out who is logged onto these machines and put it in an excel spreadsheet. How can I do this?
Thank in advance for the help.