I put together the following script to help a small group configure Microsoft Access during login in a kiosk environment. You’re welcome to steal and modify as you see fit. For all the options you can possibly set, see this MSDN page (ignore the comment that it’s for Visual Basic…)
I created the follow SQL query to create a batch file that uninstalls all known versions of a piece of software. Feel free to use and tweak as you see fit. You should build the query first to make sure you’re only identifying the GUIDs for software you really want to uninstall. You’ll need to setup SSMS to output as text instead of grid view, then copy and paste into a new batch file and trim the top and bottom a bit to remove the junk that comes with the output.
The following SQL should help identify the state of impacted systems. Please review thoroughly before relying on this information, while I believe the results should be accurate, you should do your own due diligence. Please let me know if you find any errors or have any suggestions to return better data.
More information on INTEL-SA-00075 here.
The following snippet of PowerShell will collect the list of profiles active on a system from the registry and populate an array.
I remove any profile folder that does not exist, as well as any that are within the Windows folder (e.g. NetworkService, LocalSystem), but you can modify as you see fit if that doesn’t meet your needs. I use this when I need to add files, remove files, or make changes to files within a users profile.
You could just loop over C:\USERS\ subfolders and be fine 9,999/10,000 times, but this covers those circumstances where profiles have been stored elsewhere, where C: is not the drive with the profiles, or when you need to make sure you’re not modifying folders that aren’t true profiles.
Chrome does not remove “Recent Printers” from the print option box when a user or an administrator deletes a printer from the machine. This can cause problems when a printer is removed by policy or is updated with a new print server name, but a user continues totry and print to the old server. This script will remove the printer from the PREFERENCES file. You can provide no printer list and all Recent Printers will be removed, or you can specific a specific printer.