ceez Posted July 2, 2006 Posted July 2, 2006 (edited) Hello fellow msfn'ers!We currently have about 30 different logon scripts and i know for a fact that not all of them are being used. I want to clean them up from our sysvol\scripts folder and only leave the one's that are being used. Is there a way to enumerate all the accounts in AD and have it 'spit out' the logon scripts for the users? This way i can compare the list to the scripts that we have and delete the ones that are not used.thanks for your help,ceezps- actually had 65 scripts, cut it down to 50! So much easier now when having to edit scripts, i am not wasting time fixing 15 useless ones! Edited July 3, 2006 by ceez
hosebeast Posted July 3, 2006 Posted July 3, 2006 (edited) On a domain controller, run:CSVDE -F c:\logonscr.csv -R "(&(objectCategory=user)(scriptPath=*))" -L sAMAccountName,scriptPathThis will give you a comma-delimited text file which can be imported into something like Excel if you want to sort/filter easily. There will be 3 columns: the user's DN (distinguishedName in AD), the username (easier to read if you want to print a list), and the logon script. The file will look like this:DN,sAMAccountName,scriptPath"CN=Administrator,CN=Users,DC=yourdomain,DC=local",Administrator,adminlogon.bat"CN=Joe Blow,OU=Sales,OU=Western Region,DC=yourdomain,DC=local",JBlow,saleslogon.bat"CN=Jane Doe,OU=Accounting,OU=CorpHQ,DC=yourdomain,DC=local",JDoe,acctlogon.batOf course, all of this is based on the assumption that your logon scripts have been assigned the old NT way. If you have assigned any logon scripts via GPO, this will not find them. On the other hand, any which have been assigned via GPO would be quick & easy to find using the GPMC. Edited July 3, 2006 by hosebeast
ceez Posted July 3, 2006 Author Posted July 3, 2006 @hosebeast, that is excellent, just was i was looking for!I googled that csvde and a good resource site for anyone else interested http://www.computerperformance.co.uk/Logon/Logon_CSVDE.htmthanks again, I wonder why that command never came up in any of my google searches!?!?!
jftuga Posted July 3, 2006 Posted July 3, 2006 CSVDE looks like a pretty neat tool. Thanks for the link!-John
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now