Tuesday 21 February 2017

Output all AD user 'scriptpath' attributes to CSV

As the title suggests, a one liner to output all 'scriptpath' attributes currently set within Active Directory.


Get-ADUser -filter * -properties scriptpath | ft Name, Scriptpath > C:\Temp\AD-ScriptPaths.txt


You may wish to expand on your search by filtering out accurate values, say logon\logon.bat. The following would achieve this -


Get-ADUser -filter {scriptpath -notlike "logon\logon.bat"} -properties scriptpath | ft Name, Scriptpath > C:\Temp\AD-ScriptPaths.txt

No comments:

Post a Comment

PerfC Vaccination for ExPetr/Petya/NotPetya Wiper

This is a script I've written to 'vaccinate' our domain against the ExPetr/Petya/NotPetya Wiper. In short, it finds all comput...