Tag Archives: PowerShell

Get List of User Profile Folders (PoSH)

Published by:

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.
Continue reading

Remove Recent Printers from Chrome Preferences File (PoSH)

Published by:

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.
Continue reading

PowerShell Script to Report SCCM DP Disk Space

Published by:

I wrote the following script to quickly output how much disk space my SCCM Distribution Points consumed.  If you’re not running a CAS, you’ll want to change line 21 to point to your primary.  This requires that you have the Configuration Manager console installed on the machine.

It’s not pretty but it did the trick.  I’m certainly open to suggestions in the comments.

Continue reading

PowerShell Script to Output GPO Versions across DCs

Published by:

I wrote the following PowerShell script so that I could easily watch my GPO changes replicate around the globe, letting me know when I could have someone at a specific site update policy when new policies or changes were rolled out. To use, just replace $gpoGUID = “{12345678-1234-5678-9123-ABCDEFEDCBA0}” with the GUID of the policy you want to check on.  You can find the GPO GUID in the properties of the GPO and on the details page in the Group Policy Management Console.

Continue reading