Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account


Photo

MoveUser.EXE replacement (WIN32_UserProfile)

- - - - -

  • Please log in to reply
2 replies to this topic

#1
trtkron

trtkron

    Newbie

  • Member
  • 24 posts
  • Joined 20-February 07
The MS documentation is super poor. They call it a direct replacement and then the only example they cite using it... is delete. Has anyone gotten it to work like MoveUser?

I'm refering to this. http://support.microsoft.com/kb/930955

Edited by trtkron, 27 June 2007 - 09:29 AM.



How to remove advertisement from MSFN

#2
tap52384

tap52384

    nLite Lover

  • Member
  • PipPipPip
  • 331 posts
  • Joined 11-August 04
maybe this will help:

http://www.kbalertz....ion.Update.aspx

#3
trtkron

trtkron

    Newbie

  • Member
  • 24 posts
  • Joined 20-February 07
If anyone else needs it, I finally got something working.

Set oShare = GetObject("winmgmts:\\.\root\CIMV2").Get("Win32_UserProfile.SID=""" & sSIDLocal & """")
Set oInParam = oShare.Methods_("ChangeOwner").InParameters.SpawnInstance_()
	
oInParam.Properties_.Item("Flags") = 0
oInParam.Properties_.Item("NewOwnerSID") = sSIDDomain
	
Set oOutParams = GetObject("winmgmts:\\.\root\CIMV2").ExecMethod("Win32_UserProfile.SID=""" & sSIDLocal & """", "ChangeOwner", oInParam)

After that, to make it 'just like' MoveUser (at least how I use it here), delete the local account.

Set oAccount = GetObject("winmgmts:\\.\root\cimv2:Win32_UserAccount.Name=""" & sLocalUserID & """")
Set oUserProfile = GetObject("winmgmts:\\.\root\cimv2:Win32_UserProfile.SID='" & oAccount.SID & "'")
If MsgBox("Are you sure you want to delete " & frmMain.cmbLocalUserID.Text, vbYesNo) = vbYes Then
	 oUserProfile.Delete_
End If

Edited by trtkron, 27 June 2007 - 12:28 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users



How to remove advertisement from MSFN