Hi
I would like to change the name of severel but not all
users in a lot of windows 2000 servers. Does anybody know
how to do this with scripting. Or any other way as well?
Best Regards Henrik Alstsrsjo

Re: Renaming local user in Windows 2000 by Torgeir

Torgeir
Wed Sep 17 13:28:00 CDT 2003

Henrik Alstersjo wrote:

> I would like to change the name of severel but not all
> users in a lot of windows 2000 servers. Does anybody know
> how to do this with scripting. Or any other way as well?

Hi

Script below renames local users on a computer (local or remote), using ADSI
from a vbscript.


' code start

sOldUser = "Administrator"
sNewUser = "RenamedAdmin"


sComputerName = "SomeComputer"

' If you want to do this on the local computer, enable the following lines
' to get computer name for local computer
'Set oWshNet = CreateObject("WScript.Network")
'sComputerName = oWshNet.ComputerName

Set oComputer = GetObject("WinNT://" & sComputerName)

' Turn off error handling in case sOldUser does not exist
On Error Resume Next
Set oUser = GetObject("WinNT://" & sComputerName & "/" & sOldUser & ",user")
Set oNewUser = oComputer.MoveHere(oUser.ADsPath, sNewUser)
On Error Goto 0


--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter



Re: Renaming local user in Windows 2000 by Ray

Ray
Wed Sep 17 13:46:45 CDT 2003

cusrmgr -u username -m machinename -r newusername

cusrmgr is from the Windows Resource Kit.

Ray at work

> Henrik Alstersjo
> I would like to change the name of severel but not all
> users in a lot of windows 2000 servers. Does anybody know
> how to do this with scripting. Or any other way as well?



Re: Renaming local user in Windows 2000 by henrik

henrik
Thu Sep 18 01:26:37 CDT 2003

Thanks to booth of you. You just saved me a lot of manual
work.
Best Regards Henrik
>-----Original Message-----
>cusrmgr -u username -m machinename -r newusername
>
>cusrmgr is from the Windows Resource Kit.
>
>Ray at work
>
>> Henrik Alstersjo
>> I would like to change the name of severel but not all
>> users in a lot of windows 2000 servers. Does anybody
know
>> how to do this with scripting. Or any other way as
well?
>
>
>.
>