Make Changes to All Profiles - VB Script
Updated: 18 Aug 2008 | 1 comment
This is a simple VB script to modify all the profiles at once. Most the time you can use the "All Users" profile to make changes to all the profiles but there has been times when I've found this little script handy. For instance, it's a nice way of printing out all profiles on a system. But there are many things that this script can do.
'This script will allow you to make changes to all current profiles in the system
' strValue = user profiles (C:\Documents and Settings\profile)
On Error Resume Next
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set objRegistry=GetObject("winmgmts:\\" & _
strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"
objRegistry.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubkeys
For Each objSubkey In arrSubkeys
strValueName = "ProfileImagePath"
strSubPath = strKeyPath & "\" & objSubkey
objRegistry.GetExpandedStringValue HKEY_LOCAL_MACHINE,strSubPath,strValueName,strValue
'replace this line with the tasks you wish to accomplish with the profiles. Use the strValue varible
Wscript.Echo strValue
Next
As you will notice, there is a place in the for loop of the script to add the action item you would like taken place. Play with it, hope somebody else finds something useful for this.
If you have questions, you can reach me on the Altiris Juice Chat, my nick is MtBiker
blog entry Filed Under:
Group Ownership:

The Endpoint Management Community Blog is the perfect place to share short, timely insights including product tips, news and other information relevant to the Endpoint Management community. Any authenticated Connect member can contribute to this blog.
Comments
Good Start for profile enumeration
This is a good start to generate a list of profile GUIDs (which I've needed in the past) and profile locations. A little more work is needed if you want to modify settings within those profiles. You'd want to mount the ntuser.dat located in the paths you find and then modify desired settings within those temporary hive mountpoints.
Joe VanHollebeke
Systems Engineer
Please improve the connect community... give a thumbs up to useful posts and mark solutions as solutions!
Would you like to reply?
Login or Register to post your comment.