Tag Archives: powershell

Powershell list all properties of an object

Some powershell get commands only output a handful of the object properties get-CalendarProcessing being one such command, than returns just one property.

To get all properties of an object you can pipe to format-list *
get-CalendarProcessing -identity [email protected] | Format-List *

If you know the specific attribute you are after you can still access this variable using select-object.
get-CalendarProcessing -Identity [email protected] | Select-Object AllowConflicts

Get Boot Time For all computers in an OU – Powershell

I wrote the following script enumerates an OU and then looks up the last boot time for each computer.

https://github.com/mikedixson/GetLastBootTimeFromOU

Note: I’m starting to put any scripts I write on GitHub, this will make it easier for you copy down and easier for me to keep any scripts up to date.

Easy GPO Audit Using Powershell

After poking around the Group Policy Objects (GPO) of an infrastructure that was new to me I needed a decent way of producing a quick and useful report on the state of the GPOs.

Because the ComputerVersion and UserVersion numbers are listed as two figures, one for AD and one for Sysvol just an export-csv of get-gpo left me with blank ComputerVersion and UserVersion.

I found this post: https://community.spiceworks.com/topic/551588-get-gpo-userversion-and-computerversion-troubles

By using the following powershell I was able to within minutes provide useful information on the state of the GPOs.

get-gpo -all | select Displayname,ID,Description,GPOStatus,CreationTime,ModificationTime,@{Label="ComputerVersion";Expression{$_.computer.dsversion}},@{Label="UserVersion";Expression={$_.user.dsversion}}| export-csv gpo-audit.csv

A small bit of conditional formatting later and we can see that the Domain GPO has a large amount of user setting edits and should be split into a user only GPO and a computer GPO (I won’t go into where these GPOs should be linked at this stage).
A snipping of an excel spreadsheet with colour coding providing meaning to the figures