get-adcomputer syntax assistance

I want to run the get-adcomputer report - as described here: 

Can anyone help me develop the command to syntax to list all properties/fields for all ad computers, and also write the report out to a CSV file. I am new to such cmdlets.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Qlemo"Batchelor", Developer and EE Topic AdvisorCommented:
This is not useful. Restrict yourself to interesting attributes! But if you need to:
Get-ADComputer -ResultSize unrestricted -Filter * -Properties * |
  export-csv -NoType C:\Temp\EE\ADComputer.Txt

Open in new window

Subash SundharanIT Infrastructure Architect Commented:
If you need all properties then
Get-ADComputer -Filter * -Properties * | Export-csv  C:\report.csv -nti

Open in new window

Or you can slo select specific properties..
Get-ADComputer -Filter * -Properties * | Select Name,DNSHostName,IPv4Address  | Export-csv  C:\report.csv -nti

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
pma111Author Commented:
Thanks both - is there any specific attribute that would give clues as to whether a specific wokrstation is being used? Can you provide any tips what field you would use to try and root out stale machines that have perhaps been recycled and not removed from AD..?
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

pma111Author Commented:
If you dont add " -ResultSize unrestricted " to the command, does powershell stop at a specific number of results? if so what is that value? i.e. how many records will it return?
Subash SundharanIT Infrastructure Architect Commented:
There is no -ResultSize parameter for Get-ADComputer command, Get-ADComputer -Filter * should return all computer objects.

There is no property in AD computer object to tell you whether the computer is being used. You can use LastLogonDate, to find when the last time computer logged in to AD.

Another option to find inactive accounts is to use Search-ADAccount. For example, To find all computer accounts that have been inactive for the last 90 days
Search-ADAccount -ComputersOnly -AccountInactive -TimeSpan 90

Open in new window

Will SzymkowskiSenior Solution ArchitectCommented:
Thanks both - is there any specific attribute that would give clues as to whether a specific wokrstation is being used

You can use the attributes Enabled, LastLogonDate or LastLogonTimeStamp to get info on this machine and if it is actually being used.

If you dont add " -ResultSize unrestricted "

ResultSize is not part of this cmdlet for get-adcomputer. So it will return all of the computers that is finds in Active Directory.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.