davehull / Kansa

A Powershell incident response framework
Apache License 2.0
1.56k stars 266 forks source link

Update kansa.ps1 #115

Closed jvaldezjr1 closed 9 years ago

jvaldezjr1 commented 9 years ago

Starting after line 446 is where I inserted this code to write the targets to a file.

Added code to save the target list when AD is queried for hosts, and write data to a file. There was some replication issues with some AD objects, so I've also added code to resolve those. In some AD environments, when there are duplicate object names, AD will add the objectGUID to the Name displayed in the format of "hostname\0ACNF:ObjectGUID". If you expand the property Name, you get 2 lines returned, the hostname, and then CNF:ObjectGUID. Code will take the first line from that object and reassign it back into the targets list.

This will satisfy issue #114