Discussion:
Change User Account Type
(too old to reply)
Pete Gomersall
2009-09-22 17:00:01 UTC
Permalink
Hi,
Does anyone know how to programmatically (VBScript and PowerShell) change an
account type from roaming to local?
The equivalent of System Tool > Advanced > User Profiles > Account Name >
Change Type.
Pete
Justin Rich
2009-09-25 14:42:09 UTC
Permalink
you probably want to compare what that does in user management, but im
guessing it changes the profile location?
if you go to computer management and the user account, its likely that it
modifies stuff on the profile tab.

if that is the case you can use ADSI to make those changes pretty easily..

either way im sure you can do it with ADSI you just need to figure out what
exactly is changing when you do that..

you can get the user account in to an object like so

$user = [ADSI]"WinNT://joe-pc/joe" (didnt test this, just yanked it
off the net but should work fine)

a quick google of 'powershell adsi' will get you a good about of info
Post by Pete Gomersall
Hi,
Does anyone know how to programmatically (VBScript and PowerShell) change
an account type from roaming to local?
The equivalent of System Tool > Advanced > User Profiles > Account Name >
Change Type.
Pete
Pete Gomersall
2009-09-29 14:48:42 UTC
Permalink
All Found solution:
In each user key in SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
there is SubKey - Preference.
Set DWORD entry UserPreference to 0
Pete
Post by Pete Gomersall
Hi,
Does anyone know how to programmatically (VBScript and PowerShell) change
an account type from roaming to local?
The equivalent of System Tool > Advanced > User Profiles > Account Name >
Change Type.
Pete
Thomas Lee
2009-10-01 14:19:05 UTC
Permalink
Post by Pete Gomersall
In each user key in SOFTWARE\Microsoft\Windows
NT\CurrentVersion\ProfileList there is SubKey - Preference.
Set DWORD entry UserPreference to 0
Have you tried this?
--
Thomas Lee
***@gmail.com
PowerShell MVP
Pete Gomersall
2009-10-02 19:24:40 UTC
Permalink
Hi Thomas,
This works.
Some background: we have a lab of W7 x64 machines and we set roaming profile
path in a GPO with system/User Profiles - Set roaming profile path for all
users logging onto this computer. This causes the system to sync local
profiles to the profile server, which we do not want.

Created a vbscript to find Administrators sub-key in profile list, add the
Preference sub-key if it didn't exist and set DWORD value to 0,
When I then logged on as Administrator, I was not bugged by cannot sync your
roaming profile and looking in the UI the profile was set to Local, not
Roaming.

On a related point, however, I found out yesterday that the GPO setting I
mention at the start of this message doesn't work as I think it should.
We have a path set like this:
\\servername\sharename\%USERNAME%.%USERDOMAIN%. However %USERDOMAIN%, is
incorrctly applied. The domain of the computer account is always applied not
the users domain. This is a problem for us as we have identical usernames in
multiple domains.
I have posted to the windows.group_policy forum, but have not heard back
from anyone.
http://social.technet.microsoft.com/Forums/en-US/winserverGP/thread/de728f20-29f7-4268-9643-8195e4492ad1
I would be interesed if you know anything?
Pete
Pete Gomersall
IT Systems Manager, College of Engineering, Forestry and Natural Sciences
Northern Arizona University
MCSA Windows 2003, MCSE (Windows NT4, 2000 & 2003), MCDBA & MCT
Post by Thomas Lee
Post by Pete Gomersall
In each user key in SOFTWARE\Microsoft\Windows
NT\CurrentVersion\ProfileList there is SubKey - Preference.
Set DWORD entry UserPreference to 0
Have you tried this?
--
Thomas Lee
PowerShell MVP
Thomas Lee
2009-10-03 08:00:03 UTC
Permalink
Post by Pete Gomersall
Hi Thomas,
This works
Cool - I thought this was done in the AD, not the registry. Which is why
I asked!
Post by Pete Gomersall
I would be interesed if you know anything?
Not really.
--
Thomas Lee
***@gmail.com
PowerShell MVP
Loading...